element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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 612 subscribers
  • Views 6087 views
  • Users 0 members are here
  • blink led
Related

Flashing Led's

commanderkelly
commanderkelly over 7 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
  • commanderkelly
    0 commanderkelly over 5 years ago in reply to parachaser

    I got some of them a few months back, but not really done much of anything on Electronics. I am hoping to start back up again now.

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

    The 555 timer is an IC chip that every Electronics enthusiast should have an abundance of and the PN2222A transister. Just sayin !

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • commanderkelly
    0 commanderkelly over 6 years ago in reply to kmikemoo

    Hello and thank you, I don't sleep well now lol.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kmikemoo
    0 kmikemoo over 6 years ago

    commanderkelly Welcome to the wonderful world of Arduino.  The Uno is my favorite.  You'll have a lot of fun integrating it into your railroad.  Prepare to lose even more sleep due to your hobby. imageimageimage

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • commanderkelly
    0 commanderkelly over 6 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
  • commanderkelly
    0 commanderkelly over 6 years ago in reply to 14rhb

    Hello I tryed that circuit you showed me with the push butten, I also added a led from pin 13 to the breadboard with a 100Ohm Res. 1. Off 2. On imageimage

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • 14rhb
    0 14rhb over 6 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
  • commanderkelly
    0 commanderkelly over 6 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 6 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 6 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
>
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 © 2026 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