Re: Running a microcontroller in car - power supply aspects
it's not an issue, the buck convertor can easily drive the arduino and the relays.
Running a microcontroller in car - power supply aspects
Collapse
X
-
Re: Running a microcontroller in car - power supply aspects
put a reverse biased 7V zener diode in series
But yeah unfortunately damage's done, should have got the 12V units. Resistor is cheaper than zener, but you may need to calculate an appropriate value. And you can't get away with power consumption, it'll be significant, most of the relays I've seen when an option is given, the power consumption is the same when they're run at their rated voltages, meaning if you have to run on higher voltages, it will use more power overall.
... unless you PWM the input and filter it... HMM... heh heh heh...Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
You can use a resistor to lower the coil voltage from 12V to 5V. Like 47R and dissipating ~1.5W, regardless if a resistor or vreg or zener etc. the heat is made by something.
A relay coil is mostly a resistor anyway, just wirewound with copper. They need a constant amount of power (not current/voltage) to work, so a 5V coil and 12V coil are the same power.
If the relays are only on for a few seconds, then 1W resistors would work. Just takes up space.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Kinda running low on pins on the Mini TBH, though not a bad idea in the long run.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
nice parts, i like the way the contacts have low current pcb pins too.
you could use the mcu to detect relay failure or motor/wiring issues through those pins!Leave a comment:
-
-
Re: Running a microcontroller in car - power supply aspects
the resistance will be in the datasheetLeave a comment:
-
Re: Running a microcontroller in car - power supply aspects
I was thinking of simply adding a resistor in series with the coil to run it off 12v...Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
How many ohms are the 5V relay coils? It looks like 1-4 of them could be on at once, worst case. A big 6V zener?Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Alright guys, here's an update on this project and some pics of the board which is almost ready, component-wise at least. Yes, it actually took me this long to work on it some more - go ahead and laugh
I added the two current sensing boards in the lower-left today, but haven't done any testing because some personal stuff came up just as I was getting ready to plop the Arduino on the headers and upload the code.
Your boy Danny also made a little screw-up: I ordered the wrong relaysI ordered relays with 5v coils, which was the original plan, since I was planning to drive them directly with the Arduino, but then I thought 12v relays and transistors might be better, yet my brain must've been stuck on the 5v idea and hence I ordered 4 of those - fail.
To make matters worse, the first set of 4 I ordered had a knackered one among them which had something rattling inside, so I had no choice but order ANOTHER set of 2 (the minimum quantity the seller offered), so now I have 6 big and blocky 5v relays......
Ok, so what do we do now ? I was just about ready to start over and order a set of the correct 12v relays but that would take a couple of extra months to arrive and with autumn just around the corner here, my time is pretty limited to finish this project and install it (it's already taken a laughable amount of time), plus I don't want to get stuck with 6 hunks of plastic I paid good money for, so I'm thinking of using a resistor in series with them to power them off the battery and still use the transistors to interface with the arduino - haven't done the math yet, but the current on them seems to be around 0.17mA.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
I also got the hang of waking it back up using interrupts 0 and 1 on pins 2 and 3 respectively. I made it so that when you lock the car, the windows roll up and the sleep command is run after the windows have closed. Interrupt 1 is connected to the unlock signal - it wakes the MCU when you unlock the car. Interrupt 0 is the IGN ("ACC", accessory, as I call it) connection - it also wakes the MCU ready to roll some windows when you hop inThe reason I use the unlock signal as an interrupt as well is because I made it so that if you double-click the unlock button, so the "unlock" pin (3) on the Mini gets pulled down twice in succession, the windows roll DOWN, say for those hot sunny days, so the car gets some air before you hop in. The same happens for the "lock" pin (4) - click it twice and the windows go up, then the MCU goes to sleep......it works, but I admit the code is a mess
Nice work I like your approach to this project keep up the good work
When you finally finish this project could you show some pictures of the the setupLeave a comment:
-
Re: Running a microcontroller in car - power supply aspects
I also got the hang of waking it back up using interrupts 0 and 1 on pins 2 and 3 respectively. I made it so that when you lock the car, the windows roll up and the sleep command is run after the windows have closed. Interrupt 1 is connected to the unlock signal - it wakes the MCU when you unlock the car. Interrupt 0 is the IGN ("ACC", accessory, as I call it) connection - it also wakes the MCU ready to roll some windows when you hop inThe reason I use the unlock signal as an interrupt as well is because I made it so that if you double-click the unlock button, so the "unlock" pin (3) on the Mini gets pulled down twice in succession, the windows roll DOWN, say for those hot sunny days, so the car gets some air before you hop in. The same happens for the "lock" pin (4) - click it twice and the windows go up, then the MCU goes to sleep......it works, but I admit the code is a mess
Last edited by Dannyx; 06-01-2020, 01:12 PM.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Are you are using this mode:
Code:set_sleep_mode(SLEEP_MODE_PWR_DOWN);
There are many sleep tutorials, not all correct but they try explain the '328 sleep modes.
When the IGN key is off, I would wait 30 seconds before going to sleep. It's nice to be able to close the car windows without the key back in.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
probably because of the pullup resistorsLeave a comment:
-
Re: Running a microcontroller in car - power supply aspects
UPDATE: I managed to learn a little bit more about this sleep business, enough to put my board to sleep successfully. Indeed it works: the current consumption drops down by a lot, though I noticed it varies quite a lot between two different projects I tried loading on it, despite the same sleep command is used. I think it has something to do with how many pins are defined as inputs vs how many as outputs, because I saw a video where the guy suggests setting all the unused pins as outputs to cut down the current consumption for some reason...Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Not wanting to give up just yet and also to hopefully get at least close to understanding stuff like in post #143, I briefly looked into registers and binary and stuff like that, since I know nothing about that, though I only did it strictly concerning this project for now, nothing too in-depth.
From what I gather, putting an Atmega328p to sleep involves setting the bits in SMCR (Sleep Mode Control Register) in a certain way, depending on how "deep" you want it to sleep and how many features you need disabled to save power. The datasheet talks about this on page 37. I'm not sure HOW you actually do that just yet. The info on Arduino registers although better than nothing, is a bit brief for my taste and mentions nothing of this SMCR.
Waking it up: what I'm trying to achieve is put the board to sleep after it sits idle for a while, then wake it up when a pin like the pins listening for the lock/unlock commands changes state, which if I understand some of these tutorials correctly is called an "external interrupt" which wakes it up once it's put to sleep by setting that SMCR. On the Arduino Mini pins 2 and 3 support this feature....again, that is if I understand this right...Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
It's not about "starting" anything - it's already in place and I have to (at least) somehow back up what's on it, if at all possible, should the whole box fail and need replacing....at which point it'd probably be easier and cheaper to rebuild it from scratch using something I'm more familiar with...Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
You may as well push for a 2A03! <frown>
The 6502 is almost as quirky as a PIC and omits many of the features that are now commonplace in MPUs and MCUs.
While the dual accumulator 6800 is a throwback to the past, the SINGLE accumulator 6502 is even worse! EVERYTHING had to go through the accumulator.
You also lost the advantage of the index registers (now commonly used for structure member references as well as accessing the stack frame).
And, of course, the 6502 had a crippled stack (8 bit SP).
The 6502 belongs cleanly in the past, having failed to anticipate any of the more modern features in processors (micro- or otherwise)Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
It's not about "starting" anything - it's already in place and I have to (at least) somehow back up what's on it, if at all possible, should the whole box fail and need replacing....at which point it'd probably be easier and cheaper to rebuild it from scratch using something I'm more familiar with...Leave a comment:
Related Topics
Collapse
-
by CG2I've got a dehumidifier that has stopped working. Plug it in, press the power switch, and it beeps 5 times. Nothing showing in the display (which is just two 7 segment displays) apart from the two decimal points flashing. The model is a MeacoDry Arete One 18L, which seems to be a rebadged Deye (all the boards are marked Deye). Here's what I've got so far (details in case anyone else in future should need them).
Starting with the power board. Mains power comes in at the red connector top left. The compressor is powered by the orange connector to the right of that and is switched by...5 Photos -
by Kambi13Hi all, need some help. I have a Samsung NP370E4K-KD2BR, which as a 5th Gen Intel CPU that works fine when running with the charger plugged in, but has soon as I remove it and it's running on battery the screen backlight goes off.
Tried different battery - no change
Tried different screen - no change
Removed the plastic film from the screen inverter and looked for pwm signal which as about 3.3v when running with the charger plugged in, when I take it off the voltage drops down to 2.232v, so my best guess is that the EC is not providing the correct voltage.... -
by DannyxGood day folks.
TL;DR: has anyone tried pairing one of THESE "kinetic" battery-less switches with THESE generic remote modules ?
Details: I recently got hit by this craze of wanting to add remote controls to the lights around my house, so I went with those generic 433Mhz remote relay modules found everywhere, which are really basic, easy to use and work well, since I used them before in other projects. What I like most about them is they accept all kinds of 433Mhz remotes that float around Aliexpress, since they're all the same under the hood, save for the...03-08-2022, 11:01 AM -
by SkgodHey I am having Asus Rog strix g15 g513ih hn0865 and it's having display issues while running on igpu. Works fine when I open any game or whatsapp windows application. The issues are :
Black screen, freeze
The weird thing is that when as long as the laptop is running on igpu the problem keeps happening. But as soon as I open any game or whatsapp windows application, the laptop works completely fine.
When the screen freeze or black screen I used to move the display lid up and down and it usually works like that.
So can anyone tell me what would be the possible cause?... -
by FALKLANHowdy everyone! I hope all is well where ever you are!
I'm attempting to integrate a couple of LED pods into an automotive reverse lamp circuit. The problem being, while the vehicle is running there is a 8.5v current present on the reverse lamp power wire. Needless to say is that all LED pods and lights dimly illuminate while the 8.5v is present, so the LEDs are always powered on while the vehicle is running. When the vehicle is shifted into reverse, the voltage changes to 12 volts.
I am uncertain how to convert this line into a switched 12v output line for the LED pods.... - Loading...
- No more items.
Leave a comment: