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...
(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.
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...
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...
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...
