the12volt.com spacer
the12volt.com spacer
the12volt.com spacer
the12volt.com spacer
icon

headlight switch


Post ReplyPost New Topic
< Prev Topic Next Topic >
cairnsgse 
Member - Posts: 7
Member spacespace
Joined: April 28, 2011
Location: Australia
Posted: April 23, 2012 at 6:05 PM / IP Logged  

Hi all

I would like your help again

I want to use a momantary switch to activate vehicle lights ,1st push activate park lights 2nd push activate headlights ,park lights must remain on as well and 3rd push to switch everything off 

Can this be done

Cheers Grant

PS I have already work out high beam so is not an issue

oldspark 
Gold - Posts: 4,913
Gold spacespace
Joined: November 03, 2008
Location: Australia
Posted: April 23, 2012 at 8:21 PM / IP Logged  
You could use a 4017 counter with output 0 NC, 1 thru a diode to a transistor etc to parker relay, and 2 thru diode to parker relay & to beam relay, 3 is connected to reset.
Just make sure whatever circuit you have doesn't false trigger or reset.
cairnsgse 
Member - Posts: 7
Member spacespace
Joined: April 28, 2011
Location: Australia
Posted: April 24, 2012 at 5:09 AM / IP Logged  

thanks for that but have no idea what you mean ,can it be done with relays and how would it be wired up

cheers Grant

cairnsgse 
Member - Posts: 7
Member spacespace
Joined: April 28, 2011
Location: Australia
Posted: April 24, 2012 at 6:27 AM / IP Logged  

I got to thinking about the 4017 . am I right that this will work with the pulse from switch to cycle output and then on 3rd push reset to zero ,ifso how would I wire it up

always learning

cheers Grant 

oldspark 
Gold - Posts: 4,913
Gold spacespace
Joined: November 03, 2008
Location: Australia
Posted: April 24, 2012 at 9:45 AM / IP Logged  
A verbose reply that is to be read a piece at a time...
I think the easiest is to download a CD4017 datasheet though manly for its "timing" diagram which looks like...
headlight switch -- posted image.
(With thanks to National Semiconductor. Their data books "taught" me electronics and putting together digital circuits!)
Now don't let that confuse you, it's pretty simple. headlight switch -- posted image.
Assume the chip (4017) has its 0 (zero) output on. (That's its first output, namely pin #3.)
The CLOCK is your switch.
Every time its voltage rises, the chip goes to its next output,ie - from 0 to 1, 1 to 2, 2 to 3 etc.
The particular output stays "high" until the next clock pulse.
You can draw vertical lines down from the middle of the upward (aka +ve going) slope of each clock pulse to see how the respective high output goes low as the next output goes high.
That's the basic operation.
But there are a few refinements and conditions.
1. The CLOCK ENABLE pin must be held low (GND) to enable the clock.
2. The RESET pin must also be held low. The chip will not "count" whilst RESET is high
3. When the RESET pin goes HIGH, the chip resets to output 0.
How's that so far?
Now I'll take your "design" in sections, one step at a time.
Step 1.
When the chip is first powered on, its #0 output is high. Bit we don't want any lights on so we leave that disconnected.
The first clock pulse is your first "push activate".
The output goes to output #1, so that goes to your parkers. (More on how and using relays etc later.)
It stays on parkers until the next (second) push activate whereby output #1 turns off and #2 turns on. That goes to your beams (ie, beam power - your separate hi/low dip switch determines high & low beam).
How's that?
Step 2.
We want the 3rd push activate (clock pulse) to turn off all lights, ie reset the chip back to #0.
NOW we use the reset pin!
Keep in mind that #2 (headlights) are currently on.
A 3rd clock pulse turns off #2 and turns #3 on (high).
But if we connect #3 to the RESET pin, the chip resets to #0.
Then we start the cycle all over again.
PAUSE... for a look at the timing diagram and a recap:
You should see all the above on that timing diagram....
EXCEPT the bit about the RESET going HIGH - for reasons unknown that "minor" detail is often omitted from that timing diagram, but it is clearly stated in the 4017 datasheet.
[Does that omission bug me? Blood oath it does!]
But trust me, RESET is similar to the CLOCK, ie, when it goes high, its +ve edge sets the current output (#3) low and turns on output #0.
Hence #3 is on for a short time, but that does no effect us.
[ IE - it was on #2 headlights. We then push again and #2 headlights turn off, and #3 turns on but then the RESET pin is   triggered and resets the output back to #0 - ie, no lights. ]
Is that clear?
FYI - output #3 is only on for a miniscule time - nano-seconds from memory, but certainly far less than a micro-second (1uS).   
Ready for the final design stage....s?
You want the parkers to stay on with the headlights.
Oh dear, the #1 parkers output is off.
But a simple fix...
We simply add a diode from #2 to output #1, hence when headlights #2 is on/high, so is #1 parkers.
Simple eh?
Except for a slight technicality - namely the prevention of feedback into the chip.
We hence use use a diode on the #1 output so that the "high" from #2 does not feed into #1.
Cool.
And we use a diode from #2 to the headlights. I don't think that is needed, but let's be sure to stop any feedback into #2. Besides, I have other motives which I'll mention later...
So the "design" isn't too difficult.
It's your switch, and a bit of understanding of a brilliant chip, and 3 diodes.
I reckon I'll leave it there for now.
Although the "theoretical design" (or functional design) is done, we have interfacing issues - namely that the 4017 can't power a relay - it can only supply about 1mA and a typical car relay takes from ~60mA to 250mA to energise.
But that's simple to overcome - either one MOSFET per output, or a transistor and a couple of resistors.
The final output must also be protected from (relay coil) spikes etc, but how that is done depends a lot on how the relays are wired (we'll solve that later...)
Also we need a "debounce" circuit for the switch, but that's just a small resistor and capacitor and another diode.
[ All mechanical switch contacts bounce when closed. That's normally not a problem because its a few bounces over a few uS or milli-Seconds etc. But that's fast enough to clock digital chips. The 4017 can operate at 5MHz (= 0.2uS = 200nS pulse widths) so we need to "filter" out any switch bounce.
And finally a bit of "power conditioning".
Although the 4017 can operate up to 18VDC, like most car electronics, it needs to be protected from voltage spikes (which can typically be 100V - 200V in 12V vehicles).
Plus a capacitor to ensure no glitches on its power supply due to its own internal switching which can cause it to clock itself.
I know it all sounds really complex, but IMO it's easier to do than it sounds.
Once you see the final circuit you can see what each component - or group of components - does.
Plus this design and all the above is A LOT of design.
It's the basic "design circuit"; its power supply; and input & output "buffering" to interface to the real world.
You can pick up your Electronics Engineering or Technician Degree when finished... headlight switch -- posted image.
But all this assumes you are game enough for basic electronics - soldering and assembly etc.
A 4017 costs a few dollar$. The other bits a few dollar$ more.
It could be done with a few relays, or SCRs & relays etc - I'm sure HotwaterWizard has else can post examples.
BUT, if you later want extend the circuit - f.ex pulse #3 turns on foglights as well; #4 turns off all except foglights; and what about "manual" DRLs?
Add a reset switch if clocking back to off #0 is to complicated (else turn the IGN off etc).
[That reminds me - a POR = Power-On Reset circuit to ensure the 4017 always starts on #0. That's probably not normally needed, but if it were to be turned off for too short a period... I'd have to investigate that. Make that a Graduate Degree with Honors...]
FYI - Future expansion is the reason I included the #2 output diode to the headlights.
And if anyone thinks a 4017 is overkill, all I'll say is that I have a SAAB dipper relay which uses a 4017 as a mere high-low selector. That has #0 to low beam, #1 to high beam, and #2 to RESET.
You're beating that - you have #3 to reset... headlight switch -- posted image.
What more can you do with the 4017? Any "divide by n" frequency or pulse divider where n is 2 to 10 for one 4017, up to 100 for 2 chips, up to 1,000 for 3 chips, etc.
And have a look at LED sequencers - eg, Peter Flemming's 4017_circuits.pdf
Tempted?
Geez, I'm glad I left the rest till later... headlight switch -- posted image.
cairnsgse 
Member - Posts: 7
Member spacespace
Joined: April 28, 2011
Location: Australia
Posted: April 28, 2012 at 6:05 AM / IP Logged  

Geee after the first read I spilt my  beer but looking again i think I will try it . Its going in my T-bucket hotrod so worth the extra effort  

I can see you put in a bit of effort so really thanks heaps

cheers Grant

oldspark 
Gold - Posts: 4,913
Gold spacespace
Joined: November 03, 2008
Location: Australia
Posted: April 28, 2012 at 9:31 AM / IP Logged  
It's a "dual" purpose writeup - another hot-rodder wanted to use a Harley Davidson tacho and it's the same circuit - ie, tacho output from #1 with the reset connected to whatever output to get the desired divide by 2, 4, or 8. One day when I recover my data (lost emails & history) I'll get back in touch with him. Yeah - one day...
But that's why I made the effort. It's a relatively straight forward device - no timing calculations etc, just a "building block" - yet has many diverse applications.
I was bewildered that SAAB used it for a simple high/low-beam toggle. A simple "flip-flop" circuit or chip would have done that. I have even posted a simple 2 inverter and capacitor "toggle" circuit on the12volt.
But if the 4017 is a chip they already use, or if they suspected expansion to 3 or more outputs, the 4017 makes sense.
I think it's simple enough grasping how the beast works. It's merely a pulse input that causes a sequential output.
Then comes the "special conditions" like the enable & reset needing to be low to enable the counting sequence.
The only confusion I find with the 4017 is that some refer to its "0 to 9" outputs as "1 to 10".
But I simply apply the normal digital convention where the "first output" is always the 0 output. IMO that's the same as our centuries - the FIRST century was from year zero to 99; the 21st century is 2000 - 2099.
And I know that for a divide by "N" counter, connect the reset to the "Nth" pin.
Else I work that out because if as in your case you need a "divide by 3" circuit - ie, off, park, beam&park - so connect the RESET to output #3. (The logic being #0 is off and not connected, #1 is parkers, #2 is beam (and parkers), therefore reset must be #3 since we don't want it resetting to off/#0 whilst #2 is selected ...if that makes sense...?)
The qualification to all the above is if people are game to solder and assemble, or if they have friends that can.
For beginners it is often advised to use a socket for the IC (Integrated Circuit - ie, the chip - the CD4017) so that the chip can easily be inserted or replaces without overheating the chip or board by soldering.
However sockets are NOT recommended in automotive situations due to vibration & environment (eventual intermittent or lost connections), but with good quality sockets, and modern smooth and temp-conditioned vehicles, that may not be a problem.
And there are a few related issues (eg, the handling of CMOS circuits like the CD4017), but IMO they are trivial. (With knowledge, handling is simple. The warnings are a "worst case" possibility, though I do tend to buy an extra chip etc just in case, especially if not expensive.)
LOL! I just checked the price of a CD4017 from Jaycar. $0.85!
I was worried it might be more than a few dollars.
I was also considering if even the 4017 was old-tech these days.
I have just bought five PICAXE-08's for AUD$10.50 (~$2 each) and they are an 8-pin programmable chip with ADCs (Analog to Digital Converters), counters, PWM outputs, etc - a far more versatile device than the simple 4017, and they use FAR less power.
Though only 8 pins less 2 for power, it can have 1 input and up to 5 outputs - enough for your application.
The 08 "circuit" would be programmed. The switch-debounce can be a program (rather than a resistor-cap circuit). And no output diodes to "combine" the beams and parker because the program could do that - eg, off; park on, beam on & park (pins) on.
The output buffering (transistors or FETs etc to dive a relays else lights) would be the same, as would the +12V "input protection" circuitry, though a 5V regulator would be added for the PIC-08 (4.5-5.5V for normal running), but that's a zenor & resistor else a $1 voltage regulator (eg, a 3-pin 7805).
Now if you're into programming rather than electronics, or want later lamp or LED dimming circuits - especially "circuit complex" stuff like ramp-up and ramp-down dimming interior or puddle lights etc, then the PICAXE is the way to go.
I like them because instead of modifying circuits if I want added functionality or changed behavior (especially after finding some unintended fault - ie, a bug), it's simply a case of reprogramming.
The programming is done with 2 resistors and a serial port (to one pin on the PICAXE). Alas these days that means a USB to serial converter (~$29 for PICAXE compatible) if you don't have an old PC, but that converter can be used to plug into all your PICAXE circuits. (There are ethernet & USB compatible PICAXES, but they cost far more.)
I'll be using my PICAXE08s for engine fan controllers (from the st'd vehicle temp sender), headlight controllers, programmable ignition curves, sequential ignition (for ordinary "non-CAS" distributors), electric water-pump control, & & &... Yeah, one day.   
So, the next step - are you able to build a circuit? (Or game to try?)
And I'll assume the 4017 unless you advise otherwise. (PICAXE tools are available free - eg, downloadable programming packages, but it is a - or another - "programming language" to learn!)

Sorry, you can NOT post a reply.
This topic is closed.

  Printable version Printable version Post ReplyPost New Topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

  •  
Search the12volt.com
Follow the12volt.com Follow the12volt.com on Facebook
Friday, April 26, 2024 • Copyright © 1999-2024 the12volt.com, All Rights Reserved Privacy Policy & Use of Cookies
Disclaimer: *All information on this site ( the12volt.com ) is provided "as is" without any warranty of any kind, either expressed or implied, including but not limited to fitness for a particular use. Any user assumes the entire risk as to the accuracy and use of this information. Please verify all wire colors and diagrams before applying any information.

Secured by Sectigo
the12volt.com spacer
the12volt.com spacer
the12volt.com spacer
Support the12volt.com
Top
the12volt.com spacer
the12volt.com spacer