📜 ⬆️ ⬇️

Display the weather forecast on the display.


Good day to all!

Previously, to see the weather forecast, I usually went to different meteorological sites, then with the advent of various widgets, I could find out the weather just by looking at the desktop. At the moment, I decided to make a small device with a screen on which the weather forecast from any site can be displayed. I think now is the most important to be aware of weather changes. Therefore I decided to publish the description of the device on a habr, someone can want to repeat this construction.


The device itself consists of two parts:
1. PC software
2. The device itself with firmware
In order to display weather information, I bought the display MT16S4 of MELT (http://melt.com.ru)
ATtiny2313 was chosen as a controller, it is just suitable for a small application, it has few conclusions, and at home I had it. I decided to connect my device to the PC via the COM port using the MAX232 chip - I will not talk about how it works - this has already been mentioned on Habré, and there are a lot of articles on the Internet on this topic. It is worth noting that in order for the controller to work without errors with the RS-232 interface, you must use a quartz resonator with a frequency of 7.3728 MHz (since the maximum frequency of this MC is 8 MHz).
The display must be connected to the controller in this way:
PB0 - A0
PB1 - R / W
PB2 - E
PB4 - DB4
PB5 - DB5
PB6 - DB6
PB7 - DB7
The pins of the DB0-DB3 display remain unconnected, because we use a 4-bit bus - so the microcontroller pins are saved.

I feed the whole circuit from the USB port.


The firmware for MK was written in CodeVision AVR, since it already has ready-made libraries for display (MELT display is compatible with the HD44780 controller)
MK receives data from a PC, processes the characters on duty and in accordance with them displays information on the display.
The program on the PC every hour reads information from the site gismeteo.ru
and sends the necessary data to the COM port. Weather information can be found on the day ahead
In the program itself there are settings for the connection speed and the port number to which we are going to connect, the “<<”, “>>” buttons allow you to display the forecast for different times of the day.
All options are saved in the ini file. The program can be minimized to tray and it will update the data itself for display. Also from the tray menu is available in which you can choose for what time of day the forecast will be displayed.
Initially, the program downloads data for Moscow, but you can also specify another city. To do this, follow the link informer.gismeteo.ru/getcode/xml.php?id=27612 - select the desired city, a link will be generated that you need to copy and paste into the ini-file in the “Town” line.

The forecast is displayed in the format:
line 1: date and day of the week
line 2: time of day and temperature
line 3: Clouds
row 4: Type of precipitation

Datasheet on display
Firmware sources
Sources of the program
PC software

That seems to be all. The device is already working the 3rd day and it suits me.
In the future, I want to attach a color screen, connect to USB and get a sort of real widget.

Good luck everyone!

Source: https://habr.com/ru/post/101215/

All Articles