Walk This Way: Pedestrian Traffic Light Status Indicator

Traffic Sign Status Indicator

A recent Slashdot post about Weird Stuff Warehouse reminded me that they carry cheap pedestrian traffic lights. I’d been meaning to pick one up to use as a completely overkill status indicator at work.  I managed to get this one for $10. It is a GE PS7-CFC1-01A that uses LEDs and looks new, but was presumably dumped by the original owner because it is a basic stop/go light without a countdown timer or accessibility features.

Dual Power Supplies

There were three mystery wires coming out of the back to interface it, so I cracked it open to see what was inside. The stop hand and walk person have independent AC-DC power supplies. Both halves share the white neutral wire, while each has a live wire of its own. The idea is to have the common line always connected to neutral while switching the hot line to whichever half you want lit up. Note that there is some additional circuitry on the right and an optoisolator connecting the halves. I believe this sign was designed such that if you attempt to power on both halves simultaneously, it will fail safe and light only the stop half.

Traffic Sign Relay

People often get their hearts broken on Valentine’s Day. Frying mine by playing with 120v AC is one way to do that. Kidding. Household AC is fine to tinker with as long as you’re careful. I built the circuit from the Arduino Relay guide to do the switching. I picked up a SPDT 5v power relay to make it easy to run off of the Arduino. The transistor is still necessary because the AVR can’t drive the 100+mA the relay needs to switch itself. I used an ATX power supply socket for convenience, rather than cutting a cable and using that. The neutral line from the socket is soldered to the neutral line on the sign. Each of the hot lines from the sign is connected to one of the relay throw positions, while the hot line from the socket is connected to the relay pole. Thus, toggling a pin high or low on the Arduino will flip the hot line from one half to the other, powering either the stop or go sign on. The project in total cost less than $20. It probably would have been under $15, but Radioshack is the only electronics store open on Sundays.

The code on the Arduino end is pretty simple. It just reads a character off the serial port and flips the relay one way or the other.

#define RELAY_PIN 13
bool state;
 
void setup()
{
  Serial.begin(9600);
  state = LOW;
  pinMode(RELAY_PIN, OUTPUT);
  digitalWrite(RELAY_PIN, state);
}
 
void loop()
{
  if (Serial.available()) {
    byte in = Serial.read();
    if (in == '0') {
      state = LOW;
      Serial.println("Switching relay to Stop.");
    } else if (in == '1') {
      state = HIGH;
      Serial.println("Switching relay to Go.");
    }
    digitalWrite(RELAY_PIN, state);
  }
}

The computer end can be whatever you want it to be. For example, in Python, you can use pySerial as follows.

>>> import serial
>>> sign = serial.Serial('/dev/ttyUSB0',9600)
>>> sign.write('0')
>>> sign.write('1')
1 Comment on Walk This Way: Pedestrian Traffic Light Status Indicator