LED flash once while button is pressed using 555?

Discussion in 'The Projects Forum' started by Battou, Jun 4, 2016.

  1. Battou

    Thread Starter New Member

    Jun 4, 2016
    9
    0
    Hi. Can someone help me? I need to make a circuit using 555 timer so that after button is pressed LED flashes once for a certain amount of time and dont flash any more until button is released and pressed again. Any thoughts? Tried to modify monostable circuit, but cant achieve needed effect.(

    Will be grateful for any thoughts. Thanks!
     
  2. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,958
    387
  3. Battou

    Thread Starter New Member

    Jun 4, 2016
    9
    0
    Hm.. will try it. But I cant make that scheme to work in All Circuit simulator. And there is no button or switch in the scheme... Yes, I'm a noob.(
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,032
    3,241
    Vin is where the button goes.
     
  5. Battou

    Thread Starter New Member

    Jun 4, 2016
    9
    0
    Ops... I made a mistake. I need LED to flash when button is released. More speciefic - when photoresistor is blocked from IR diode light. It have 200-300Ohm when lit, and jver 100kOhm in the dark. I made a circuit simulation for pressing button, but now I nedd to invert it to Flash when releasing button. Any ideas? T_T Im sorry for confusing you. And thank you for help!
     
  6. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    Post your schematic.
     
  7. Battou

    Thread Starter New Member

    Jun 4, 2016
    9
    0
    Here is my schematic. Two resistors and a switch at the bottom are a representation of a phototransistor in lit and blocked states. It works in the way that when transistor goes from blocked to lit - LED blinks. But I need to make so that LED blinks when transistor goes from lit to blocked.
     
  8. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    Why do you have a 4K resistor in parallel with the 1K? Swapping those two resistors with the LDR should do it. When the LDR is in light, the left side of the 3μF cap will be higher than 1/3 Vcc. When the LDR is blocked, you'll get a negative pulse below 1/3 Vcc that will trigger the one shot.

    The 3μF cap can be smaller. Is your timing cap really 1.08mF? It could be significantly smaller if you used a larger timing resistance.
     
  9. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    What your described seems didn't match the circuit?

    Is that you want to press the key to make led flashing for a certain amount of time, during these time that the key always pressed?

    But in the circuit that the key just press and it lost the function as released, this is a quite normal application.

    Maybe you need a NE556(two 555) or two 555, the first 555 is to setup the timer for led flashing, that is one shot timer function and the second 555 is the oscillator to flashing the led, you can setup or adjust the flashing frequency.
     
  10. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,826
  11. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    In the first circuit, when the power up then the pin 2 could be triggered by 10nF and 1K to ground, have you try the circuit?

    The second circuit also has the same problem, because the pin 2 is a negative trigger input.
     
  12. Battou

    Thread Starter New Member

    Jun 4, 2016
    9
    0
    The first scheme, the one without transistor, is almost perfectly what I need! Thanks! But it still have two problems. If switch opend and closed fast then trigger pulse dont reach neded 1/3 of control voltage. And the second problem is spaike up to 12v with 5v source when switch released. But overall effect is exactly wht I need, no output when button pressed and output pulse once when buttot released. Ny way to adapt it for fast switch state change?
     
  13. Battou

    Thread Starter New Member

    Jun 4, 2016
    9
    0
    I think I managed to adapt it for fast switching. I lowered max voltage on Trigger pin, so I can dip it lower then 1/3 of Vcc with smaller capacitor. What do you think? (two resistors and a switch in the upper left corner - photoresistor representation)
     
  14. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,958
    387
    Better, you should put a diode from TRIG to +5V, anode to TRIG.
     
  15. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,826
    It definitely triggers on power-up. Was no triggering on power-up a requirement? I'll wait for the OP to discuss.
     
  16. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    That's a problem.
    I even saying that in #9, the trigger method with the circuit and what he described can't match.
     
  17. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,958
    387
    Looking at the circuit in this link:
    http://www.doctronics.co.uk/555.htm#triggering
    At the left hand side you will see a 10k resistor and a Vin label. To get what you want, move the resistor to the Vin location and connect your switch where the resistor was connected.
    If the switch is closed at switch on there will be no flash as required. When the switch is opened the LED will flash.
     
  18. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,826
    The button press time on a simulator is different than a button press in real life. The time constant of the RC network on the circuit should be one millisecond. Your finger is not fast enough to press and release before it charges.


    You can add a small-value resistor in series with the trigger pin to protect it. The chip can handle 18 volts (depending on specific model of the 555). You can also add a diode (reverse biased) from pin 2 to Vcc) but that can cause some mis-firing on button press. You can add a 100 to 1k in series with the diode to eliminate mis-firing with the diode. (I, personally, wouldn't worry about the low current spikes until it is a problem)
     
  19. Battou

    Thread Starter New Member

    Jun 4, 2016
    9
    0
    I think that Ive came up with proper scheme. Will try to build it tomorrow and will post results here.

    Yet again needed algorithm:
    1) while there is nothing between IR diode and phototransistor - LED do not powered.
    2) when something blocks IR from reaching phototransistor - LED turns on.
    3) LED flashes once for certain amount of time, no matter if obstruction is remover right away, or if it stays between IR diod and photoresistor.
    4) LED can be powered again only after flash ends and obstruction removed.

    One-flash obstruction sensor so to say. Thanks everyone for help, suggestions and schematics! Still opend for suggestions.) Will post my results tomorrow.)
     
  20. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,958
    387
    There is one other consideration when replacing the switch with the opto-sensor. Might the obstruction move very slowly? If it moves slowly enough it won't trigger the '555.
     
Loading...