{"id":51454,"date":"2026-07-07T12:52:17","date_gmt":"2026-07-07T04:52:17","guid":{"rendered":"https:\/\/pcbcool.com\/?p=51454"},"modified":"2026-07-07T12:55:42","modified_gmt":"2026-07-07T04:55:42","slug":"arduino-uno-based-traffic-light-project","status":"publish","type":"post","link":"https:\/\/pcbcool.com\/de\/technical-guides\/arduino-uno-based-traffic-light-project\/","title":{"rendered":"Verkehrslichtprojekt basierend auf Arduino Uno"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"51454\" class=\"elementor elementor-51454\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"wd-negative-gap elementor-element elementor-element-246cdd62 e-flex e-con-boxed e-con e-parent\" data-id=\"246cdd62\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-603a1569 e-con-full e-flex e-con e-child\" data-id=\"603a1569\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-44c8a90 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"44c8a90\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Traffic lights are something we see every day on the roads. They control the flow of vehicles and keep traffic moving in an organized way without accidents. Most people never think about how these lights actually work, but the idea behind them is quite simple once you break it down.<\/p><p>In this article, we will build a small model of a traffic light system using an Arduino Uno, a few LEDs, and a breadboard. This is one of the most common beginner projects in electronics and embedded systems because it teaches the basics of digital output control, timing, and circuit building, all in one simple project.<\/p><p>By the end of this article, you will understand how a real traffic signal works, how to wire the components together, how to write the code for it, and how to test it on your own Arduino board.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-174ea51 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"174ea51\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Why This Project is a Good Starting Point<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-abfa9b6 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"abfa9b6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Anyone who is new to Arduino or electronics often struggles to find a project that is simple enough to understand but still teaches something useful. The traffic light project is perfect for this because it only needs a handful of parts, the wiring is not complicated, and the code is short and easy to follow. At the same time, it introduces some very important concepts such as:<\/p><ul><li>How to connect LEDs safely using resistors<\/li><li>How digital pins on a microcontroller work<\/li><li>How to control timing using delays<\/li><li>How to structure a program using loops<\/li><\/ul><p>These are the same building blocks used in much more advanced projects, so learning them here gives a strong foundation for anything else you might build later.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e0a98d3 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"e0a98d3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Components Required<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7133177 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"7133177\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>To build this project, you do not need many parts. Here is the full list:<\/p><ul><li>Arduino Uno board<\/li><li>USB cable to connect the Arduino to a computer<\/li><li>Breadboard<\/li><li>Red LED<\/li><li>Yellow LED<\/li><li>Green LED<\/li><li>Three resistors (220 ohms is a good value for LEDs)<\/li><li>Jumper wires (male to male)<\/li><\/ul><p>All of these parts are cheap and easily available from any electronics shop or online store. If you are a student or a hobbyist, you may already have most of these lying around from other small projects. For future business projects, PCBCool can also support <a href=\"https:\/\/pcbcool.com\/de\/services\/component-sourcing\/\">Komponentenbeschaffung<\/a>, helping customers manage BOM availability and procurement together with <a href=\"https:\/\/pcbcool.com\/de\/services\/pcb-assembly\/\">Leiterplattenbest\u00fcckung<\/a>.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ab72187 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"ab72187\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Understanding How a Real Traffic Light Works<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dd09c73 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"dd09c73\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Before jumping into the wiring, it helps to understand the actual pattern that traffic lights follow in real life. A standard traffic signal has three colors, and each one has a meaning:<\/p><ul><li>Red means stop. Vehicles must not move.<\/li><li>Yellow means get ready. The light is about to change, so drivers should slow down.<\/li><li>Green means go. Vehicles are allowed to move.<\/li><\/ul><p>The normal cycle in most countries goes like this: the light stays red for some time, then it turns green, then, before turning back to red, it briefly shows yellow as a warning. This cycle keeps repeating over and over again. Our Arduino project is going to copy this same pattern using LEDs instead of large traffic bulbs.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4047acd wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"4047acd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Circuit Diagram and Wiring<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4bfbbee color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"4bfbbee\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>The wiring for this project is very simple because we are only working with three LEDs. Each LED needs to be connected to a digital pin on the Arduino through a resistor, and the other leg of each LED needs to be connected to the ground pin.<\/p><p>Below is the circuit diagram showing how everything should be connected. The red LED, yellow LED, and green LED are placed on the breadboard, and each one is wired back to the Arduino using colored jumper wires. Notice how the black wire runs along the bottom rail of the breadboard to provide a common ground connection for all three LEDs.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-982e19b elementor-widget elementor-widget-image\" data-id=\"982e19b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1112\" height=\"633\" src=\"https:\/\/pcbcool.com\/wp-content\/themes\/woodmart\/images\/lazy.svg\" data-src=\"https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Arduino-Nano-Traffic-Light-Wiring-Diagram.jpg\" class=\"wd-lazy-fade attachment-full size-full wp-image-51460\" alt=\"Arduino Nano Traffic Light Wiring Diagram\" srcset=\"\" data-srcset=\"https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Arduino-Nano-Traffic-Light-Wiring-Diagram.jpg 1112w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Arduino-Nano-Traffic-Light-Wiring-Diagram-400x228.jpg 400w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Arduino-Nano-Traffic-Light-Wiring-Diagram-768x437.jpg 768w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Arduino-Nano-Traffic-Light-Wiring-Diagram-18x10.jpg 18w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Arduino-Nano-Traffic-Light-Wiring-Diagram-600x342.jpg 600w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Arduino-Nano-Traffic-Light-Wiring-Diagram-150x85.jpg 150w\" sizes=\"auto, (max-width: 1112px) 100vw, 1112px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4397bbe color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"4397bbe\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>As shown in the diagram, the connections are:<\/p><ul><li>Red LED connected to digital pin 9<\/li><li>Yellow LED connected to digital pin 8<\/li><li>Green LED connected to digital pin 7<\/li><li>All LED ground legs are connected to the Arduino GND pin through the breadboard\u2019s ground rail<\/li><\/ul><p>You can use different PINs if you prefer, just make sure the PINs in your code match the pins you actually wire up.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6c5126f wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"6c5126f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Wiring Steps<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-867c4bd color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"867c4bd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Here is a step-by-step way to build the circuit:<\/p><ol><li>Place the Arduino next to the breadboard so the wires can comfortably reach across.<\/li><li>Insert the red, yellow, and green LEDs into the breadboard, keeping some space between them. Each LED has two legs, a longer one (positive) and a shorter one (negative).<\/li><li>Connect a 220 ohm resistor to the longer leg (positive) of each LED. The resistor protects the LED from too much current, which could burn it out.<\/li><li>Run a jumper wire from the other end of each resistor to the Arduino digital pins (9, 8, and 7 in our example).<\/li><li>Connect the shorter leg (negative) of each LED to the ground rail on the breadboard.<\/li><li>Finally, connect the ground rail on the breadboard to the GND pin on the Arduino using a single jumper wire.<\/li><\/ol><p>Once this wiring is complete, your breadboard and Arduino should look something like the picture below, showing the finished physical setup with all three LEDs connected and wired to the board.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9c8eb1f elementor-widget elementor-widget-image\" data-id=\"9c8eb1f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"643\" height=\"433\" src=\"https:\/\/pcbcool.com\/wp-content\/themes\/woodmart\/images\/lazy.svg\" data-src=\"https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Actual-picture-of-the-breadboard-and-Arduino-after-wiring.jpg\" class=\"wd-lazy-fade attachment-full size-full wp-image-51464\" alt=\"Actual picture of the breadboard and Arduino after wiring\" srcset=\"\" data-srcset=\"https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Actual-picture-of-the-breadboard-and-Arduino-after-wiring.jpg 643w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Actual-picture-of-the-breadboard-and-Arduino-after-wiring-400x269.jpg 400w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Actual-picture-of-the-breadboard-and-Arduino-after-wiring-18x12.jpg 18w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Actual-picture-of-the-breadboard-and-Arduino-after-wiring-600x404.jpg 600w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Actual-picture-of-the-breadboard-and-Arduino-after-wiring-150x101.jpg 150w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-eb11549 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"eb11549\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>In this picture, you can see the Arduino Uno powered through a USB cable, with jumper wires running down to the breadboard where the three LEDs are placed in a row. This matches exactly what we described in the circuit diagram, just in real physical form instead of a drawing.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cc8f697 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"cc8f697\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Writing the Code<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6935a12 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"6935a12\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Now that the hardware is ready, we need to write the program that will control the LEDs. The Arduino programming language is based on C and C++, but for a project like this, you only need to know a few basic commands.<\/p><p>Here is the complete code for the traffic light project:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-64e1157 elementor-widget elementor-widget-code-highlight\" data-id=\"64e1157\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>int redLED = 9;\r\nint yellowLED = 8;\r\nint greenLED = 7;\r\n\r\nvoid setup() {\r\n  pinMode(redLED, OUTPUT);\r\n  pinMode(yellowLED, OUTPUT);\r\n  pinMode(greenLED, OUTPUT);\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ Red light on\r\n  digitalWrite(redLED, HIGH);\r\n  digitalWrite(yellowLED, LOW);\r\n  digitalWrite(greenLED, LOW);\r\n  delay(5000);\r\n\r\n  \/\/ Green light on\r\n  digitalWrite(redLED, LOW);\r\n  digitalWrite(yellowLED, LOW);\r\n  digitalWrite(greenLED, HIGH);\r\n  delay(5000);\r\n\r\n  \/\/ Yellow light on\r\n  digitalWrite(redLED, LOW);\r\n  digitalWrite(yellowLED, HIGH);\r\n  digitalWrite(greenLED, LOW);\r\n  delay(2000);\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7101312 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"7101312\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Explaining the Code<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fc3c587 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"fc3c587\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Let us break down what each part of this code is doing:<\/p><ul><li>At the top, we declare three variables (redLED, yellowLED, greenLED) and assign them the pin numbers we used in our wiring. This makes the code easier to read and change later, since we do not have to remember PIN numbers throughout the program.<\/li><li>The setup() function runs only once when the Arduino is powered on or reset. Inside it, we tell the Arduino that each of these three pins will be used as an OUTPUT, meaning the Arduino will send power out of these pins rather than reading power coming in.<\/li><li>The loop() function runs over and over again, forever, as long as the Arduino has power. This is where the actual traffic light pattern happens.<\/li><li>digitalWrite(redLED, HIGH) turns the red LED on by sending 5 volts to that pin. digitalWrite(redLED, LOW) turns it off by sending 0 volts.<\/li><li>delay(5000) tells the Arduino to wait for 5000 milliseconds, which is 5 seconds, before moving to the next line of code. This is what creates the timing between each light.<\/li><\/ul><p>Because the loop() function keeps repeating, the pattern of red, then green, then yellow, then back to red will continue endlessly, just like a real traffic signal.<\/p><p>You can change the delay values to make the lights stay on for shorter or longer periods, depending on how you want your model to behave.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c8aab57 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"c8aab57\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Uploading the Code to Arduino<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-390c9a2 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"390c9a2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Once you have written or copied the code into the Arduino IDE software on your computer, follow these steps to run it on your board:<\/p><ol><li>Connect the Arduino to your computer using the USB cable.<\/li><li>Open the Arduino IDE and paste the code into a new sketch.<\/li><li>Go to the Tools menu and select the correct board type, which should be Arduino Uno.<\/li><li>Also, from the Tools menu, select the correct COM port that your Arduino is connected to.<\/li><li>Click the upload button, which looks like an arrow pointing to the right.<\/li><li>Wait for the IDE to show \u201cDone uploading\u201d at the bottom of the screen.<\/li><\/ol><p>Once the upload is complete, your LEDs should immediately start following the traffic light pattern that we defined in the code.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4be65c0 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"4be65c0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Testing and Observing the Result<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-284d486 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"284d486\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>After uploading the code, you should see the red LED light up first and stay on for 5 seconds. Then it will turn off and the green LED will turn on for another 5 seconds. After that, the green LED turns off and the yellow LED lights up for 2 seconds, warning that the cycle is about to restart. Then the entire pattern repeats itself from the beginning with the red light again.<\/p><p>If you test this setup in a darker room, the glow from the LEDs becomes much more visible and gives a nice effect similar to real traffic signal lights glowing at night. The picture below shows the LEDs glowing in a dim setting, which really highlights how the colors stand out once the surrounding light is reduced.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9bed378 elementor-widget elementor-widget-image\" data-id=\"9bed378\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"203\" src=\"https:\/\/pcbcool.com\/wp-content\/themes\/woodmart\/images\/lazy.svg\" data-src=\"https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Final-view-of-the-Arduino-Nano-traffic-light.jpg\" class=\"wd-lazy-fade attachment-full size-full wp-image-51465\" alt=\"Final view of the Arduino Nano traffic light\" srcset=\"\" data-srcset=\"https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Final-view-of-the-Arduino-Nano-traffic-light.jpg 406w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Final-view-of-the-Arduino-Nano-traffic-light-400x200.jpg 400w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Final-view-of-the-Arduino-Nano-traffic-light-18x9.jpg 18w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/07\/Final-view-of-the-Arduino-Nano-traffic-light-150x75.jpg 150w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4013759 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"4013759\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>This kind of testing is also useful for confirming that your circuit is working correctly. If any of the LEDs do not light up, it usually means one of the following problems:<\/p><ul><li>The LED might be inserted backwards, since LEDs only work in one direction<\/li><li>A wire might not be firmly connected to the breadboard or Arduino pin<\/li><li>The resistor value might be too high, dimming the LED too much to notice<\/li><li>The PIN in the code does not match the PIN used in the wiring. Going through this checklist usually solves most beginner wiring issues.<\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a48bfa8 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"a48bfa8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Improving and Expanding the Project<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c01493d color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"c01493d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Once your basic traffic light is working, there are many ways you can expand this project to make it more advanced and realistic:<\/p><ul><li>Add a pedestrian crossing light using two more LEDs (red for stop, green for walk) that works opposite to the main traffic light.<\/li><li>Add a push button so pedestrians can request the signal to change, just like real crossing buttons.<\/li><li>Use an LCD screen to display a countdown timer showing how many seconds are left before the light changes.<\/li><li>Control multiple traffic lights at an intersection, where one road has to be red while the other is green, and they switch together in sync.<\/li><li>Add a buzzer that sounds during the yellow light phase as an extra warning signal.<\/li><\/ul><p>These upgrades are not too difficult once you understand the basic version, and they are a great way to keep learning new Arduino skills, such as reading button inputs, using additional libraries, and managing multiple components working together at the same time.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9e67da4 wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"9e67da4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">Abschlie\u00dfende Gedanken<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1cc2065 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"1cc2065\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>The Arduino Uno-based traffic light project is one of the best ways for beginners to get comfortable with electronics and programming at the same time. It uses simple, affordable components, and the wiring is easy enough to complete in under thirty minutes. At the same time, the underlying concepts, such as digital output control and timing with delays, are used in countless other electronics projects, from home automation systems to robotics.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"wd-negative-gap elementor-element elementor-element-574f1fd6 e-flex e-con-boxed e-con e-parent\" data-id=\"574f1fd6\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5c60c6b5 elementor-hidden-desktop elementor-hidden-tablet elementor-hidden-mobile wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"5c60c6b5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-primary wd-title-style-underlined wd-title-size-large text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<h2 class=\"woodmart-title-container title wd-fontsize-xxl\">H\u00e4ufig gestellte Fragen<\/h2> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-138a87ec e-con-full elementor-hidden-desktop elementor-hidden-tablet elementor-hidden-mobile e-flex e-con e-child\" data-id=\"138a87ec\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t<div class=\"elementor-element elementor-element-7feee959 e-con-full e-flex e-con e-child\" data-id=\"7feee959\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-22e96f85 elementor-widget elementor-widget-wd_accordion\" data-id=\"22e96f85\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_accordion.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\n\t\t<div class=\"wd-accordion wd-style-shadow wd-titles-left wd-opener-pos-left wd-opener-style-arrow\" data-state=\"all_closed\">\n\t\t\t\t\t\t\t\n\t\t\t\t<div class=\"wd-accordion-item\">\n\t\t\t\t\t<div class=\"wd-accordion-title wd-role-btn\" data-accordion-index=\"0\" tabindex=\"0\">\n\t\t\t\t\t\t<div class=\"wd-accordion-title-text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\tQ1: Warum hat die Lagenanzahl einen so gro\u00dfen Einfluss auf die Kosten von Leiterplatten?\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<span class=\"wd-accordion-opener\"><\/span>\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<div class=\"wd-accordion-content wd-entry-content\" data-accordion-index=\"0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<p>Der Hauptgrund daf\u00fcr ist, dass jede zus\u00e4tzliche Schicht den Herstellungsprozess schwieriger zu kontrollieren macht. Mehr Schichten bedeuten mehr M\u00f6glichkeiten f\u00fcr Defekte in den inneren Lagen, Ausrichtungsprobleme, Laminationsprobleme und Ausschuss.<\/p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-2b32d82c e-con-full e-flex e-con e-child\" data-id=\"2b32d82c\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-a272c7d elementor-widget elementor-widget-wd_accordion\" data-id=\"a272c7d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_accordion.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\n\t\t<div class=\"wd-accordion wd-style-shadow wd-titles-left wd-opener-pos-left wd-opener-style-arrow\" data-state=\"all_closed\">\n\t\t\t\t\t\t\t\n\t\t\t\t<div class=\"wd-accordion-item\">\n\t\t\t\t\t<div class=\"wd-accordion-title wd-role-btn\" data-accordion-index=\"0\" tabindex=\"0\">\n\t\t\t\t\t\t<div class=\"wd-accordion-title-text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\tWarum erfordern BGA-Designs eine strengere Kontrolle der Leiterplattenherstellung?\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<span class=\"wd-accordion-opener\"><\/span>\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<div class=\"wd-accordion-content wd-entry-content\" data-accordion-index=\"0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<p>A: BGA-Pads sind klein und eng beieinander angeordnet, sodass kleine Herstellungsfehler leicht zu Montageproblemen werden k\u00f6nnen.<\/p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-46d73f7c elementor-widget elementor-widget-shortcode\" data-id=\"46d73f7c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\">\t\t\t<link rel=\"stylesheet\" id=\"elementor-post-38934-css\" href=\"https:\/\/pcbcool.com\/wp-content\/uploads\/elementor\/css\/post-38934.css?ver=1782894683\" type=\"text\/css\" media=\"all\">\n\t\t\t\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"38934\" class=\"elementor elementor-38934\" data-elementor-post-type=\"cms_block\">\n\t\t\t\t<div class=\"wd-negative-gap elementor-element elementor-element-33bcad2 e-flex e-con-boxed e-con e-parent\" data-id=\"33bcad2\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-c2f6cd0 e-con-full e-flex e-con e-child\" data-id=\"c2f6cd0\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t<div class=\"elementor-element elementor-element-819b8cd e-con-full e-flex e-con e-child\" data-id=\"819b8cd\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-abdf582 elementor-widget elementor-widget-image\" data-id=\"abdf582\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"250\" src=\"https:\/\/pcbcool.com\/wp-content\/themes\/woodmart\/images\/lazy.svg\" data-src=\"https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/01\/Sam-K.jpg\" class=\"wd-lazy-fade attachment-full size-full wp-image-38937\" alt=\"Sam K\" srcset=\"\" data-srcset=\"https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/01\/Sam-K.jpg 250w, https:\/\/pcbcool.com\/wp-content\/uploads\/2026\/01\/Sam-K-150x150.jpg 150w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-2cd26df e-con-full e-flex e-con e-child\" data-id=\"2cd26df\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-836541e wd-width-100 elementor-widget elementor-widget-wd_title\" data-id=\"836541e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wd_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"title-wrapper wd-set-mb reset-last-child wd-title-color-default wd-title-style-default wd-title-size-default text-left\">\n\n\t\t\t\n\t\t\t<div class=\"liner-continer\">\n\t\t\t\t<div class=\"woodmart-title-container title wd-fontsize-l\">Sam K | Embedded Systems Engineer<\/div> \n\t\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-7fc678a e-con-full e-flex e-con e-child\" data-id=\"7fc678a\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-0e97d99 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"0e97d99\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Sam K arbeitet an eingebetteten elektronischen Systemen mit Schwerpunkt auf Hardware-Design, PCB-Entwicklung, Firmware-Programmierung und Systemintegration. Er unterst\u00fctzt auch die Leistungsoptimierung und hilft bei der Umsetzung von Ideen f\u00fcr elektronische Produkte in zuverl\u00e4ssige, praxistaugliche L\u00f6sungen.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-092f191 elementor-widget elementor-widget-html\" data-id=\"092f191\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<div class=\"custom-btn-wrapper\">\r\n  <a href=\"https:\/\/pcbcool.com\/de\/author\/sam-k\/\" class=\"custom-btn\">Weitere Artikel von Sam K lesen \u2192<\/a>\r\n<\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Dieses Verkehrsampelprojekt, das auf einem Arduino Uno basiert, bildet einen realen Signalzyklus nach und zeigt, wie rote, gr\u00fcne und gelbe LEDs mit einfacher Timing-Logik gesteuert werden k\u00f6nnen.<\/p>","protected":false},"author":5,"featured_media":51477,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Arduino Uno-Based Traffic Light Project | PCBCool","description":"Dieses Verkehrsampelprojekt, das auf einem Arduino Uno basiert, bildet einen realen Signalzyklus nach und zeigt, wie rote, gr\u00fcne und gelbe LEDs mit einfacher Timing-Logik gesteuert werden k\u00f6nnen."},"footnotes":""},"categories":[113],"tags":[122],"post_folder":[],"class_list":["post-51454","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-guides","tag-pcb-design"],"_links":{"self":[{"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/posts\/51454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/comments?post=51454"}],"version-history":[{"count":5,"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/posts\/51454\/revisions"}],"predecessor-version":[{"id":51476,"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/posts\/51454\/revisions\/51476"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/media\/51477"}],"wp:attachment":[{"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/media?parent=51454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/categories?post=51454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/tags?post=51454"},{"taxonomy":"post_folder","embeddable":true,"href":"https:\/\/pcbcool.com\/de\/wp-json\/wp\/v2\/post_folder?post=51454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}