Traffic Stoplight Using an Arduino Board

So, you’re beginning to learn hacking an Arduino board? Here’s a fun activity to do: a traffic signal light simulator. For this activity, you will need:

  • an Arduino board (I am using an Arduino Uno)
  • a breadboard
  • LED’s (1 red, 1 yellow and 1 green)
  • 220 Ohm resistors
  • some jumper cables (blue and red cables will do)

 

Attach the components to the breadboard as shown in this diagram:

I used an app called "Fritzing" to come up with this clean diagram.

I used an app called “Fritzing” to come up with this clean diagram.

Now, fire up your Arduino IDE and key-in the following code:

If everything will go as planned, you will have the LEDs lighting up in this sequence:

Share this:

Add Comment

Required fields are marked *. Your email address will not be published.