Projects with a traffic light module
18 Mokxi projects use a traffic light module (5 beginner, 11 intermediate and 2 advanced). They run on Arduino Uno and Raspberry Pi boards. Here are all of them, from “Crosswalk” to “Merge jam”. Each card says what the project does, the board and parts it needs and its level, and Open in the simulator runs it in your browser in one click, with no account.
How to pick your first one
- Start with “Traffic lights with gpiozero”, a beginner project that needs a traffic light module and a push button.
- Arduino Uno runs 17 of them and Raspberry Pi 1. Start on the board you have, or on an Arduino Uno if you are buying one.
- The parts used most here are the I2C LCD (9 projects), the piezo speaker (7) and the push button (7). With those on hand, most of this list is open to you.
- Before you build one on a real bench, open the traffic light module part page for its pins and what each one does.
18 projects ready to run

Crosswalk
A traffic light module runs green, yellow and red on its own, and a button asks for the walk signal sooner; a piezo beeps while it is safe to cross.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, push button, piezo speaker
- Level
- Beginner

Traffic lights with gpiozero
gpiozero TrafficLights and a Button on a Raspberry Pi 4: press the button and the lights go amber, red for crossing, red and amber, then green again.
- Board
- Raspberry Pi 4 Model B
- Parts
- Traffic light module, push button
- Level
- Beginner

Battery level indicator
An 18650 cell straight into A0: its voltage and charge in percent on a 16x2 I2C LCD, and a green, yellow or blinking red light as it runs down.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, battery: AA, I2C LCD
- Level
- Beginner

Gas leak detector with an MQ-2
An MQ-2 on A0 waits out its warm-up, then shows the gas level on a 16x2 I2C LCD and a traffic light, and a buzzer beeps when LPG passes the limit.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, buzzer, MQ-2 gas sensor, I2C LCD
- Level
- Beginner

Smart dustbin
Smart dustbin on an Arduino: an ultrasonic sensor sees a hand and a servo opens the lid.
- Board
- Arduino Uno R3
- Parts
- HC-SR04 ultrasonic sensor, piezo speaker, traffic light module, servo motor
- Level
- Beginner

Fingerprint door lock
An optical fingerprint sensor checks the finger on its glass: an enrolled one swings a servo latch open for three seconds.
- Board
- Arduino Uno R3
- Parts
- Fingerprint sensor, traffic light module, servo motor
- Level
- Intermediate

Breathalyzer with an MQ-3
An MQ-3 alcohol sensor calibrated in clean air with MQUnifiedsensor.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, alcohol sensor, I2C LCD
- Level
- Intermediate

Car wash
Drive a car up to the sensor and press START: it rinses, soaps, brushes, rinses and dries on a timeline.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, two-channel relay board, solenoid, mini water pump, MX1508 dual motor driver, +7 more
- Level
- Intermediate

Zombie tripwire
An ultrasonic tripwire across a corridor: every walker is counted on a display, a traffic light rises from green to red.
- Board
- Arduino Uno R3
- Parts
- HC-SR04 ultrasonic sensor, piezo speaker, traffic light module, TM1637 four-digit display
- Level
- Intermediate

Light curtain
Two E18-D80NK beams guard a servo press: start works only with the beams clear.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, servo motor, buzzer, slide switch, arcade button, +2 more
- Level
- Intermediate

Find the emergency broadcast
Turn a knob across the FM band to find a hidden station: the static fades and a traffic light warms from red to green as you close in.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, TM1637 four-digit display, piezo speaker, potentiometer
- Level
- Intermediate

Tire pressure check station
An MPX5700 gauge pressure sensor on a shop air chuck, auto-zeroed at power up: the tire in psi, kPa and bar on a 20x4 LCD.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, pressure sensor, push button, buzzer, 20x4 I2C LCD
- Level
- Intermediate

Bunker battery gauge
An INA219 measures a battery under load.
- Board
- Arduino Uno R3
- Parts
- Battery: AA, INA219 current monitor, resistor, piezo speaker, traffic light module
- Level
- Intermediate

Reject station
A quality check that tracks each part: an HC-SR04 measures the part's height at the gate.
- Board
- Arduino Uno R3
- Parts
- Servo motor, traffic light module, two-channel relay board, DC motor, alarm siren, +3 more
- Level
- Intermediate

Battery and alternator monitor
A car’s 12 V system through a protected divider on A0: rested charge, the lowest voltage of each start, and whether the alternator is charging.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, buzzer, bench power supply, I2C LCD, resistor, +1 more
- Level
- Intermediate

Bunker airlock interlock
Two servo doors that are never open together: press OUTSIDE or INSIDE and the airlock opens one door, purges with a beeper, then opens the other.
- Board
- Arduino Uno R3
- Parts
- Servo motor, traffic light module, piezo speaker, push button
- Level
- Intermediate

PLC ladder
A motor starter solved like a PLC: every scan reads all inputs into a table, solves the ladder rungs from it and writes the outputs at once.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, relay module, DC motor, push button, limit switch, +2 more
- Level
- Advanced

Merge jam
Two feeder conveyors take turns putting items onto one shared belt, counted by three E18-D80NK sensors.
- Board
- Arduino Uno R3
- Parts
- Traffic light module, E18-D80NK IR proximity switch, two-channel relay board, DC motor, push button, +1 more
- Level
- Advanced