Blinking led wit variable delay

Discussion in 'The Projects Forum' started by frucinator, Jun 2, 2016.

  1. frucinator

    Thread Starter New Member

    Jun 2, 2016
    2
    0
    Hi

    I need to make a small and cheap pulse generator for a project of mine.

    I would need a pin which hast to be approximately 30sec on low and 1sec on high whitch controls a mosfet that acts like a relay and lets trough 5volts to activate something else.

    I did some reshearch for the 555 chip and it seems to me that you can get only like 1:1 ratio between high and low.
    I know i can make this with an arduino but i would like to make something cheaper and smaller.

    I attached a picture which shows what kind of impulse would i like to have. (approx. 30 sec low 1sec high)
    and it would be even better if i could make the low time variable.

    sorry in advance if i said something silly but i'm not an electrical engineer nor am i a native english speaker

    Kind regards
     
  2. MrAl

    Well-Known Member

    Jun 17, 2014
    2,438
    492
    Hi,

    What picture?

    Can you use a 555 timer IC or do you have to use transistors?
     
  3. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,951
    387
  4. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,992
    745
    Two chips can do this.
    1) 555 timer in hysterical mode.
    2) Cd4093.
     
  5. frucinator

    Thread Starter New Member

    Jun 2, 2016
    2
    0
    here is the picture
     
  6. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Sounds like one emotional timer.
    Perhaps a 555 timer in the hysteretic mode would calm things down. :)
     
  7. dannyf

    Well-Known Member

    Sep 13, 2015
    1,819
    362
    30 seconds are kind of long for a RC timing circuit but still doable.

    As long as you aren't looking for precision.
     
  8. mtonge

    New Member

    Apr 19, 2016
    23
    5
    This may require a bit of a learning curve but, you can accomplish this variable timing and output to an LED with an AVR microcontroller. If you can prototype it on Arduino, you can recreate it with an AVR like the ATmega168 or even an ATtiny45. You will need an AVR programmer like the USBtinyISP. I also recommend getting a good book like Make: AVR Programming to get started. This may be the long way to a solution, but AVRs are programmable, relatively cheap, and there is a large community for support. The code would be very simple using the delay() function for the blinker timing. On the other hand, the Related Forum Posts listed below may provide a quicker solution. Hope this was helpful, MT.
     
  9. #12

    Expert

    Nov 30, 2010
    16,298
    6,810
    Emotional? Think about my reaction to using a microprocessor to do what a 555 chip can do.:mad:
     
    AlbertHall likes this.
  10. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,992
    745
    A 555 timer is easier than a microcontroller...
     
  11. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,951
    387
    I'll second that emotion.
     
    #12 likes this.
  12. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,172
    397
    This is for high side switching using a LL SMT P Ch. FET, FDS9435A because I have one. If you can use
    low side switching with LL N Ch. FET , then invert D1, Source to ground, Drain to - load, + load to +5V. Connect resistor & LED across load.
    . Thirey Second Tie 00000.jpg
     
    Last edited: Jun 3, 2016
  13. splud

    New Member

    Jun 30, 2013
    6
    0
    Actually, an ATTiny13A is more than sufficient, even with only 1KB of flash, and the price won't be appreciably different from the 555.

    There are several benefits to the uC route here compared to 555:

    555 has a higher voltage requirement - minimum voltage requirement is +4.5V. You can drive a uC off of 3.3V or even less (though driving your LED might pose issues at lower voltages), making it easier to run from batteries if that's part of your needs.

    Timing can be changed programmatically. Since the ATTiny family has EEPROM, you could implement code to allow you to adjust the timing by providing a signal on an I/O pin. Say you connect a button to a selected pin and power it up with the button providing +V on that pin which causes the code to enter setup mode, and it starts rapidly flashing the LED (to indicate it is in setup), and you release the button which starts it measuring how long to keep the LED off (and it turns the LED off), at the end of which, you depress the button and it starts measuring how long to keep the LED on (and it turns the LED on). You release the button, the timing data is stored to EEPROM and the device restarts using the new timing settings - which it will do whenever it starts from there on out. No swapping out the RC network to make tweaks. The button doesn't need to be a permanent fixture, and the initial values in the EEPROM can be stored when initially programming the device if you know the values you want to use.

    Excepting for adjustment purpose above, the uC approach, at least with the ATTiny family, requires no external components. No collection of resistors and capacitors to define the setting - just power and whatever is necessary for driving your output (so LED and current limiting resistor). You can software redefine the settings by re-flashing the device, whereas with the 555, you have to replace the RC network.


    By way of comparative example, I have a simple project using an ATTiny which drives an indicator LED and an optoisolator driving a Triac to switch an electric outlet on and off. There's a button input to the uC which turns it on (if the output is off), resets it (if depressed briefly while output is on), or turns it off (if pressed and held while the output is on - kind of like a PC power switch). LED is constant state on until a minute before the timer runs out, then it starts blinking slowly, and at 30 seconds, it blinks more rapidly, before the device (and LED) shuts off.

    All the logic is handled within a simple state machine (i.e. table-driven code) running in the uC, at a cost of about 400-500 bytes of flash codespace, and there's still more I/O available if I had something else I wanted to do.

    I paid all of about US$0.27 per uC, which makes it a no-brainer to use them for all manner of simple tasks.
     
  14. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,951
    387
    But:
    The OP specified 5V to be switched to his load.
    Instead of all this reflashing with new code, or writing complex button pushing code(for a beginner coder) all the '555 needs is one or two pots to set the on/off times. QED
     
    Dodgydave likes this.
  15. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,770
    970
    Yeah but I want a BMW... Sure my Yugo gets me to work.. But its not as cool..

    Today a 555 will do what he wants.. Tomorrow.. Maybe not.. ;)
     
  16. KeepItSimpleStupid

    Well-Known Member

    Mar 4, 2014
    1,146
    204
  17. dannyf

    Well-Known Member

    Sep 13, 2015
    1,819
    362
  18. KeepItSimpleStupid

    Well-Known Member

    Mar 4, 2014
    1,146
    204
    It's not a 555. It can do long timer delays with a low value capacitor because of the programmability and it's one part instead of 2.
     
  19. dannyf

    Well-Known Member

    Sep 13, 2015
    1,819
    362
    So can a 555 / oscillator + counter.

    4060 is one part too.
     
  20. KeepItSimpleStupid

    Well-Known Member

    Mar 4, 2014
    1,146
    204
    You need a programmer http://www.customsiliconsolutions.com/downloads/Standard IC Products/CSS555 EZ Programmer.pdf to set the options of the CSS555. Long time delays with a 555 are nearly impossible to do nicely. 1 uf || 1 uF and a 2 M resistor would be about 4 sec in the one-shot mode.

    The CSS555 is NOT a 555 timer.
     
Loading...