Running a microcontroller in car - power supply aspects

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Dannyx
    replied
    Re: Running a microcontroller in car - power supply aspects

    Originally posted by redwire
    Consider this for the window switches. You do not need protection zeners or diodes because one opto protects the other against reverse spikes, and +ve spikes get current-limited by the resistor. Even a 100V spike is about 50mA for the LED- which it can take.

    What is the 5V DC-DC converter, how many volts is max. input?
    I use a 27V TVS (1,500W to 6,600W) at the input to limit +ve spikes to ~40V like 1.5KE27A or larger. I would have it for D1 instead of UF5408.
    That's the sort of stuff which I may have overdid like I said. I COULD'VE probably got away with a single resistor in series with the LED of the optoisolators just like you suggested and I actually went with that for quite some time, but just to make sure I later added a zener in there as well. I suppose to cut down on the space and part count, I could go down your route too.

    Also, slight error in the layout of the switch there - the dotted line connecting the two contact plates should not be there, as only ONE pole moves at a time, whereas the line would indicate both move at once...probably a limitation of the software you used to make the diagram....which I find very nice actually and I'd like to know what it is, so I'd stop using pen and paper

    Leave a comment:


  • redwire
    replied
    Re: Running a microcontroller in car - power supply aspects

    Consider this for the window switches. You do not need protection zeners or diodes because one opto protects the other against reverse spikes, and +ve spikes get current-limited by the resistor. Even a 100V spike is about 50mA for the LED- which it can take.

    What is the 5V DC-DC converter, how many volts is max. input?
    I use a 27V TVS (1,500W to 6,600W) at the input to limit +ve spikes to ~40V like 1.5KE27A or larger. I would have it for D1 instead of UF5408.
    Attached Files

    Leave a comment:


  • Dannyx
    replied
    Re: Running a microcontroller in car - power supply aspects

    Just realized I made a little f-up in my diagram and should also explain in more detail how those switches actually work, since it may be confusing to some: the 4 switches in my diagram are just schematic representations of the actual rocker switches on the dash. Notice I added L and R for the two sets. In reality, there's 2 rocker switches (one for each window) and each of them has two "poles" which are pulled to either VCC or GND depending in which position they're "rocked".

    This diagram explains it: when "resting", both poles (1 and 2) are grounded. When rocked to either side, one is pulled to VCC while the other one continues to stay grounded. In my case, imagine pole 1 of the switch in the diagram goes to the linear regulator formed by R1 and ZD1 and pole 2 goes to R2+ZD2. What happens is when the switch is pushed in the "down" position, R2+ZD2+PC2 become active and the micro's A pin is pulled low, telling it to do.....something, doesn't matter. Likewise, when pushed into the "up" postion, R1+ZD1+PC1 become active and pin B is pulled low. I don't think there's any problem with the linear regulator staying grounded when not in use, since (if you had your thinking cap on) you'll notice all 4 resistors remain grounded when the switch is resting, or at least one of the poles will always be at GND.

    The way I tap into this is I cut the two wires currently going from the switch to the motor (from pins 1 and 2) and I'll solder matching male-female XT60 connectors to both the switch side and the motor side of the resulting wires. The "control" input of my control box will also get an XT60 connector that accepts the one coming from the rocker. The output of the H-bridge will get one that matches the one going to the motor. The reason I'm doing it like this is to allow me to quickly revert back to the stock setup if something goes wrong, by removing the box entirely and plugging the switches right back into the motors as they were, since the XT60 connectors will not only match the box but each other as well.

    Now, F1 and D1 will not be there, since that part (before the rockers) is already present in the car and will not be messed with. What I have access to is the "outputs" of those rocker switches, so I'll only be able to tap into where the "poles" of the switches are. The correct diagram would look like THIS then (can't get the damn lighting to look any better ).


    Also, you're saying I should drop choke L1 in series with the buck converter like that ? Also remembered what you said about the caps on the input of the buck converter, but I had already snapped the pictures, so let's assume there's a cap after L1
    Attached Files
    Last edited by Dannyx; 05-02-2019, 10:38 AM.

    Leave a comment:


  • budm
    replied
    Re: Running a microcontroller in car - power supply aspects

    TVS:https://cdn.badcaps-static.com/pdfs/...325913767f.pdf

    Inductor in Automotive system:
    https://industrial.panasonic.com/kr/...tive-inductors
    https://industrial.panasonic.com/kr/...rs/application

    You may need LC filter so your DC-DC converter will not dump the switching noise into the car system.
    Last edited by budm; 05-01-2019, 11:52 PM.

    Leave a comment:


  • Retro-Hipster
    replied
    Re: Running a microcontroller in car - power supply aspects

    Oh, you could definitely place the caps I meantioned after the fuse and such. I just meant you could put a fairly beefy cap on the input to help with voltage spikes since capacitors resist changes to voltage. In terms of filter inductors, that really probably be a waste of inductors unless you wanted to smooth out the current capabilities of your power source. You would likely want to put a snubber diode across the inductor if you did put one in as well. without one you could fry the buck converter when you unplugged it from it's power source.

    In reality, most of the time it is better in DC circuits to just use a capacitor for smoothing and then a zener after to clamp down any voltage spikes that may get through (ie: a 16v zener), if I am not mistaken. You could put those two things after the fuse and just place an appropriately rated NTC Thermistor between the fuse and the capacitor. That way you wouldn't blow the fuse/damage anything when you plugged things in.

    So you could do something like...

    12-15v in > fuse > thermistor > Capacitor> Zener> Buck Converter>etc..
    Last edited by Retro-Hipster; 05-01-2019, 05:11 PM.

    Leave a comment:


  • Dannyx
    replied
    Re: Running a microcontroller in car - power supply aspects

    Originally posted by Retro-Hipster
    A question on the Schematic. On those optocouplers, were you meaning to draw this (or I might be misreading) with the "transistor" side bypassing the switch? Then were you thinking of turning on the optocopular using the io from your mcu? At the moment I'm reading the schematic like you are wanting to be able to send an output to the mcu when you press the switches on your car's panel.
    Correct: those switches are just a schematic representation of the 2 switches for the windows. Each has two possible states: UP and DOWN, obviously. Let's say S1 is UP for the left window and S2 is DOWN for the left window. When the switch is closed, the linear zener regulator becomes active and the LED in the optoisolator is turned on. The transistor is thus turned on and the I/O pin is pulled low. When the switch is released, the LED "dies", the C-E junction becomes resistive and the pin is pulled back to a HIGH state via the 10k resistor. Hope that clears it.

    Yes, some caps on the input would be advisable, though I'm a bit nervous about placing them directly across the car's battery, since that's essentially where power is coming from - nothing between.

    Inductors: don't know too much about these TBH, so I don't know what parameters they have or what I should look out for. I know they have an inductance rating, but do they also have voltage/current ratings ? Is there a rule of thumb for the inductors like "bigger is better" or are certain values better suited for specific applications ?

    Leave a comment:


  • Retro-Hipster
    replied
    Re: Running a microcontroller in car - power supply aspects

    Honestly, what you are planning sounds pretty good. If you were worried about power spikes, you could probably improve things by putting in some additional filtering at the source, like a 25v 100uf and then an inductor, but that would probably REALLY overkill. (Especially if the MCU is a mini, which can already handle up to 12v.)

    Probably, if it were me, I'd just go with what you've written out and then add additional filtering later if it becomes a problem. Though, I'm just a hobbyist too, so a pro might come by and make me feel quite foolish. lol

    ---

    A question on the Schematic. On those optocouplers, were you meaning to draw this (or I might be misreading) with the "transistor" side bypassing the switch? Then were you thinking of turning on the optocopular using the io from your mcu? At the moment I'm reading the schematic like you are wanting to be able to send an output to the mcu when you press the switches on your car's panel. I could be understanding things a bit wrong though.
    Last edited by Retro-Hipster; 05-01-2019, 01:20 PM. Reason: I misread something on the schematic..

    Leave a comment:


  • Running a microcontroller in car - power supply aspects

    Good day folks. Some of you may know that a while back I was messing around with a little Arduino Mini and made up a little circuit to automatically roll my car windows up and down and all that jazz...not important right now. The project is built and runs as it should on a breadboard on the bench, so I thought before transferring it to a perfboard and shrinking it down, I should go over the power supply section and how I'm going to power this thing, since the electrical environment of a car is not the same thing as on the bench with a wall wart and there could be some problems down the line which I may have overlooked. I may have actually gone overboard with the power section and wanting to make it as bulletproof as possible, it probably had the opposite effect and I gravitated away from electronics industry standards and made it more complicated and inefficient if anything. This apparent complexity may not necessarily result in a better electrical environment for the micro itself...

    There's a diagram attached and it's a bit of a mess, so please bare with us

    1) it's powered all the time, so I'll wire it straight off the battery.

    2) the top branch which goes through F1 is straight off the car's system - no regulation at all - so it can be anywhere between 11v and 14v (and probably more due to inductive spikes ! !). The reason for this is because those switches (S1-S4) are actually the rocker switches for the power windows and they're already wired in to the car, so I want to keep this as PnP as possible and not alter the existing harness, so rather than implementing my own step-down circuit here as well, I'm doing it this way: the voltage present at those switches goes through R1-R4 when the switch is pressed, to the 5.1v zeners Z1-Z4 (just noticed ZD would be the correct notation for those, but anyway) and to the anodes of optoisolators PC1-PC4 respectively. This pulls the collector low which in turns pulls pins A-D low and the micro know what button was pressed. There's two windows and 2 directions (UP/DOWN), so 4 sets of each. Hope this makes sense. I only drew 2 of the pins, and added "tags" for the other two. Also, the H-bridge which will be used to actually drive the motors is not pictured ! This setup is perfectly functional on the breadboard right now as it is.

    3) to power the micro itself I send "V-BAT", let's call it, though a DC-DC step-down buck converter which drops it to around 6v and then did something which you probably shouldn't/don't need to do and send that through a resistor+zener combo AFTER the buck converter itself, the thinking behind this being that if the buck converter overshoots or shorts out for any reason, the linear zener regulator would still prevent V-BAT from shooting straight into the micro and killing it...THIS is probably the most "incorrect" part of this whole setup, despite being functional. It's worth mentioning that I'm powering the Arduino Mini straight via the VCC pin and not using the on-board regulator via the RAW pin. In fact, I removed the regulator from the board entirely. Maximum energy conservation is also important.

    4) values for the components:
    • C1-C4 are 100nF ceramic caps
    • C5 is a 10uF tantalum
    • R1-R4 are 1k
    • R5-R8 are 10k pull-up resistors
    • R9 is 82R
    • D1 and D2 are UF5408 Schotkkys


    That's it for now Let me know what you think and what should be improved. Thanks.
    Attached Files

Related Topics

Collapse

  • CG2
    Meaco Arete One / Deye Dehumidifier not working
    by CG2
    I'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...
    08-17-2024, 07:47 AM
  • Kambi13
    Samsung NP370E4K No backlight running on battery
    by Kambi13
    Hi 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....
    09-04-2023, 11:06 AM
  • Dannyx
    "Kinetic" 433Mhz transmitter/receiver discussion
    by Dannyx
    Good 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
  • Skgod
    Asus Rog strix g15 g513ih hn0865 and it's having display issues while running on igpu
    by Skgod
    Hey 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?...
    10-16-2024, 08:11 PM
  • FALKLAN
    Running Line Voltage and Integrating LED Pods - Automotive
    by FALKLAN
    Howdy 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....
    02-05-2025, 12:30 AM
  • Loading...
  • No more items.
Working...