This post documents my BEng (Hons) Electronic Engineering final year project in 2002. This project developed a web-based weather station using a relatively new technology at the time called the Tiny InterNet Interface (TINI). The TINI board was connected to an external interface board which in turn connected to the individual weather station sensors. The data from the sensors was collected periodically and stored by the TINI machine. Users could log onto TINI via the weather station webpage and retrieve the latest sensor data. The full weather station is shown below:
The weather station was capable of monitoring the following information:
- Sun Light
- Wind Direction
- Wind Speed
- Rain Fall
The weather station sensors and the external interface board were designed and developed as part of the project and were only ever intended to be simulated sensors for the project rather than to be used in a real life weather station scenario.
The sensors for the weather station and the external interface board were designed to allow 5 different sensors to be monitored through the same Analogue to Digital Converter (ADC). The circuit was based around an 8-1 channel multiplexer. The multiplex channel select was controlled via the digital outputs from the Tutor board. Details of the design and functionality of the 5 sensors are shown below.
The temperature sensor weather station was a very simple device. It was a LM335 precision temperature sensor package. This was a 2 terminal Zener diode which has a breakdown voltage directly proportional to the absolute temperature at 10mV/oK. So at 0oC (273oK) the output voltage is 2.73v using the circuit shown below.
The LM335 sensor was calibrated according to the schematic above using a 10KΩ potentiometer. The LM335 was purchased for £1.49.
The sensor to measure the level of light for this weather station was a simple Light Dependant Resistor (LDR). As the name suggests the resistance across the terminals varies depending of the amount of light it receives. It had a resistance of 2M when dark (0 Lux) and a resistance of 33K at 10 Lux. Lux is the measurement of the intensity of light. Originally one Lux was the light falling on a surface one foot away from a “candle”. Now it is a carefully calibrated light source. With very bright light the resistance of the LDR becomes insignificant. The LDR was purchased for £0.99.
The wind direction sensor for this weather station was quite a crude solution which was only suitable for demonstration purposes. A standard 100K rotary potentiometer was purchased and taken apart to remove the stop inside. This allows the spindle to rotate all the way round. Before the stop was removed the degree of rotation was limited to about 350deg. However, removing the stop does mean that there is about a 10deg section that has zero resistance. This section was simply set to be the value for North. There are rotary position sensors that are designed for this type of problem but unfortunately even the cheapest cost about £15. Due to budget restraints the potentiometer option was chosen.
In this current state it could never read the wind direction because it doesnt even have a vain to be moved with the wind. The main thing that this sensor shows is the concept. Users can demonstrate the functionality by simply turning the potentiometer.
The wind speed sensor for the weather staiton was a bit more complicated to create than the previous ones. An electronic signal was needed as the output from a rotating set of plastic cups. These cups needed to rotate when placed in a wind stream. A search on the internet for “home made anemometer” was carried out and a link to the www.otherpower.com website was found. This website explained in detail how to make your own anemometer.
There were two different options both very similar in approach. The first was to use a simple DC motor as a voltage generator. This would produce an output voltage linear to the speed that the spindle was rotating at. However, a DC motor looses its linearity at higher speeds and the brushes inside a DC motor eventually wear out. The other alternative (which is a far better solution) is to use a brushless stepper motor.
A stepper motor retains linearity at high speeds because the voltage can also be compared to the rotational frequency. A stepper motor could typically have 24 windings to provide a step size of 15deg. When being turned manually, it will produce 24 pulses for every rotation. This pulse count can be read as a frequency and converted into speed. This makes the stepper motor far more accurate and linear. Also a stepper motor does not use brushes like DC motors, therefore they are far more durable and less likely to wear out.
For this project it was decided to use a simple 6v DC motor for demonstration purposes. Although this was the less accurate and less durable option it worked out to be the cheaper one. As mentioned before, the main aim of this project is to provide a demonstration tool for the TINI board, so the accuracy of the equipment is not really the main priority. Equipment accuracy and reliability can be looked at as a future development. The picture below shows the plastic cup construction, mounted on top of a 6v DC motor.
All of the parts for this sensor were sourced from various different resources, so this sensor did not actually cost anything (other than time) to build.
This was the most complex and time consuming sensor to design and build for the weather station. A method was needed to measure electronically the amount of rainfall over a period of time. The most common way to measure the amount of rainfall without electronics is by using a funnel and a container with a measurement scale up the side. This can be converted to an electronic scale by using the natural conduction characteristics of water.
For this rain gauge you have one open ended wire on the bottom of the container that is linked to ground. You then need several more open ended wires that are positioned up the side of the container. All of these are linked to a low voltage DC supply (5v) through Light Emitting Diodes (LEDs). All you do then is add a teaspoon of salt to the bottom of the glass and wait for rain. As the container fills up and reaches the first wire the water conducts electricity and switches the first LED on. As the water gets deeper more LEDs turn on giving you an indication of how full the container is. The salt in the bottom dissolves in the water and helps to conduct the electricity. These outputs could be fed into a controller instead of using LEDs for the display.
However there are some major draw backs to this approach. The main problem is that at the end of every day the water has to be emptied from the container by hand and more salt added for the next day. This is hardly a practical solution. Another approach is a self emptying method designed around a balanced spoon. The idea is to guide the rain water onto the spoon using a funnel. When the spoon gets full enough the spoon tips off balance and empties the spoon onto the ground. Therefore if you know the volume of the spoon and the size of the capture area (the funnel) you can work out the amount of rainfall by the number of times the spoon tips.
To record this value a small magnet was attached to the back of the spoon. When in its resting position the magnet holds a reed switch closed and every time the spoon tips the circuit gets broken. All you have to do is record the amount of times the circuit gets broken and you have a rainfall value.
This rain gauge has a two tiered effect because for the purpose of demonstration, the water can not simply drop onto the floor. The emptied water is guided into a funnel and the water can be collected in a container placed beneath. It took several attempts before the correct shape for the spoon was found. The cup of the spoon used here is quite long; this length helps to completely empty the spoon as it tips. The water collects towards the back of the spoon to start with and gradually creeps forward as it fills. At the point that the spoon becomes unbalanced all of the water rushes forward to the front of the spoon which off balances the spoon even more, thus in one swift action completely emptying the spoon.
Weather Station TINI Hardware
All of the outputs from the weather sensors (apart from the rain sensor) were connected directly to an 8-1 multiplexer. An 8 input multiplexer was not needed (a 4 input would have been sufficient) but this at least left room for expansion at a later date. The channel select pins for the multiplexer were controlled by the digital outputs from the TINI board. These were joined to the multiplexer board via ribbon cables. These cables also provide power to the board. The rain sensor circuit linked directly to the digital input port on the TINI board via ribbon cables.
Tiny InterNet Interface (TINI) was a platform developed by Dallas Semiconductorto provide system designers and software developers with a simple, flexible and cost effective means to design a wide variety of hardware devices able to connect directly to corporate and home networks. The platform was a combination of a small but powerful chipset and a JavaTM-programmable runtime environment. The chipset provided processing, control, device-level communication and networking capabilities. The features of the underlying hardware were exposed to the software developer through a set of Java application programming interfaces.
The board pictured below is a 1Mb version of the TINI board.
This project investigated the capability of TINI by using an interface board called the Tutor. This board was developed by Taylec who are a Bristol based electronics company that specialise in hardware support for the TINI platform. The Tutor board is shown below:
This board had the following functionality:
- Dual serial communications ports (RS232);
- Ethernet 10/100Base-T port;
- 1-wire interface;
- 2 line LCD screen;
- 8-bit digital input via onboard dipswitches or header cable;
- 8-bit digital output via onboard LEDs or header cable;
- 8-bit Analogue to Digital Converter (ADC);
- 8-bit Digital to Analogue Converter (DAC);
- Interrupt and reset switches;
- Onboard Light Dependant Resistor (LDR) for analogue input;
- Control Area Network (CAN) interface;
- I2C bus (A two-wire serial bus used for control, diagnostic and power management).
The following sections describe how the TINI board was configured for the project. It describes all of the information and equipment that was required and some problems to that were experineced.
Here is a list of all the equipment that was used for this project:
- TINI SIMM Board
- Taylec Tutor Interface Board
- 9-12v DC 500mA Power Supply
- Crossover Ethernet Cable
- Straight Thro Serial Cable
- Ethernet Equipped Windows PC
The TINI SIMM board was inserted into the Tutor board according to the Taylec instructions. The serial cable was connected from a COM port on the computer to Serial 0 on the Tutor interface board. The Ethernet cable was connected from the computer to the Ethernet port on the Tutor board. The Tutor board was powered up, the lights on the TINI board turned on to show the board has power. It was now ready to have the software configured.
Weather Station Software
The following software was downloaded and used for the project:
- Java SDK version 1.3.1
- Java Communications API version 2.0
- TINI SDK version 1.02d
The following approach was used for the software setup:
- Install Java 2 SDK to the default directory.
- Copy files from the commapi folder (Java Communications API) to the following:
- win32com.dll to c:\jdk1.3.1_02\jre\bin
- comm.jar to c:\jdk1.3.1_02\jre\lib\ext
- javax.comm.properties to c:\jdk1.3.1_02\jre\lib
- Extract TINI SDK to C:\Tini1.02Download the batch file for install
- Run batch file to run JavaKit
Alternatively there was the option to download the jdk1.3 setup program which automatically does the above for you.
A batch file was used to run JavaKit which simply executed the following command line in DOS:
C:\jdk1.2.2\bin\java -classpath C:\tini1.02\bin\tini.jar; JavaKit
You can also set the PATH and CLASSPATH environment variables on your PC to make the command line simply:
The DOS command “set PATH” allows users to specify a path for an application. This allows the user to run applications from any directory in DOS without having to type the full path of the command. DOS will search all specified paths for an application, including all of the sub directories below these paths. If the following path is set for Java then all of the Java applications can be run from any directory in DOS:
set PATH C:\jdk1.3.1_02\bin %PATH%
The %PATH% part of this command simply includes any paths that have already been set. However, this method of setting the PATH variable only works for Windows 95 and 98. Windows XP required that you add path variables through the systems link in the control panel. By clicking on the advanced tab then the “Environment Variables” button you can edit the system variables. After the path variables have been added the machine needs rebooting before the changes take effect.
The “set CLASSPATH” command is very similar to the “set PATH” command but allows you to specify the default directory for classes that are used for compiling code.
The TINI was configured in accordance with the instructions on the iButton Website which have long since been replaced. This explained how to setup the Ethernet port for Telnet and FTP access to the TINI.
Weather Station Display
The data displayed below is an image of what was retrieved from this TINI HTTP Server. Values from 5 different sensors can be read through the Analogue to Digital Converter (ADC) on the Tutor board. A Multiplexer is used to select the channel to be displayed.
The website also showed the temperature over a 24 hour period. A program simply recorded a temperature value to file every hour. At the end of the 24 hour period the program read all the values from the file and created a graph in HTML code. Therefore the graph could be updated at the end of each day and the values displayed were from the previous day.
If you are interested in reading my full final report titled ‘Web Based Weather Station using a TINI Java Machine’ which goes into further detail, you can find it here: