avoiding multiple voltage regulators

Thread Starter

prof

Joined Feb 21, 2008
5
First, I want to mention my limited understanding of all this. I want to make a simple circuit for my car. Currently, my car has a headlamp switch independent of ignition, which can result in battery drain if headlamps are accidentally left lit. I want to add a circuit so that if ignition is off and the headlamps are lit there is a buzzer sound and LCD displaying warning. The buzzer and LCD should go to sleep after 30 seconds of ignition turning off.

As I am dealing with a 12V car battery and my circuit comprise of microcontroller operating at 5V I have a bit of problem where I am adding 3 voltage regulators. In my opinion a much better design is out there which is why I am posting this thread. (I know a microcontroller is an overkill given simple nature of problem, but I am a programmer and I plan to add a gps coupled with the same microcontroller and LCD in the near future).

Attached is the concept that I need improvement on as a jpeg image. Thanks in advance.
 

Attachments

mik3

Joined Feb 4, 2008
4,843
The voltage regulators connected on the Ignition state and the headlamp swicth state are not necessary. You can replace each regulator with a voltage divider made of two resistors.
But be careful with the ignition state because it might be connected to a relay. If is connected directly with a relay, check if the relay has a parallel diode with it to absorb the back emf of the relay and dont destroy your microcontroler.
 

SgtWookie

Joined Jul 17, 2007
22,230
Rather than simple voltage dividers, you might consider using a couple of Zener diodes with 1k current limiting resistors. IN4624 Zeners are rated 100mA 4.7V, sufficient to present a logic 1 on your MCU. Your vehicles' electrical system may be as high as 14.5v (right after starting, alt. charging @ max) and as low as 10.4v (battery fully discharged, engine off) and you may also experience spikes/transients. There are also odd events in an older vehicle that can cause the alternator to output very high voltage (like a battery terminal becoming open, or in particular worn insulation on the + cable to cause an intermittent short to ground, and jump-starting)

If you used 1k resistors and 4.7v Zeners:
14.5 - 4.7 = 9.8
9.8/1000 = 9.8mA

10.4 - 4.7 = 5.7
5.7/1000 = 5.7mA
Use 1/4W resistors.
 

Thread Starter

prof

Joined Feb 21, 2008
5
Hi,
I have an updated circuit; it is missing LCD at this point. The circuit is attached to this post as jpeg file. I have the following questions:

- Does the circuit seem logical this far?
- If the main power switch to circuit is turned off, can the inputs (which can possibly be high) negatively effect the circuit?
- Can there be power dissipation if the main power switch to circuit is turned off?
- I will be hacking the headlamp switch wire to get the headlamp state signal input. There is a relay on the headlamp circuit. One of the replies to this post suggest protection from back EMF. I tried googling this and found the diode solution (also suggested above by mik3), where one is added in parallel to the relay. Do I really have to do it this way? I am hesitant as it is the existing wiring of my car. I feel that if back EMF protection is needed, I should alter (put some safety pre-circuit) my own circuit. Ideas?

UPDATE: Just want to mention that the combination of 83 ohm resistor along with IN5230B zener diode was due to voltage regulation as suggested. The 750 ohm resistor is for current limiting.

Thank you much guys.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
1) Sure, it seems logical. However, you're using a 7805 regulator, which is ancient technology, and will always have a bias current going through it, somewhere between 3.9 and 10mA depending upon the exact regulator you use. Some modern low-dropout regulators like Linear Technology's LT3012 have a shutdown pin on them. You could use the shutdown pin to initially power up the regulator when the accessory circuit comes on via a resistor/Zener circuit, and have a pin on your MPU keep the regulator turned on for a few minutes after the accessory circuit was turned off - then have it turn the power off so you won't be draining the battery.

There are no filter capacitors on either the input or output of the regulator. You must use them, or your regulator will not be stable.

You don't have to use 1/2 Watt resistors; 1/4 Watt is overkill even for the 820 Ohm resistors. 1/10W would be fine for the 7.5k resistors.

2) Read the datasheet for the PIC to see if having voltage on pins when Vcc is off will damage it.

3) If the main power, headlamp and ignition switches are all off, there will be no power drain via your circuit. However, even with the main power switch off, if either the headlamp or ignition switch is on, there will be current through the corresponding 820 Ohm resistor and Zener.

4) Reverse EMF - if you're using the Zeners, you shouldn't have to worry about it. However, you could place a small capacitor (say 1nF, same as 0.001uF) across each Zener. That would absorb high-voltage extremely short duration transients.
 

SgtWookie

Joined Jul 17, 2007
22,230
More food for thought - I don't know offhand what the power requirements are, or will be, for your PIC, the piezo buzzer, and possible future additions. I just threw the LT3012 regulator in there as a possiblity; it has a maximum output of 250mA.

Also, not knowing the specifications of your piezo buzzer - I don't know if the PIC can source or sink enough current to drive the buzzer. You may need to use an external transistor or MOSFET to do that. If the piezo buzzer's power requirements are even close to the capabilities of the MCU's outputs, you should use an external driver.

A very simple way to do this would be to connect the PIC output pin via a 10k resistor to the base of a 2N2222 transistor; emitter connected to ground, and collector connected to the negative terminal of the buzzer. The positive terminal of the buzzer you could either connect to the +5V supply output, or +12V supply, depending upon it's voltage requirements. Placing a logic "1" on the output pin would turn the transistor on, providing a current sink (ground) to the negative side of the piezo buzzer. Placing a logic "0" on the output would turn the transistor, thus the buzzer, off.
 
Top