Re: Running a microcontroller in car - power supply aspects
Updated schematic. Added D6 and D7, plus a simple plot of the lock/unlock pins.
Running a microcontroller in car - power supply aspects
Collapse
X
-
Re: Running a microcontroller in car - power supply aspects
Another thing that confused me is the way those L/UL rails are laid out they look very similar to a split-rail supply, with GND being in the middle, L being let's say + and U/L being -, although it's nothing of the sorts, so that's another thing that threw me off, so you're right: diode across each of those LEDs and I should be good. Can't believe I screwed up on such a simple electronics circuitLeave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Why would Low (Grounded) signal be problem? The MCU signals are ref. to GND. Am I missing something?Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Had another look over the schematic and made another change: the lock/unlock signals on the right now also have optoisolators (PC5 and PC6). This is actually how the circuit is currently set up on the breadboard, but I omitted those two for some reason. Trouble is, I can't add a protection diode there because those pins swing low/high when locking/unlocking. Basically those two wires I labeled there run from the ECU to the 4 actuators in the doors and 1 in the trunk and I need to somehow tap into them to trigger certain functions on the Arduino. It's a simple H-bridge inside the ECU that does this I THINK: when you lock the car, the LOCK pin gets 12v on it and the UNLOCK pin stays low. When you UNLOCK the car, the reverse happens: U/L pin gets 12v on it and the L pin stays LOW. I measured this to confirm. Adding a diode there would create a short, yet I still need to have some sort of protection there, since linear actuators create a ton of inductive kickback which overtime can kill those LEDs. A capacitor perhaps ?Leave a comment:
-
-
Re: Running a microcontroller in car - power supply aspects
I see, trying to keep wiring as original.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
It's mostly out of commodity and to keep the car's circuit as stock as possible. 12v is present at the switches already, so to run off 5v, I'd have to cut the incoming power wires from the car's system to the switches and wire in my 5v line there, which of course would work, but I just don't want to alter that part. It's not a pleasure working on the wires in that dash - very tight in there, with wires going everywhere, so it has to be as plug and play as possible: connect it up then get out of there as quickly as possibleLeave a comment:
-
-
Re: Running a microcontroller in car - power supply aspects
Here's the schematic in KiCad I made...you can mess around with it if you have KiCad installed. It's easier to pass the same project back and forth.Attached FilesLeave a comment:
-
Re: Running a microcontroller in car - power supply aspects
I was showing two possible ways to go for the inputs.
If the 1N4148 was replaced by a 5.1V zener, you see the LED will turn on first at 1.3V and the zener can never see 5.1V
Resistors are OK. 20k and 10k, or higher like 50k and 25k. Just so the MCU
The LM2596, there are so many chinese fake IC's in those I would not trust them so much.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Yes it suppose to go that way so you clamp the reverse voltage off of a coil or a motor a very common thing to when you want to have a pin from a micro controller to control a outside device to use a optic sensorLast edited by sam_sam_sam; 07-11-2019, 06:46 PM.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Can you clarify the schematic a bit: is it meant to represent two possible implementations on the right there ?
So the diode was supposed to go parallel to the LED in the opto after all...
I shall upload the KiCad file so you can all mess with it. I just don't have it on my PC right now and it's too late and I'm too lazy to get upLeave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Here are two common ways to run digital inputs to an MCU. The hassle is protecting for overvoltage spikes from static electricity or switching inductive loads, like blower, wiper motor, ignition etc.
A 12V car the old test standard is pulses for -150V 0.1usec (at 10kHz), -100V 2 msec, +50V 50usec to represent ignition noise, DC brushes arcing etc. I left out the big surge caused by a bad battery connection "load dump" because it's hard to deal with.
The opto: 1N4148 clamps any -ve spikes from the switches and wiring. An LED is easily damaged by reverse voltages. +ve spikes overcurrent the LED but this OK. A +200V spike would put in 100mA. The opto LED is rated 50mA for a long term and 1A for fast <100usec overload.
You put the diode in series but a 1N4148 avalanches past 100V so it is not enough.
Using resistors, 20k and 10k give 9V minimum and 4.5V maximum for logic high/low, so a dead car battery can still work. The 20k limits current into the MCU. A +/-200V spike would put in 10mA to an MCU input pin, after the capacitor charges, so a long term spike would not damage things.
The capacitor helps with noise from cell phones which get picked up by a car's wiring. It's low current and high frequency, so the opto does not pass it but resistors will.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Let's review this. I redid the schematic following your suggestions:
Put the switches after the fuse, because switch/door wiring always shorts out.
Now this part threw me off a bit:
The zeners on the opto's don't help for +ve overvoltages. The opto LED is about 1.2V and will clamp hard first, so the 5.1V zener will never turn on.
A dropping resistor and 1N4148 reverse-diode will work fine, you don't need anything else. The opto LED would see (11 to 14V - 1.2V)/1k or ~10mA which is OK, I prefer 5mA 2k.
The opto-coupler is not isolating because the same ground is on input and output sides. You didn't use one for IGN, LockSignal inputs etc. so what is with that.
You can turn on internal pullup resistors in the Arduino, about 20kΩ and 50kΩ to save parts (the 10k parts R5-R8).
pinMode(right_window_up_pin, INPUT); // set pin to input
digitalWrite(right_window_up_pin, HIGH); // turn on pullup resistors
This whole thing draws maybe 20mA from 5V?
Why do you have 82 Ohms in series with load, which also feeding the 5.1V ZENER?
The input inductor and diode, my automotive buddy says he added a bunch of crap, reverse-mosfet and stuff with it to his ECM designs.
I think you need something like a ferrite bead at least to stop EMI from the power supply going into back the car. I can draw something later.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
I think the worry is the 5V buck-converter could fail and overvoltage everything, roast Arduino for dinner.
Arduino Pro Mini (5V version) uses MIC5205 LDO and even 5.1V input is enough for 5V out, but the input max. of 16V is not enough for a car because of transients.
OP could run the LM2596 into the Mini Vin and that would cover overvoltage from damaging things?Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
your running an led from 12v through a current limiting resistor - that's how it's done.
What would get destroyed here ? The zener or the diode ? That's for safety only - it should only conduct in case the switching DC-DC converter somehow fails. That's right - don't forget that's a switching converter and I only pictured it as a 3-leg device out of convenience...not sure if that's what made you worry there.
but firstly as i said, 5v1 is riding the line.
second, if the switcher output rises the diode will clamp what - 500mW?
it will burn-up.
you need a 5w zener atleast and you need it not false-trigering - so 5v6 or higher.
so when it clamps, it draws enough current to blow the fuse - not itself.
in the old days when clamps where common, it was usually done with the zener triggering a thyrister to short the rails.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
The schematic looks really good for first time in KiCad.
Some things to maybe consider:
Put the switches after the fuse, because switch/door wiring always shorts out.
The zeners on the opto's don't help for +ve overvoltages. The opto LED is about 1.2V and will clamp hard first, so the 5.1V zener will never turn on. A dropping resistor and 1N4148 reverse-diode will work fine, you don't need anything else. The opto LED would see (11 to 14V - 1.2V)/1k or ~10mA which is OK, I prefer 5mA 2k. For spikes, the LED max. is 1A(!) so a 1k resistor still good for hundreds of volts for a short transient <100usec.
The opto-coupler is not isolating because the same ground is on input and output sides. You didn't use one for IGN, LockSignal inputs etc. so what is with that.
You can turn on internal pullup resistors in the Arduino, about 20kΩ and 50kΩ to save parts (the 10k parts R5-R8).
pinMode(right_window_up_pin, INPUT); // set pin to input
digitalWrite(right_window_up_pin, HIGH); // turn on pullup resistors
I find C6 is better 220-680uF for the cheap LM2596 ripoffs from china, but make sure the fuse can take inrush current. This whole thing draws maybe 20mA from 5V?
The input inductor and diode, my automotive buddy says he added a bunch of crap, reverse-mosfet and stuff with it to his ECM designs.
I think you need something like a ferrite bead at least to stop EMI from the power supply going into back the car. I can draw something later.Leave a comment:
-
Re: Running a microcontroller in car - power supply aspects
Why ? I can't just send battery voltage straight into the optos (even with a resistor), so that's my way of stepping it down.
What would get destroyed here ? The zener or the diode ? That's for safety only - it should only conduct in case the switching DC-DC converter somehow fails. That's right - don't forget that's a switching converter and I only pictured it as a 3-leg device out of convenience...not sure if that's what made you worry there.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: