Intro: Binary Wall Clock
Building a Intel Edison based binary wall clock with WiFi NTP time synchronization.
On the Intel Roadshow in Munich 2014 we tried to build a smart binary wall clock. A total number of 33 LED tell you the current date (YYMD) and time (m-h). A great tool to tell you the time and confuse non-binary people (there are only 10 kind of people in the world... ;) ).
We used a Intel Edison as a base platform - its internet connectivity can automatically update if you move to another country or it just turned from winter to summer time. And you can easily add much more functions to it like tracking your room temperature while you`re in holidays - and it still looks just like a clock. It was build in a short time and we used the party we had with us. I might be heavily improved and is far away from perfect - but perfectness is not the goal of a hacklaton!
We added a video, so you can get a impression how its build!
Step 1: The Electronics
We need a total number of 33 Outputs to control the 33 LEDs. Since its very unhandy to use 33 GPIO of the Intel Edison, we used a I2C port expander (MCP23008 - datasheet at : http://ww1.microchip.com/downloads/en/DeviceDoc/21 ) . It was also a nice opportunity to test the I2C functionality of the Intel Edison. We connected 5 of those IC on a breadboard with a 3.3V power supply. There are 3 address pins (A0,A1,A2) to give every IC a unique i2c address. After that connect the 2 wire from the I2C bus with 2 cables (SDA and SCL) to the Intel Edison. Its very simple if you use the Intel Galileo I/O board, witch you can plug into the Edison board to connect to the I2C bus (there a labels on the board so you dont have to look into the datasheets).
Wire the LEDs on the board according to the schematics shown below. A resistor with 120Ohm is connected in series to every LED. Connect all anodes of the LED to a switching N-MOSFET with a current rating >1A and capable being driven by 3.3V. The Gate is connected to a PWM pin of the Intel Edison. This transistor is used to change the brightness of all LEDs. If you want to understand why please read :
It enables adjusting the brightness to the lighting environments. You can also just connect all LEDS to ground if you don't need that feature.
A potentiometer is connected to a AD converter pin for brightness control ("A1" is the label on the I/O board).
Step 2: The Software
We used the Adurino IDE to program the clock. We
1) Initialize WiFi connection
2) Initialize the MCP23008 - set all pins as "output" by writing the address of a selected MCP23008, the output_dir register and 0xff (all pins as outputs) to the I2C bus.
II) It performs three tasks in a simple loop:
1) get new time over internet
2) Update LED configuration according to the current time. Every MCP23008 has a unique I2C address according to the address pins (A0,A1,A2). To change the output of one MCP23008 you need the address of the selected MCP23008, the internal address of the output register (0x05), and the desired GPIO output configuration (8bit for 8 outputs).
3) Fetch the setpoint of the potentiometer and change the value for the hardware PWM accordingly
4) Let Edison sleep for a bitt less than 1 second OR... .
5) Add lots of "Internet of things" magic here - like reading a temperature sensor an store it in the cloud ;).