Author Topic: Sequential Taillight using Arduino Pro Mini (Thread Change from 555 Delay Timer)  (Read 51151 times)

0 Members and 1 Guest are viewing this topic.

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
So, I have been reading and trying to understand how a 555 timer properly works.  Now, I still have alot to learn, but I think I am starting to understand it.

Here's a schematic I am working on.

I tried to keep the BOM line count down, that is why I chose 10K trimmer pots for both timers.

Here's how I am hoping the circuit works...

R2 would be adjusted to ~9.62k which should have the ON time of 666ms while R6 would be adjust to ~4.81K which should have an OFF time of 333ms on the first 555 timer.
R4 would be adjusted to ~4.81k which should have the ON time of 333ms while R5 would be adjust to ~9.62K which should have an OFF time of 666ms on the second 555 timer.

Now, I'm hoping it would display the flashes as this...

D9D10D11At Time Interval
ONOFFOFF0 msec
ONONOFF333 msec
ONONON666 msec
OFFOFFOFF1000 msec


At time 1000, the 12V supply to the timer circuits would be cut-off, do to the flashing relay (not shown) and then the circuit would just repeat/reset when the 12V switches back to the ON position at Time of 2000 msec.

The Relays need to stay off until the Timer triggers them.

Are my Values correct? Will this work?

16V, 25V, or 35V Capacitors?
1/2W, 1/4W, or 1/8W resistors?
1A diodes okay? Schottky or regular?

Since the supply voltage for the Timers are switched on and off continuously from a flasher relay......is there anything that should be done to help protect the Timers from any type of possible damage?

I don't have a simulation program, and I've tried using the LTSpice...I just don't understand it.

With my calculations (resistor values), I have duty cycles of 33.3% and 66.6%...from my understanding, the 555 timers don't perform well under 50%.  what can I do about the 33.3% duty cycle from the second 555 timer?  I'd like to try and keep the Trimmer Pots all at 10k, and the Caps at 100uF.  That will keep my BOM Line count down.  The calculation shows also that that both timers will perform at 1Hz.

I also read that the dip packages need to have a socket soldered to the PCB first, then the timer placed into the socket, as the heat from soldering damages the chip. I am guessing this is a stupid question but I am throwing it out there anyway....do the SMD version of the 555 timers have problems with the heat from reflowing?

I appreciate any help you guys can give me on this.  :) After I am done figuring out this circuit, I'll move onto another 555 Timer circuit, then maybe Ill get into Op-amps or something. I can't believe how many things can be done with 555 timers.

« Last Edit: January 09, 2016, 01:13:24 am by Falcon69 »
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #1 on: January 05, 2016, 09:54:06 pm »
Noone has input on this?

This is going to be for my Nephews truck. He built a flatbed and used 3 of those 6inch oval LED tail lights for each side. He wants them to sequential flash. Because there is one wire that operates the Turn Signal, Hazard, And Stop lights, I think I have to use a circuit like this.

I am actually not sure on the Resistor values (potentiometers) because I don't have the flasher relay from his truck. Looking online, the Federal regulations say the turn signals/hazards need to flash at 1-2Hz (1-2 seconds) So I figured if D9 flashes On, stays lit for 1 second, then off for 1 second, that should be okay. But, Again, I am not sure without hooking this up to his vehicle and checking. I may need to decrease the intervals that D10 and D11 flash after the D9, depending on his flashers rate of flashing.  I can't just replace his whole brake switching. The truck goes from power, into flasher relay, then to turn signal and hazard switch, then out to the rear lights. That, plus, It would mess up his trailer brake system and his trailer lights.  I need to tap into the wires (stock wires) at the taillight of his truck to do this.

I was also going to cast this in resin to help protect from the elements, and just leave alittle bit of the potentiometer so a small screw driver can get to it.

I tried this...

http://www.ebay.com/itm/UPI-90656-Sequential-LED-Light-Kit-/321485523191?hash=item4ada07c8f7:g:-QMAAOSwnDZT46Oq&vxp=mtr

But they did not work. When brakes were applied, and turn signal was on, both sides sequential flashed like the hazards were on. Can't do that. The sequential can go through one rotation, but must stay lit at the end of its rotation when brakes are applied, according to the federal regulations. And yes, he knows that he could still get a ticket, because this was not a factory feature originally offered on the vehicle...but it's what he wants. So, please, no flaming on this issue.  Let's just talk about how to make it work, and safely. :)

EDIT: added wire diagram of those sequential modules. Waste of $60
« Last Edit: January 05, 2016, 09:59:00 pm by Falcon69 »
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: 555 Delay Timer.
« Reply #2 on: January 06, 2016, 03:55:09 am »
I've attached the simulation results of your circuit from the TINA-TI simulator.  As you can see it is about what you expect.  The first pulse is longer than expected, however.  This is due to the fact that the two timing capacitors aren't charged up.

A Johnson counter (4017, for example) and some or-ing diodes is another option.  You could use a 555 to drive the clock pin at 3 Hz.  (Note: The second screenshot is from TINA.  TINA-TI doesn't do digital or mixed mode simulations.)
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #3 on: January 06, 2016, 04:41:21 am »
Thank you TerminalJack505

I'm trying to achieve this, and not sure how or what is going on with your simulation. (graph below)

If I have to supply a steady voltage to the timer circuit (and just have the flasher relay on the trigger of the 555), then may need to do that, but not sure how to do it.

There can't be any delay, as your simulation shows, for capacitors to charge up (I thought about that, but thought at 100uF, it wouldn't take long. :(....like nano sec's. A delay could cause a rear end accident. I learned from truck driving, that for every second you hesitate stepping on that brake pedal.....the truck travels one football field at 60 mph.  Granted, this is just going on a pick-up truck, but still, the delay could cause an accident.

I'm not sure now how to make the circuit work using trigger as the input using the supplied brake/hazard/turn FACTORY wire already there at the taillights, and keeping the rest of the circuit with a steady +12volts (well, as long as the ignition is on anyway, don't want the circuit to stay on while the truck is parked for the night).  I could run a wire straight to the back for a +12v, but, that would mean I would also need to run a 3rd 555 timer for D9?

I tried using a 4017 before, in conjunction with a 555 timer. It did not work.  In fact, I think that was another circuit I had posted on here many months ago, trying to make this same thing work. I gave up on it, but now my Nephew is hounding me to get this done. He's taking a trip to California to see some offroad/rock crawling competition, and he wants his truck wired up for this, among other things. So I need to get this done for him. It is his Christmas present.


 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #4 on: January 06, 2016, 04:44:54 am »
oh, now i understand your 4017 drawing. That could work. Very small BOM as well.  Do they make a 4017 that operates on say, 4.5v to 16 volts? 

Another thing I thought of....might need to put in some type of circuit to help with spikes. His truck runs on 12 volts, but because of his cummins diesel, it also runs 2 batteries (24volt). I don't know the wiring of his truck, but those taillight wires to measure ~12volt on a DMM.

 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #5 on: January 06, 2016, 04:48:40 am »
wait, that 4017 circuit...how would it react when the brake is applied? It will only light up the first LED in sequence? Not all 3?  How would I make it so it will sequential flash to the 3rd, and all stay on...until brakes are released.

I thought about maybe running another wire connected to the brake pedal back to each relay in the circuit so when brakes are applied, it bypasses the 4017 and lights all 3, however...if the turn signal is on..it won't work. Also, the effect of having the sequential for 1 cycle, then all LEDs stay on when brake is applied....won't happen that way.

This is getting technical now. LOL
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #6 on: January 06, 2016, 04:51:48 am »
sorry, just realized something else as well with that 4017. I would need to figure out how to 8x the flasher relay's frequency to make that 4017 circuit work. The flasher relay flashing every 1 second, won't work. It would take 4 flashes On, 4 flashes off (8 seconds....ON/OFF) to finish the sequence.....right?
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #7 on: January 06, 2016, 05:32:51 am »
This guy....



is using the cheap ebay timer delay switches, wired up as in the second pic. It is working for him....however, I am concerned with the frequency of the flashing relay on my nephews truck.  I made a mock up on perf board of that ebay circuit, and I could not get the second and the 3rd light to activate in sequence. I think the time ran out for the 3rd, and the circuit reset. Of course, my perfboard mock up could have had something wrong with it.

I've included pictures of the perfboard i did. It has both the circuits on one board, and 6 leds. The leds simulated the oval LED's he bought. But I did connect it to the stock wiring for his taillights coming from the front of the truck (switches, flashers, etc.) It did take me awhile to build that thing. Takes awhile to blob all that solder on the back. Pain in da behind!
 

Offline cponcsak

  • Contributor
  • Posts: 39
  • Country: ca
Re: 555 Delay Timer.
« Reply #8 on: January 06, 2016, 10:47:23 am »
Couldn't you use the same circuit but replace the mechanical relays with solid state ones?
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: 555 Delay Timer.
« Reply #9 on: January 06, 2016, 01:56:25 pm »
Sorry, I didn't pay much attention to all of the details so far as the requirements go.

If you want 1 second of off time then (on the 4017 schematic) just move the master reset down a couple of outputs.

The brake signal could be OR-ed in along with the sequence signals using diodes.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #10 on: January 06, 2016, 08:41:53 pm »
TerminalJack505,

Maybe I don't understand...

The flashing relay turns off/on every 1 second. That means the 4017 sees a count every 1 second.  So, To complete 1 cycle of the sequential lights, I would need 8 total seconds to do that.

That is WAY to slow. I need to make the counts at least 1/6second to get the second and third led to turn on at interval 333ms and 666ms, then all off at 1second.

The other problem with the 4017, at each off count, the led's will turn off, and the next will light.  That won't work. I need the preceding LED's to stay lit, until the cycle is finished. I don't need a chaser LED set-up, I need a Sequential LED set-up.
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: 555 Delay Timer.
« Reply #11 on: January 07, 2016, 05:27:29 am »
I missed the part where the brake signal and the turn signal are the same.

Here's another thought.  Note that, like the earlier schematic with the 4017, I'm not showing how the 3 Hz clock is generated.  (The input to the CP0 pin.  This isn't the brake/turn signal.)

The diodes take care of keeping the preceding LEDs lit.

Once the 4017 gets power and the clock starts, the three outputs will each go high in order at the speed controlled by the clock signal.  Once Q3 goes high it will bring the clock inhibit pin high and stop the 4017 from counting any further.  All of the outputs will be high at this point and will remain high until power is removed.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #12 on: January 07, 2016, 05:36:21 am »
okay, i get that.

I still don't understand how to boost the frequency.

If the flasher relay is 1 second (1 Hz), how would I boost the frequency to the 3Hz or even 6Hz?  I tried to find a Frequncy Tripler circuit, but all I am finding are doublers.
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: 555 Delay Timer.
« Reply #13 on: January 07, 2016, 05:47:05 am »
The clock signal would just have to be generated by a separate oscillator circuit.  If you're not careful, however, it could have the same problem as the 555s, where the first pulse is stretched out. 

You might be able to take advantage of the fact that the 4017 doesn't need a clock with a perfect 50% duty cycle and minimize the extra time that the first pulse will have by using a lopsided duty cycle.  (Hope that makes sense.)
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #14 on: January 07, 2016, 06:15:06 am »
I will try breadboarding this, but, I don't see how it is going to work with a 1Hz pulse signal.  That will just make it too long.  I could pop open the Flashing Relay of the truck and solder on another capacitor in parallel to the existing capacitor to raise the frequency, but, then his Trailer lights will flash way too fast.

So, I need to do this at the lights themselves and leave everything else stock wiring of the truck.

I am having trouble finding a circuit that will triple the frequency coming from the Flasher Relay of the truck, to goto this circuit for the 4017.

I understand what you are saying about the capacitors charging to full first in the 555 timer circuit. By that happening, it will mess everything up for that short period it take for the cap to charge.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #15 on: January 07, 2016, 07:18:28 am »
I need to find a circuit that converts 1Hz to 3 or 4 Hz. I think.

« Last Edit: January 07, 2016, 07:50:24 am by Falcon69 »
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: 555 Delay Timer.
« Reply #16 on: January 07, 2016, 07:58:59 am »
This is trivial to implement with a microcontroller, say, an Arduino ProMini or Uno. Initial cost may be a bit more than using TTL/CMOS but it is far more flexible and easier to set up.

It's almost the same code I wrote for another poster on a different thread.


Code: [Select]
/*--------------------------------------------------------------------------------------//
   3-Light Sequential Brake/Turn Signal Actuation
//--------------------------------------------------------------------------------------*/

int delayOn = 333;  // set sequence delay time in ms here

void setup() {
  // connect LEDs, relay drivers or mosfet Gates to Output pins here
  pinMode (10, OUTPUT); 
  pinMode (11, OUTPUT);
  pinMode (12, OUTPUT);
 
  //  connect Brake/Turn signal here (through divider or regulator to give ~4-5V when ON)
  pinMode (7, INPUT);         
}

void loop() {
// Lather:
 
  while (digitalRead(7)==LOW) {
    // do nothing, wait for signal to go HIGH
  }
 
  // when signal goes High, actuate outputs in sequence
  digitalWrite(10, HIGH);
  delay(delayOn);
  digitalWrite(11, HIGH);
  delay (delayOn);
  digitalWrite(12, HIGH); 
   
  while (digitalRead(7)==HIGH) {
    // do nothing, keep outputs ON and wait for signal to go LOW again to reset cycle
  }
 
// Rinse:

  // when signal goes LOW turn OFF all outputs
  digitalWrite(10, LOW);
  digitalWrite(11, LOW);
  digitalWrite(12, LOW);
}
// Repeat:


 :clap:
« Last Edit: January 07, 2016, 08:03:59 am by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #17 on: January 07, 2016, 08:06:55 am »
I'm trying to do this without Arduino.  Seems a waste to buy two of them (one for each side), and cast them in resin and throw them up underneath the truck. 
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: 555 Delay Timer.
« Reply #18 on: January 07, 2016, 08:27:00 am »
One micro (any micro) - handling both sides...
...is also the way I'd be going with this.

No relays, MOSFETS and a cold beer afterwards.

Easy to add extra 'effects' for hazard lights etc (leave the programming header poking out of the epoxy!
(Why under the truck, why not n the firewall in a diecast box?
Don't ask a question if you aren't willing to listen to the answer.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #19 on: January 07, 2016, 08:30:54 am »
Hello MC,

The wires are in the back. He ripped off his bed, made a flat bed, and the wires are hanging. He installed 3 LED lights on each side of the flatbed. I need to do this at the termination of the wires in the back. If I do this up front, then it will mess up the stock flashing of when he hooks up his trailer through the trailer hitch jack.  I'm trying to do some very simple (i thought anyway) where all I had to do was build the circuit, go over to his house, and Connect those 3 wires (Ground, Turn/Brake/Hazard Light, Running Light) to it and be good to go.

I am thinking I would also need something to vary the time, in case they are too fast or two slow for the flashing rate for him.  Like a pot to change this.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: 555 Delay Timer.
« Reply #20 on: January 07, 2016, 08:39:58 am »
OK, I get you.
I still think any way to remove unneeded components that need to be interconnected is a good starting point.  A micro plus MOSFETS.
The vibration and crappy environment in autos is not nice for anything that moves or can move!   Lay everythig low to the board, minimse connectors etc.

Even using a stock arduino module is pushing the boundaries, as these (even cast in epoxy) may not last as long as you expect, due to mechanical considerations of the soldering etc... relays and the spade/QC connectors just add to the multiple 'points of failure'.

Mass of one relay could be as much as the whole micro solution... mass is your enemy in a vibrating environment.

Do you have an arduino nearby?  If yes - Which board?
I can hack up some code against your first diagram, then you can critique, and modify as needed.

Once it's working correctly - build up the final module and enjoy.
Remember to include power protection against charging spikes etc in the vehicle.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #21 on: January 07, 2016, 08:44:21 am »
I have no Arduino.  I'm still trying to learn this Stuff.  I am thinking of buying a few cheap Nanos from Aliexpress and see how they work and try and understand the programming.

The lights draw 240mA each, 240x3=720mA per side total draw.  So I would have to use a relay anyway.  There's plenty of power coming straight off the wiring that the circuit could connect to that currently exists...those 3 wires. But, connecting to them, would mean the circuit turns off at every cycle when blinker or hazards are turned on.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: 555 Delay Timer.
« Reply #22 on: January 07, 2016, 08:47:12 am »
No relays!  Use logic level MOSFETS
Don't ask a question if you aren't willing to listen to the answer.
 

Offline Falcon69Topic starter

  • Super Contributor
  • ***
  • Posts: 1482
  • Country: us
Re: 555 Delay Timer.
« Reply #23 on: January 07, 2016, 08:49:06 am »
okay, good enough, they are probably cheaper also.  But, wouldn't they heat up in the Resin?  I need to cast the circuit in resin to protect from condensation and other fouol stuff.  He 4wheels this truck alot, and these could be sitting in water/mud often.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: 555 Delay Timer.
« Reply #24 on: January 07, 2016, 08:50:49 am »
Naah - if you seal the controller in a box, or pot it in epoxy (properly), they'll outlast the truck!
Don't ask a question if you aren't willing to listen to the answer.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf