This is a project will get the weather from http://openweathermap.org and display it to an LCD screen. Before starting you will need to obtain from the above website a free api key.
This is fully autonomous but does need to connect to a WiFi access point. It was actually 24.94 that day, ah well.
- 20x4 LCD
- Stripboard about 25 strips x 29 holes
- Voltage regulator (optional)
- BV507 with WiFi *
- Zip file containing project resources
* Any ByPic part can be used it is just that the BV507 has 'built in' (on the PCB) WiFi so it is most convenient.
The voltage regulator is optional as it can be supplied form a regulated 5V supply, similar to the Wall wart USB type.
To make things easier, a stripboard was used and designed on VEECAD the paid for version but there is a free version as well. There are lots of stripboard design software out there but this one, although not really intuitive is the best. You can print out to a scale of 1:1 and stick that over the stripboard to reduce mistakes.
It is quite possible to simply wire on a bread board but to make things a bit neater a stripboard was used.
Use this pdf file and print out at 1:1 on sticky back paper, then stick it on the actual stripboard, the blue crosses are cuts in the stripboard track which can be made with a stripboard cutter or a drill bit.
The green lines are wires that connect the strips together.
Connection to the LCD is via a 16 pin socket, but of course wires will do. This is a bit awkward as the socket has to be soldered on the same side.
When finished apply power and check the voltage on the appropriate pins before plugging in any components.
The WiFi is provided by a ESP8266 programmed with ByVac serial bridge. If using a ByVac product then this will be on the ESP8266 already however if not the firmware is freely available.
When programmed, with the power on, connect GPIO0 to ground for 10 seconds. This will make the built in http server and turn the ESP8266 into an access point. Then see the details of connecting to your own access point.
Start the IDE, copy the link below into the IDE.
constant WKEY$ "your key goes here" // obtain a key from open weather map
constant LOCATION$ "London" // your location goes here
Locations are obtained from here http://bulk.openweathermap.org/sample/
UART1 or UART2
The ESP8266 can be connected to either UART. This project is really designed for the ESP to be connected to UART1
If different pins are used for the LCD then change them in main().
How it Works
The LCD is driven by the library LCD driver, the pins used for the LCD are set up in main() and so other pins can be used if required, just change the top of that function.
The data for the display is obtained from http://openweathermap.org/api. If you put this that url in a a browser address bar:
example: http://api.openweathermap.org/data/2.5/weather?q=YOURLOCATION,uk&appid=YOUR KEY
you will see JSON formatted text output, this data is used by the weather.bas program to display the weather data. Only a small subset of the available data is used.
There is a task running every minute that updates the date and time which is obtained from google. A counter is also set and every 15 counts the weather data is obtained.
NOTE: Corrections not required for new layout
The BV507 has solder jumpers to select UART