Skip to the content
PCBKitNew board
2 layers105.5 × 148 mmStopLight2, the printed circuit board in 3D

hardware and software for a stoplight controlled by a Raspberry Pi

Size
105.5 × 148 mm
Copper layers
2
Thickness
1.6 mm
Parts
37
Nets
59
Pads
184
Tracks, vias
197, 28
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
3 Sep 2020
Updated
28 Dec 2022

Overview

StopLight2 is an open-source printed circuit board by mikeblas, from the mikeblas/stoplight repository on GitHub. It is a 2-layer board of 105.5 × 148 mm with 37 parts on 59 nets, routed with 197 tracks and 28 vias.

It is built around the L7805, ULN2803A and FS20-600. Its parts include 8 diodes, 4 resistors, 4 fuses, 3 connectors and 3 switches.

Main components

3

README

README.md

stoplight

This project provides hardware and software for a stoplight controlled by a Raspberry Pi.

Context

In the late 1990s, I purchased a traffic signal from a curiosities shop. It's a full-scale signal, appropriate for "real" outdoor use; each lens is about 20cm in diameter, and it's a giant green beast. During the lockdowns in 2020, I finally found the time to get it working in a fun and useful way.

This project includes a printed circuit board design that hosts a Raspberry Pi Zero W and implements a mains-based power supply and switching circuits for each of the lamps in the signal. I chose the Pi Zero because it gets me onto the wireless network, and has enough computing power to do interesting things with the signal. With a little research, it should be possible to find a smaller board that has WiFi connectivity, but I already had an unused Pi Zero, so I just went with it.

The board further hosts a generic wireless remote control board built around the PT2272 receiver chip. The chip gives four latched outputs from a four-button key fob style RF remote. This remote can be used to control the stoplight.

And of course, the project includes software to make it do something.

Status

This project is "done enough" for now. All the features below are implemented, and the wish list features are not yet implemented.

Hardware Features

The hardware is done; amazingly, I didn't have to re-print the board and got it right on the first try. The only problem was using a 7805 regulator. The voltage drop made it run red hot, so I replaced it with a three-pin PC-based switching regulator, which works fine. The filter capacitor on the output of the supply wasn't adequate, so I increased it. That, of course, required a part with a bigger footprint so the mounting is a bit lumpy, but it works fine.

Software Features

The software implements several modes, selectable by the remote. First, we can turn the thing off:

  • Turn off the light; minimal processing, nothing illuminated.
  • Turn the light back on; whatever mode was active last resumes.

Then, we have one of a few modes active:

  • Traffic light. Red, green, yellow, in a realistically timed cycle.
  • Random single flash. Flash a single (selectable) lamp at a regular interval.
  • Random flash. Flash a randomly selected lamp one at a time.
  • Random flash. Flash each lamp at random intervals. This is "disco mode"!
  • Manual selection. Turn a lamp off or on, and it stays that way.

We mostly leave the light in disco mode, and it's fun to see it blinking away.

Wish List

I'd like to add a few more modes:

  • Clock. Flash lights to make a binary time-of-day clock.
  • Weather indicator. Show tomorrow's predicted weather (temperature and precipitation)
  • Stock market indicator. If the market is open, show the directional change in a particular index.

There's also a couple of interesting things that I'd like to add:

  • Mode memory. It would be great to have the system restore its mode when it starts up again after a reboot or power failure.
  • Monitoring. Anything I can monitor in my home network is monitored -- lots of SNMP collectors and some Influx scripts pull data in to Grafana. Adding
  • Web page. It would be cool to have a little web server to present a UI for changing modes, looking at statistics, and so on.
  • Mobile app. A web API would enable a mobile application for modes and stats, too.

Since the project is built and installed, then I'm not very motivated to work on these things. Maybe in the winter I'll get another Pi Zero and set it up so I can run the core on my bench, and get to work on those feature. The design has on-board LEDs for all of the outputs, so pretty much no support circuitry is necessary. I just need to build and populate one of my spare PC boards.

Project Layout

stoplightd is the stoplight daemon program. This is the controller that runs on the Pi (as I'm working on it)

proto are various fragments and scratch projects as I sort out GPIO, how the hardware works, and try out ideas.

pcb is the hardware project for KiCad.

Images

Installing KiCad just to take a peek is a big ask, so here are some links:

Dependencies

This project uses libdaemonize.

Parts

37
QtyValueFootprintReferences
5Conn_01x01_MaleConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalTP0, TP1, TP2, TP3, TP5
41N4002Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1, D2, D3, D4
4220Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR14, R15, R16, R19
4FuseFuse:Fuseholder_Cylinder-6.3x32mm_Schurter_0031-8002_Horizontal_OpenF1, F2, F3, F4
4LEDLED_THT:LED_D5.0mmD11, D12, D13, D19
4MountingHoleMountingHole:MountingHole_3.2mm_M3_Pad_ViaH1, H2, H3, H4
3G5LE-14_DC5StopLight2:G5LE-14-DC5K1, K2, K3
21935336StopLight1:1935336J1, J2
1220uF 50vCapacitor_THT:CP_Axial_L20.0mm_D10.0mm_P26.00mm_HorizontalC2
13.3uFCapacitor_THT:CP_Radial_D5.0mm_P2.00mmC1
1ADA3708StopLight1:ADA3708_RPI-ZEROA1
1FS20-600StopLight1:XFMR_FS20-600T1
1L7805Package_TO_SOT_THT:TO-220-3_VerticalU2
1Remote HeaderConnector_PinHeader_2.54mm:PinHeader_1x07_P2.54mm_VerticalJ3
1ULN2803APackage_DIP:DIP-18_W7.62mmU1

Questions

How big is the StopLight2 PCB?

It measures 105.5 × 148 mm and has 2 copper layers, 1.6 mm thick.

What parts does the StopLight2 use?

37 parts, built around the L7805, ULN2803A and FS20-600. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the StopLight2 KiCad files?

From the mikeblas/stoplight repository on GitHub, at the commit this page was made from: the board is pcb/StopLight2/StopLight2.kicad_pcb and its schematic pcb/StopLight4/StopLight4.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the StopLight2 design in my own project?

Its repository states no licence, so its author keeps all rights: ask mikeblas before reusing the design.

More from mikeblas/stoplight

1
  • 2 layers111 × 173 mmStopLight1, the printed circuit board in 3D

    StopLight1

    mikeblas/stoplight

    hardware and software for a stoplight controlled by a Raspberry Pi

    44 parts7

Similar boards

  • 2 layers100 × 120.5 mmStopLight4, the printed circuit board in 3D

    StopLight4

    kitspace-test-repos/kicad6-file-collection

    59 partsMIT
  • 2 layers193.5 × 95 mmRS485 antenna switch v1.2, the printed circuit board in 3D

    RS485 antenna switch v1.2

    EI9SP/Remote-Antenna-Switch

    Four to one Remote Antenna Switch, Full duplex RS485

    90 parts1
  • 4 layers120 × 120 mmSEM4, the printed circuit board in 3D

    SEM4

    AdityaSamani/PCB-Project

    ATmega328P Dev Board

    37 parts
  • 2 layers120 × 120 mmArnavipdtask1, the printed circuit board in 3D

    Arnavipdtask1

    arnav1609/PCBDESIGNING

    47 parts
  • 2 layers82.5 × 93 mmIpd task1, the printed circuit board in 3D

    Ipd task1

    Dharini-V/Dharini_PCB_task1_ipd

    37 parts
  • 2 layers120.5 × 120.5 mmIPD Task1, the printed circuit board in 3D

    IPD Task1

    Ebrahim2101/IPD-AVR-Board

    AVR Atmega328p chip schematic and pcb design

    37 parts
  • 2 layers90 × 120 mmIPD Task 1, the printed circuit board in 3D

    IPD Task 1

    Executableexe/AVR-ATmega328P-Minimum-System-Design

    PCB design using KiKad for the submission of task 1

    37 parts