Life Clock
Clock with Internet synced LCD time and date display, and touch screen display used for weather but functionality can be expanded.
The Display Setup
The Display Setup¶
The display setup is the outward facing, interactive part of Life Clock. It comprises of the mbed controller receiving data from the wifi module, which it then outputs onto an LCD time and date display, and the weather which it outputs onto a 320x240 touch panel.
The LCD Display¶
The first stage we will link up is the LCD display, the module to display the time and the date. To do this we need to ensure the wiring to the mbed is done correctly, and following this we can run some test code to check we have completed this.
Wiring the LCD Display¶
The pins on the LCD display count from 1 to 16 (as we can see on the rear of the device), and we will be using pins 1-6 and 11-14. The pins 1-6 should be linked to the mbed using the following table:
LCD Screen | FRDM-KL25Z |
---|---|
Pin 1 | 0V |
Pin 2 | 3v3 |
Pin 3 | 0V (1K resistor in series) |
Pin 4 | PTC7 |
Pin 5 | 0V |
Pin 6 | PTC0 |
Pin 11 | PTD4 |
Pin 12 | PTA12 |
Pin 13 | PTC 5 |
Pin 14 | PTC6 |
Important Check
Try this on bread board first to ensure you understand how the wiring is setup. You should be using solid core wires.
When you've wired to the copper board, make sure to test the system and resolve any issues.
The main difficulties faced in this part of the project originated from issues with the soldering, and correctly mapping each pin on the LCD to the mbed. The best advice would be to use different coloured wires for each output/input, and taking time to follow the pin arrangement in the table as closely as possible.
Testing the LCD Display¶
The code at the end of this section can be used to test the output of the display, if it is wired correctly you should see:
Time 12:34 Date 22/5/17
To access this code click the import program button on the right hand side, it should then import into your mbed library. From here, ensure the mbed is plugged in, compile the code, and save to the mbed. A reset on the circuit should now display the time and date as above.
Import programThe LCD Display
Test code for the LCD display, should output sample date and time.
Below is a picture of the working device, this should be where you aim for as your first major step.
The Touch Display¶
The touch display is used to display the weather data taken from the Internet (which hopefully isn't rain), along side a small graphic. To test this we must again take great care with the wiring, and following this can run the test code.
Wiring the Touch Display¶
The pins on the touch screen are helpfully labelled and should be wired up according to the following table:
Touch Screen | FRDM-KL25Z |
---|---|
LEDK | 0v |
LEDA | 5V (62Ω resistor in series) |
IM0 | 0V |
IM1 | 3v3 |
IM2 | 3v3 |
IM3 | 3v3 |
RST | PTD0 |
GND | 0V |
GND | 0V |
GND | 0V |
SDO | PTD3 |
SDI | PTD2 |
WR | PTA13 |
RS | PTD1 |
CS | PTD5 |
3.3V | 3v3 |
Important Check
Try this on bread board first to ensure you understand how the wiring is setup. You should be using solid core wires.
This one is more complicated than the LCD so take great care, especially when soldering the pin array.
The main issues faced with the touch screen involved sifting through the sample code to find what we need, preforming solder connections to the board, and ensuring all the wires mapped correctly.
As above, different colour wires proved much easier to use, and soldering just need time and care. The code provided will give a good starting point, but we be modified to produce more complex displays. When doing this again ensure you test at every point, and take care to save versions at each working stage so you can revert if necessary.
Testing the Touch Display¶
To access this code click the import program button on the right hand side, it should then import into your mbed library. From here, ensure the mbed is plugged in, compile the code, and save to the mbed. A reset on the circuit should now display the number 12 near the middle of the screen.
Import programThe Touch Display
Test code for the touch display, should output the number 12.
The Complete Display¶
By this point everything should be wired up correctly and functioning independently. With this code we bring the two displays under the same code control, and add the sample weather functionality.
Import programThe Complete Display
Both displays functioning independently, we will use this program to bring them both into the same code.
This should output the date and time as before, alongside the sample weather '27C', 'Oxford', and a picture of the sun.
Once you've reached this point the displays should both be working together, and are ready to add any other functionality.