Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Sequential brake light hardware ??

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
cordless

Bascom Member



Joined: 12 Oct 2005
Posts: 29

usa.gif
PostPosted: Sat Jan 04, 2014 4:22 pm    Post subject: Sequential brake light hardware ?? Reply with quote

I am wanting to add sequential brake lights to my 68 Camaro.

I have 2 12V inputs (right and left turn/brake signal). How would I connect them as inputs to a 2313?

Any help is appreciated!

On the code --

input right would do ...
input left would do ...
both inputs same time ...

Got that part, just need help on hardware inputs.


Thanks!!!!

(BASCOM-AVR version : 2.0.7.1 , Latest : 2.0.7.6 )
Back to top
View user's profile
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 156
Location: Brazil

brazil.gif
PostPosted: Sat Jan 04, 2014 8:39 pm    Post subject: Reply with quote

You must use two resistive divider. The voltage from car can be as high as 14 V , then you must calculate one divider to reduce from 14 volts to 5 volts. By example , use the values 12k and 22k for the divider. The 22k goes to to your signal from car, and the other pin goes to the 2313 input. And the 12k goes one pin to the 2313 input, and the other pin goes to ground.
This will maintain the 2313 input in safe. And only to have more assurance, please use one 100nF ceramic capacitor in parallel with the 12k resistor.

Excuse my bad english...

Paulo
Back to top
View user's profile
cordless

Bascom Member



Joined: 12 Oct 2005
Posts: 29

usa.gif
PostPosted: Sat Jan 04, 2014 8:58 pm    Post subject: Reply with quote

I was thinking of using the an opto-isolator but the divider is simpler.

Any ideas on the code?

I pretty much got the right and left turn signal but if brake is used, both input lines are used.

And the turn signals being used during braking? The turn signals only last about 1 sec. then off then on, etc.

How would I write the code?
Back to top
View user's profile
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 156
Location: Brazil

brazil.gif
PostPosted: Sun Jan 05, 2014 7:18 am    Post subject: Reply with quote

I'm considering that you will use one more input : the brake signal !
Then will be 3 inputs, and the logic will be more simple.

If only right turn is on, you will initiate the sequential from right side only; if is the left turn on, will make the same only in the left side. But if the brake is on, you will initiate the two sides sequential at the same time, independent of the left or right turn signal.

Are this the work mode that you are thinking ? And how many lamps you will have in each side to make the sequential ?

Paulo
Back to top
View user's profile
cordless

Bascom Member



Joined: 12 Oct 2005
Posts: 29

usa.gif
PostPosted: Sun Jan 05, 2014 8:17 am    Post subject: Reply with quote

Actually there are only two signals, right and left. Brake goes thru steering column and uses same turn signal wires. If brake is pressed, both signals stay on. With brake and one of the turn signal, the opposite side stays on while the other goes thru flasher and does it thing. There are 2 bulbs each side for the RS Camaro. Everything is old school mechanical on a 68.
Back to top
View user's profile
Arera

Bascom Member



Joined: 23 Sep 2007
Posts: 375
Location: Wuppertal, Germany

germany.gif
PostPosted: Sun Jan 05, 2014 11:36 pm    Post subject: Reply with quote

The voltage in a car is far from being clean! You will encounter noise and spikes of unpedictable shape an voltage. Recon 100V spikes at least. That means, a simple R-R divider is not an option. Also you need to take a lot of care to regulate and filter VCC for your micro.
I have no opportunity to draw a circuit right now, I just like to prevent you from making a PCB that misses parts you really need.
Just my quick idea for the inputs:
First a serial R of 1k, this one is important to keep energy from incoming spikes low.
Next a pull up or pull down R, depending on which level the input is pulled to when active.
Next two fast diodes. One from our signal to +12V, one to GND. Both in reverse direction, to drain energy from high or reversed input spikes. The diodes should have a low foreward voltage and should be able to survive 200V reverse voltage.
Next a z-Diode with voltage of about 80-90% of the micros VCC, GND-bound.
A 100nF in parallel to the Z-Diode could do no harm.

IMO an opto coupler is of no use, as the supply on the Led-side is still the same as on the load-side. So what shoul it seperate? And the input of the opto needs protection as well.

This are my late-night-thoughts, take them as ideas to think about yourself. But definetly you need to think further than a simple V-divider.

Marc
Back to top
View user's profile
Deanus

Bascom Member



Joined: 26 May 2006
Posts: 188
Location: Adelaide

australia.gif
PostPosted: Mon Jan 06, 2014 7:08 am    Post subject: Reply with quote

I agree with Arera,
and I would go even further, as to put 78L05 regulators on each of the inputs.
This guarantees that the voltage getting to the 2313 input IS the correct voltage.
I always use this for inputs where the source voltage can change wildly.

Regards

Deanus
Back to top
View user's profile
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1197
Location: SYDNEY

australia.gif
PostPosted: Mon Jan 06, 2014 12:22 pm    Post subject: Reply with quote

I would use opto-couplers but would not use a common ground I would run through one or two diodes the power to the lamps thus generating a constant voltage for the opto-couplers and supply the micro with power and ground of its own. I have used this to sense power in many circuits through the years and have had nun fail. It does mean you need to run two light duty wires to each LED of the opto-couplers from each diode but the diodes can just be spliced into the car wiring then have heat shrink over them, 3 amp diodes are cheap enough.

Regards Paul
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2114

netherlands.gif
PostPosted: Tue Jan 07, 2014 9:29 am    Post subject: Reply with quote

Deanus wrote:
I agree with Arera,
and I would go even further, as to put 78L05 regulators on each of the inputs.


Strange idea, now you must project your 78L05 against spikes etc...
Arera idea will do the trick.
Zener, vsd and resistors are the way to go.

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1197
Location: SYDNEY

australia.gif
PostPosted: Tue Jan 07, 2014 11:54 am    Post subject: Reply with quote

I forgot to mention the other reason I used the diodes was to let me know when no current was flowing which means a blown bulb.

Regards Paul
Back to top
View user's profile
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 156
Location: Brazil

brazil.gif
PostPosted: Wed Jan 08, 2014 6:46 pm    Post subject: Reply with quote

People, see this AN from ATMEL :

http://www.atmel.com/images/doc2508.pdf

Why you are worried with 100 volts spikes ???? I have seen this kind of circuit conected with 220V from many and many years, and works perfectly. If Atmel recomends this usage in your own AN, there must be a reason for that ! The reason is that input protection is implemented in the AVR line.

Atmel uses only a resistor to limit the current in inputs. And in page 7 they told that we must only observes that the maximum current flowing in the clamp diodes can't pass 1 mA ....

From datasheet you can see that the AVR line has input protection. Sure, we can help to better this protection, because with this high impedance any noise can be induced and can make false level change. This is resolved lowering the input impedance with one resistor to ground.

I have used this method in my motorcycle, an Yamaha Dragstar, from more than one year. And every day I use whitout any problem.

There is no reason for use optocouplers, or 78L05, or zeners, or fast diodes. Only a resistor. I put one small capacitor too to resolve interference problem with my alarm, that uses RF and is very close to my circuit. This can happens in the car too.

Excuse my bad English.

Paulo
Back to top
View user's profile
Matrixx

Bascom Member



Joined: 30 Nov 2005
Posts: 158

mexico.gif
PostPosted: Tue Jan 14, 2014 2:02 pm    Post subject: Reply with quote

I agree with aphawk, there is no need of optocouplers and 7805's in the inputs.

A couple of simple resistor dividers and a small ceramic capacitors 0.1 is what you need.
I have a ciruits working like this for years.
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum