Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Automotive circuit help needed

Status
Not open for further replies.

jumper2high

Full Member level 3
Joined
May 24, 2009
Messages
178
Helped
20
Reputation
40
Reaction score
10
Trophy points
1,298
Location
Serbia
Activity points
2,579
Hello,
I've been making a car blinker control device using a digital microcontroller from Microchip. The transistor's (BD241) Emitter is the "output" that connects through switch in the steering wheel, to the lights. The 1N4007 diode (connected to BD241's collector) is used to make a .7V drop used to detect current flow through the transistor. If the switch in the steering wheel is open - there's no voltage drop. Once it's closed, and current starts flowing through the diode and transistor, the PNP transistor pulls one of the microcontroller's pins to high, which signals that the switch was closed and that it should start 'blinking' and 'beeping' the right stuff.

Now, the problem is: Every time I turn OFF some of the "inductive" loads on the car (cooler fan relay, rear window heat relay....) the MCU detects as if the blinker switch was closed and beeps once. I originally thought it was just a case of some inducted current being fed through GND and making it go just above the threshold for the microcontroller. I added a diode to the GND connector as well, thinking that would stop it, but it didn't.

The program code on the MCU waits until pin GP2 (GP3 on schematic, by mistake) goes high, and once it does, it beeps and blinks, then checks again and so on.
 

I'm mystified as to the purpose of the design but I can throw in a few comments:

1. Why Q1? couldn't your just connect R2 to the emitter of the BD241. It would save you a diode and a transistor.

2. With the current of the lights being drawn ( say 2 x 21W lamps = about 3.5 Amps) the diode is running well past its rating. The base current of the BD241 will probably be too much for the opto-coupler as well.

3. Unless you are using a very high impedance loudspeaker, it might give more smoke signals than sound.

To prevent spikes on the supply causing problems, you will need to be very careful about grounding points. So many Amps can be flowing that the differences in voltage between different ground connections can be quite high. You also need more filtering at the supply input. Look to dropping some of the voltage into the regulator with a resistor, in conjunction with C1 it will form a low pass filter. Also put another capacitor across C1 of at least 100uF and keep the capacitors as close to the regulator as possible.

Brian.
 

Thanks for the reply, Brian.

1) If I just connected the resistor+zener to the emitter of BD241, I would always get a signal, even if there aren't any bulbs actually connected to the output. I need to detect whether the lights are connected (switch closed), and only "beep" then.

2) I'm actually using high-power LEDs in place of the light bulbs. All six of the blinkers together pull around 1.5A of current. The diodes (1N4007) aren't the best solution, but those are the only ones I had handy for test purposes.

3) Using a piezo buzzer with built in electronics. It's supposed to be connected directly to 12 volts without any smoke being let out.

Just to confirm, about the last comment, these spikes only happen when an inductive load (relay, electric motor) is switched off. It probably just creates a single spike, that the MCU detects and starts a blinking/beeping cycle.
 

OK on answer 3 but I'm still a bit confused on the other answers.

If I understand you, you are actually trying to create a current monitor by looking at the drop across D2. You potentially face problems with this solution because the diode is a constant voltage device. The voltage will be between 0.6 and 0.7V and if I understand your intention, you are using it to switch Q1 on. If this is the case, and I'm assuming you have the emitter and collector of Q1 drawn reversed, you are relying on the diode dropping the same as the BE junction of the transistor. If it drops less, the transistor will not turn on, if it drops more, Q1 will carry the LED current. It would be more sensible to change D2 to a resistor which drops 0.6V at 1.5A (0.4Ω) and add a limiting resistor in the base of Q1 to protect it.

Your design is also capable of placing more voltage on the base of the BD241 than its collector. Consider connecting the 'top' of the opto-coupler to the BD241 collector pin so you make a Darlington configuration.

Your switching transients are still probably dealt with as I mentioned before.

Brian.
 
Hello Brian,
The way the MCU is configured, it puts the base of BD241 (through an optocoupler) to HIGH, then tests if there's a voltage drop across D1. If there isn't any, it goes back to testing again. In other words, it's looping until there's a voltage drop across D1 (indicates the switch being closed - LEDs being connected). At that point, it sounds the beeper, waits a while, turns BD241 off, waits a little more and goes back to start, once again testing for voltage drop across the diode, and so on.

If you're thinking I've overcomplicated this, you are right - I did. :D But, I wanted a plug-and-play solution instead of having to rewire the whole assembly to put the controller AFTER the switch.

The reason I put a diode instead of a resistor was mainly because of all the variables. For example, if only one side works, it's around 700 miliamps. If the hazard lights are on and all of the lights are blinking, it's 1.5A. If the engine is running - the voltage is 14.5 volts which is when they are pulling 1.5A, but when the engine is off, at 12.4 volts, they pull slightly less. I would be getting all sorts of different voltage drops in those different situations. With a diode, it's 0.7-0.8 volts almost regardless of the current.


Perfectly right about the optocoupler, I can't believe I missed that :oops:
 

I think there may be an easier way of doing the same thing, I only scribbled it on paper so I leave it up to you to develop further:

Turn the circuit upside down, so the PIC is powered from the incoming power on it's VDD pin and use the regulator to provide a ground 5V below it. This keeps the PIC supplied correctly. Now you can dispense with the opto-coupler and use a PNP darlington transistor as the pass device. Emitter to 12V, base driven from the PIC and collector to the load. Setting the PIC pin high turns the transistor off, low gives 5V worth of drive to it. Now you can put a resistor in the emitter and use the PIC ADC to check the current being drawn. It uses fewer components and allows you to actually decide how many LEDs are working.

Brian.
 
Hmm, yeah - that might work. I'll try that some time later :)


This project seemed so simple at first (two months ago)...but dozens of tiny complications and other commitments kept it getting delayed until now.
 

Hi,

I think that your project works fine without inductive load.

when load connected, your microcontroller goes to unstable state.


Just add two capacitors .01uf and 100uf most nearer or on the microcontroller power pins and make it stable.

Take care.
 

I think that here, and in several other posts, senthilkumar.b is fishing for points instead of offering practical solutions.
Brian.
 

Dear Brain and Jumper2high,

If i did mistakes, kindly mould me towards right direction. Iam work in the way of making them to workout and realize.

If its not possible in this post, kindly communicate at senthilkumar_b@in.com. thanks.

Bye
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top