element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Community Hub
Community Hub
Member's Forum Flashing Led's
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 53 replies
  • Answers 23 answers
  • Subscribers 534 subscribers
  • Views 4581 views
  • Users 0 members are here
  • blink led
Related

Flashing Led's

commanderkelly
commanderkelly over 6 years ago

Hello, I am new to this site and loving it. I did a bit of Electronics in 1995 where I made a flashing led circuit with 2 led's and it was cool. My other hobby is model trains and I would like to put 2 small led's in buffer stops and make them flash and run it off a DC train controller. Does anyone have a simple circuit that would do the job for this? I am basically a noob at electronics but I can follow a simple circuit.

 

Thank you.

 

Gary.

  • Sign in to reply
  • Cancel

Top Replies

  • 14rhb
    14rhb over 6 years ago +12 suggested
    Hi Gary, Welcome to Element 14 Community. Although a long time ago, you have already completed the first step on the world of modern electronics - the famous 'blinky' experiment . I'm assuming you want…
  • beacon_dave
    beacon_dave over 6 years ago +8 suggested
    Probably can't get much simpler than a flashing LED: https://uk.farnell.com/c/optoelectronics-displays/led-products/flashing-blinking-leds Size may be an issue however. 3mm is the smallest listed.
  • fmilburn
    fmilburn over 6 years ago in reply to 14rhb +7 suggested
    Hi Rod and Gary, I am more of a digital guy but I saw this and had to build it. The circuit is close to the first link that Rod gave above. The voltage source is 4 AAA, R1 and R4 are 330 ohm, R2 and R3…
Parents
  • commanderkelly
    0 commanderkelly over 5 years ago

    I have not been well for a bit but have not forgot about this project. I have now got one of them Ardunio Uno and was thinking of powering the flashing leds with it in the buffer stops. Now as I said before I am a noob at all this and I have no clue how to use an Arduino, Can anyone help me out here. I would like to power say like 10 flashing leds on differant buffer stops around the train track. Would this be possible on 1 Arduino and does anyone have a circuit that would help me do this.

     

    Thank you Gary.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • 14rhb
    0 14rhb over 5 years ago in reply to commanderkelly

    Hi commanderkelly

     

    Sorry to hear you were unwell - hopefully you are OK now.

     

    Thank you for keeping us informed of your project progress. It is always nice to know someone's goals are progressing and it sounds like yours are with extra LEDs around the model. You've got some great replies already and I'm so pleased to see your Arduino progress. Personally I too like the Arduino as you can very easily and accurately adjust the timings. In time you may also like to add a switch input - perhaps a microswitch that the train brushes against or better still a non-contact sensor....we can discuss that when you are ready. You would then be able to modify your Arduino code to perform an action based on that switch or to undertake an action (the buffer LEDs toggling) for a certain amount of time before turning off again.

     

    I see you have suggestion of using the 555 timer IC - always a staple device for such projects in the past and I think most of us have a fond spot for it. However it cannot be configured quite as easily - great if you are happy with the exact blink times and the 50:50 split between two LED but less so when the timing division is asymmetrical or hard to set. Setting up switches would then be more complex as well....not  extremely, but just a bit awkward IMO.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • commanderkelly
    0 commanderkelly over 5 years ago in reply to 14rhb

    Hello 14rhb,

     

    I like what you are talking about here, I was thinking about a sensor also. Where the train say like driving up to the buffer stop and the sensor picks it up and the buffer spot LED starts to flash and when the trian get right up close the LED then stops flashing and stays on to let the train know to stop. I am not sure if that could be done or not and you might have other ideas.

     

    Gary.

     

    I have also ordered some 555 timers.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • 14rhb
    0 14rhb over 5 years ago in reply to commanderkelly

    You should be able to do all that with your Arduino. Currently you are using some pins as outputs to the LEDs, as well as that you can set pins up as inputs.

     

    Mechanical Switch

    The simple circuit below shows such a switch wired in [the full article is on the Arduino website: https://www.arduino.cc/en/tutorial/button ].

    image

    With the switch open circuit the Arduino reads a low voltage on the pin 2 as this is effectively grounded through the resistor. When the switch is pushed the +5v appears on the input. In your Arduino code you would probably loop around in a 'WHILE LOOP' constantly reading the switch and adjusting the LED state accordingly. That is the fun part as you are effectively crafting the code to do what you want.

     

    A simple switch would need pushing and I guess physical contact between train and switch could easily scratch or derail the train. You could maybe get one under the track that detects the extra weight as the train passes over.

     

    Contactless Switch is Better

    Probably a better way is to go for a contactless setup but it would be slightly more difficult to understand. There are several ways including Hall Effect switches but my preferred route would be to use an Infra-Red (IR) diode and photo-detector placed either side of the track. The classic bank-burglar beam break setup just in miniature: The IR LED would run from the Arduino +5v supply via a suitable resistor - this would emit a constant level of IR light across the track and onto the photo-detector. The photo-diode would need a transistor amplifier but effectively become your switch input....I'll try and find/draw the bits you need but there aren't many.

     

    *** Easier still you could also just buy the sensors (search Adafruit IR Beam Break Sensor) as they incorporate the LED resistor and the photo-detector amplifier. You can see an example of them being used here: https://learn.adafruit.com/ir-breakbeam-sensors/arduino

     

    Coding

    For your idea you would need two beam break sensors - one on the buffer approach and the other right up close to the buffer. When ready we'll gladly help with any code suggestions for you as well image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • commanderkelly
    0 commanderkelly over 5 years ago in reply to 14rhb

    Hello and thanks for the info so far I will get a buffer stop or make one and all look at the links, as for how to set this up I have no clue but willing to learn.

     

    Gary.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • 14rhb
    0 14rhb over 5 years ago in reply to commanderkelly

    And a scale model signalling hut to keep the Arduino hidden in image

     

    Keep asking if you get stuck.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • 14rhb
    0 14rhb over 5 years ago in reply to commanderkelly

    And a scale model signalling hut to keep the Arduino hidden in image

     

    Keep asking if you get stuck.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • commanderkelly
    0 commanderkelly over 5 years ago in reply to 14rhb

    yes a great idea Thank you.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube