Ice Cube-Unread Email Counter
Digging into the vault of never fully documented projects, I found this and decided to make an Instructable on it. Doing this mostly by memory, I might have missed some things. Let me know if you see any errors. This is a project that displays how many unread email messages you have. It also displays the temperature. It wirelessly transmits your unread message count to a small acrylic cube. There is a piezo transducer on the lid of the box that allows you to switch between temperature and email by tapping on the lid. If you could vote for me in the epilog and battery powered contests, that would be great!
Transmitter Electronics
The transmitter is basically a FT232RL USB to UART bridge and the RCT-418-AS transmitter. The UART signal from the FT232 must be inverted before going to the transmitter because the UART "no data" state is high. If a high signal were going to the transmitter constantly, it would violate FCC rules because the RCT-418 would be transmitting constantly. This circuit is powered directly off the USB port of your computer. For correct VSWR the antenna MUST be 17cm. This is a 1/4 wavelength antenna for 418MHz.
Receiver Electronics
This portion of the project uses an ATmega328 microcontroller and an RCR-418-RP receiver to get the packet coming from the transmitter and displays the information in the packet on the 7 segment LED displays. It also has a temperature sensor. You can switch between the two "modes" (temperature sensor and email) by tapping the top of the box. The tap is detected by a piezo sensor. It is powered by 2 AA batteries via a MAX751 DC-DC step up power supply, or you can plug it into a USB port for power. Make a cable for the LED displays with a nine pin female connector and a nine pin male connector. Make sure that you glue down the USB connector on the main board with epoxy. The resistors you use for the LED displays will vary depending on what displays you use. You can use the formula: current=(supply voltage-voltage drop across diode)/resistance to find what value resistors you should use.
The Cube
Cut six pieces out of clear acrylic:
(2) 3 1/2x3 1/2 inch pieces, these are the sides
(2) 3x3 1/4 inch pieces, these are the other sides
(1) 3x3 1/2 inch piece, this is the top
(1) 3x3 inch piece, this is the bottom
Glue all the pieces together as shown in the picture. I was originally going to make a clear box but I scratched the acrylic a lot while I was cutting it so I decided to frost the acrylic. You can do this easily with super-fine grit sand paper. Make a window in the acrylic by taping part of a side of the box before sandpapering.
(2) 3 1/2x3 1/2 inch pieces, these are the sides
(2) 3x3 1/4 inch pieces, these are the other sides
(1) 3x3 1/2 inch piece, this is the top
(1) 3x3 inch piece, this is the bottom
Glue all the pieces together as shown in the picture. I was originally going to make a clear box but I scratched the acrylic a lot while I was cutting it so I decided to frost the acrylic. You can do this easily with super-fine grit sand paper. Make a window in the acrylic by taping part of a side of the box before sandpapering.
Code-Receiver Side
Here is the code for the ATmega328. You will need AVR Libc to compile it (cd to the directory and type make). Plug in your serial port dongle. Program it into the microcontroller using AVRDUDE. Under Linux the command for programming the microcontroller will be like this if you are using the AVR-PG1B programmer:
sudo avrdude -c ponyser -p m328p -P /dev/ttyS0 -e -U flash:w:main.hex:i
sudo avrdude -c ponyser -p m328p -P /dev/ttyS0 -e -U flash:w:main.hex:i
Code-Transmitter Side
This is a simple python program that gets how many unread email messages you have, connects to the FT232RL chip using pyserial, and sends it a series of messages to "open up" the receiver before sending the unread email count. For windows users, line 9 would look something like this:
ser = serial.Serial('\\.\COM0', 4800, timeout=1)
Linux users would use something like this:
ser = serial.Serial(/dev/ttyUSB0', 4800, timeout=1)
You might need to change COM0 to COM1 or COM2, likewise ttyUSB0 might need to be changed to ttyUSB1. It is a rather crude program, but it does work. In the file, replace mypassword with the password to your email account, and replace hackersworkbench0@gmail.com with your email address. The program does not update the display constantly.
ser = serial.Serial('\\.\COM0', 4800, timeout=1)
Linux users would use something like this:
ser = serial.Serial(/dev/ttyUSB0', 4800, timeout=1)
You might need to change COM0 to COM1 or COM2, likewise ttyUSB0 might need to be changed to ttyUSB1. It is a rather crude program, but it does work. In the file, replace mypassword with the password to your email account, and replace hackersworkbench0@gmail.com with your email address. The program does not update the display constantly.
Downloads
Stuff Everything Inside the Box!
Stuff everything inside the box, gluing the piezo transducer to the lid and glue the main microcontroller board into the box, letting the USB connector stick out through a hole cut in the back. Also, glue the displays into the correct position, using acrylic spacers. Plug in your transmitter, run the python program, and have fun!