กลับไปหน้ารวมไฟล์
synchronized-traffic-lights-e81db6-en.md

Haven't expanded beyond a starter kit (LEDs, resistors, push buttons, photo resistors) yet, had completed all of the starters included in the inventr.io PDF and wanted to challenge myself a bit more. I used the Traffic Lights example as a rough template and wrote it entirely. This is the first project I wrote from a blank Arduino template!

This would be much more visually appealing on 2 seprate breadboards I think!

I am sure the code could be cleaned up with some arrays or something I will get there eventually!

EXPANDED TECHNICAL DETAILS

Distributed State-Machine Logic

This foundational project replicates the complex synchronization found in multi-intersection urban traffic control systems.

  • Parallel Sequential Loops: The Arduino manages two or more sets of R/G/Y LEDs. The firmware uses an advanced millis() based state machine that accounts for "Green-Wave" timing, where both lights are coordinated to improve the flow of simulated traffic.
  • Manual Pedestrian Interrupt: Features a "Crosswalk" button. When pressed, the Arduino safely interrupts the current cycle, ensuring a 2-second "All-Red" buffer before allowing the pedestrian to cross.

Visualization

  • 10mm Industrial Indicator LEDs: Uses high-brightness LEDs that mimic real-world traffic signals, with the firmware implementing a "Fade-In/Out" effect on the yellow light for added realism.

ข้อมูล Frontmatter ดั้งเดิม

title: "Synchronized Traffic Lights"
description: "My simple spin on a Traffic Lights example, I am sure the code could be better but works as intended!"
author: "distractedmaker"
category: ""
tags:
  - "lights"
views: 4301
likes: 1
price: 1499
difficulty: "Easy"
components:
  - "6x Resistor 220 ohm"
  - "2x 5 mm LED: Yellow"
  - "1x Arduino UNO"
  - "1x Jumper wires (generic)"
  - "1x Solderless Breadboard Half Size"
  - "2x 5 mm LED: Green"
  - "2x 5 mm LED: Red"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://projects.arduinocontent.cc/12125dbb-4325-4209-bfe1-87d52fbe993d.ino"
  - "https://projects.arduinocontent.cc/12125dbb-4325-4209-bfe1-87d52fbe993d.ino"
documentationLinks: []
passwordHash: "ba3409cd11951a1226a5add3e920025e6a7dde1744ec8eda5bd89161151fb5f0"
encryptedPayload: "U2FsdGVkX19EoTGrE1BuLqT3fVSrZ8C0UPmVibBHuUPV4iwhug1sHXxBVlsyaR2ieDv6YMR/O6SgcP5J1bSB2j4zCzGktlXYATrX6sURJzs="
seoDescription: "Learn how to build Synchronized Traffic Lights with Arduino. A simple, functional project for beginners."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/synchronized-traffic-lights-e81db6_cover.jpg"
lang: "en"