Pins RC3, RC4 and RC5 are used for SPI communication. Pins RC6 and RC7 are used as TX and RX lines for serial communication. Dual driver/receiver MAX232 provides necessary voltage levels for serial communication between the PC and the client board. RB3 and RB4 pins act as CS lines for the ENC and EEPROM, respectively. Pin RB5 acts as reset line for ENC28J60. EEPROM 25LC256 is used for storing incoming weather data.
The client board should be connected to the Internet through Ethernet port of the modem or router.
Power supply. The client board circuit is powered by 5V and 3.3V supplies (refer Fig. 4). A 9V DC supply is fed to the 5V regulator 7805 (IC6). This 5V supply drives LM3940 (IC7) and the other circuit including PIC18F4685 microcontroller, LCD display and level shifter 74HCT125. LM3940 is a 5V to 3.3V converter. ENC28J60 is powered by the 3.3V supply. LED1 is used to indicate the presence of power in the circuit.
The host software is developed using Delphi language, which is simple to use and does not require DLL files like VB for running its application exe. The Delphi exe file can run on any windows platform. Delphi front panel view of the weather monitor is shown in Fig. 5.
The Setting button at the screen’s bottom is used to configure the COM port parameters such as port number and baud rate. The Open button opens the relevant COM port, sends City Name in the edit box window and character ‘S’ to the client board which initiates the start of the client program. The Show button is enabled only after all the processing is over; it enables the user to view the data in the Report List. If a query is sent for a city whose weather data is not available, the server sends ‘Unavailable’ message to the client. That information is passed on to the user by displaying the message through a pop-up window.
Free third-party COM port library, SDL component Report List library and Scroll Message library are used, which are freely available on the Internet for download. The incoming CSV data format from EEPROM via COM port is stored in a string array. Simple software routines are included in the Delphi program to extract individual weather data from the CSV format and displayed in Report List.
Reset button is used to reset the Delphi form. The user has to change the COM port number available in his PC and baud rate is fixed to 19200.
Construction and testing
An actual-size, double-side, solder-side PCB layout of the client-board is shown in Fig. 6, component-side track layout in Fig. 7 and the component layout in Fig. 8. An actual-size, single-side PCB layout for the power supply is shown in Fig. 9 and its component layout in Fig. 10.
Mount the components on the PCBs to save time and minimise assembly errors. Check proper connections before connecting the 5V and 3.3V supplies to the PCB at CON4 and CON5, respectively.
Download PCB Layout and Component Layout: Click Here
Download Source Code: Click Here
If your PC does not have a serial COM port, you can connect it to USB port by using a USB-to-serial converter. In that case, first you need to install appropriate driver in your PC. After connecting the client board to your PC, launch the weatherdisplay.exe Delphi program. A window screen will open up similar to the one shown in Fig. 5 with blank data columns.
In the display panel of this window click on the Setting button and choose the COM port. Note that your PC COM port baud rate should be 19200. Enter the city name in the edit box, for instance, Madurai. Now switch on the client board. The ‘TCP-Client’ message should appear on the LCD. Vary VR1 to adjust the contrast of the LCD to get clear visibility of the message.
Next connect one end of the Ethernet cable to the RJ45 connector in the client board and the other end to the Ethernet port of your broadband modem/router which has Internet connection. You need to configure your Internet connection in your PC from the control panel. You should disable wireless Internet connection. If Internet connection is successful, you will see the blinking of LED3 and LED4.
Now, click on Open button at the bottom of the screen. The IP address (192.168.0.102 in our case) should appear on the LCD. The Show button will be inactive first but after a few seconds it will get enabled and ‘Remote server connected’ message will appear at bottom of the screen. Upon clicking on the Show button weather data will get displayed in the report sheet as shown in Fig. 5.
At any time, if you face any problem in the circuit, refer Table II for troubleshooting.
Some other applications of this system could be:
1. Apart from the weather data one can get different types of weather analysis by sending relevant URL request to the server by referring to the full document available on the website.
2. It can be made into a portable system by interfacing it to a 10.2cm (4-inch) TFT colour LCD display and making it wireless using MR24WBOMA instead of ENC28J60
3. This design may be better than a backyard weather station because you receive accurate professional weather forecasts.
4. One can modify the design to connect with other data providers to display important data such as news headlines and stock market information.
The author, M. Kathiresan, is a retired sub-divisional engineer, mobile services, BSNL, Madurai, A. Robson Benjamin is an associate professor of physics at The American College, Madurai and C. Vijayan is an associate professor of physics at S. Vellaichamy Nadar College, Madurai. The authors thank worldweatheronline.com website moderators for providing free weather API for the project