Stop Go – using a walk sign to check your email


I saw this walk/don’t walk sign for 10 bucks on ebay and bought it right away. Forget family photos/diplomas or clocks on your wall this is what you need.

Hit the more photos link for full build instuctions

The sign I used has a model number of GE PS7-CFC1-01A
First of you need to build this relay circuit so you can flip between walk and don’t walk. The sign has three wires red white and brown. White is shared between walk and don’t walk so all you need to do is connect wires to either red or brown and white to light up each respective side. Thats where the relay circuit comes in. The relay needs more current then the arduino can supply so thats why we added a NPN transister. A diode was also added to protect the microprocessor from back EMF current. I got the diodes and relay from Newark and sparkfun: Diode, Relay

Note: the resistor is connected to pin 3 of the arduino. Sorry for not including it in the drawing

Make sure you follow proper safety procedures since you are dealing with AC. I actually blew my apartment fuse by accidentally letting two of the live wires touch…

The python code checks your email. All you need to do is make sure you have pyserial and feedparser modules installed. Then type in your port address for your arduino (ex. “COM5″ or “/dev/cu.usbserial-A6008jDJ”). Also fill in your gmail info and your set to go.

#Zunayed Ali
#deyanuz.com
#Gmail notifier
 
#feedparser module download it from http://www.feedparser.org/
# pySerial module also needed
import serial, feedparser, time
 
# store your serial port address
SERIALPORT = "/dev/cu.usbserial-A6008jDJ"
 
#open serial port
ser = serial.Serial(SERIALPORT, 9600)
 
loop = 1
prevCheck = 0
 
while loop > 0:
	#set variable to hold parsed xml data
	d = feedparser.parse('https://username:password@mail.google.com/mail/feed/atom')
 
	#statement just to get title
	print d.feed.title
 
	newMail = len(d['entries'])
 
	#delay x seconds
	time.sleep(10)
 
	if newMail > 0:
    		#write to the serial port
       		ser.write('M')
       		print " you got mail"
	else: ser.write('N')

Here is the arduino sketch that just reads the serial output from python and switches the relay

//Zunayed Ali
//Gmail notifier - deyanuz.com
 
int outPin = 3;
int mail = LOW;
int val;
 
void setup()
{
  pinMode(outPin, OUTPUT);
  Serial.begin(9600);
  Serial.flush();
}
 
void loop()
{
  if (Serial.available())
  {
    val = Serial.read();
    Serial.println(val);
    if (val == 'M') mail = HIGH;
    else if (val == 'N') mail = LOW;
  }
 
  digitalWrite(outPin, mail);
}