In this project I will show you how to build a wireless temperature and humidity sensor. The sensor transmits the temperature and humidity over RF to the Wireless Base Station Receiver. This sensor works seamlessly with the PrivateEyePi system, or you can use it for your own purposes. The temperature and humidity signals, that are received by the wireless base station receiver, are sent over the serial interface in clear text so it is very easy to write you own code to receive the data. We supply a sample Python program that show you how to read the data from the serial interface. You have a choice of using either the DS18B20 (temperature) or DHT22 (temperature and humidity) sensors.
If you have landed on this page from an internet search you may want to review all the steps involved with setting up wireless communications with your Raspberry Pi here.
Figure 1 - Wireless Temperature and Humidity Sensor
1. The RF Module that interfaces with the temperature sensors and transmits the temperature and humidity.
2. This Power POD is capable of taking a 1v to 3v input to give a 3.3v "stepped up" regulated output.
Temperature and Humidity Sensor, or use the DS18B20 which has temperature only.
4. 4 resistors (4.7k, 10k, 100k and 1M).
5. Battery clips for a 1.5AA battery.
6. DS18B20 Temperature sensor or use the DHT22 which has temperature and humidity.
The sensor uses 30.5mA every 5 minutes and sleeps in between transmissions (using .005mA while sleeping). A transmission takes 1 second so you can expect the following battery life: AA (2 Ah) - 819 Days (2.25 years). This is a rough estimate as battery life will be affected by the type of battery you use as well as environmental conditions.
Step 1 - Connect the RF Module
The first step is to solder the RF module to the main board. I find the easiest way to do this is to put a small amount of solder on each of the 20 pads (as seen in Figure 2), before placing the RF module on the board. Don't put too much solder on each pad, just enough so that each pad has a enough solder that coats the whole pad. Be very careful not to bridge any of the pads with solder.
Figure 2 - Put solder on each of the RF module pads
Then place the RF module onto the developer board as shown in Figure 2. Tape the module in place to that it does not move during the soldering. Take your time doing this step and be very meticulous about making sure the module is positioned perfectly to the board. If you make mistakes now it will be a lot of work later to diagnose and correct.Solder the corners to anchor the module to the board. You do this by melting the solder you placed on each pad, and then using an upward movement of the soldering iron bridge the pad with the contact of the RF module. Each of the RF module pads a have a grove that will guide the soldering iron upwards. This helps you not bridge solder onto the adjacent RF module pads. Once you have the module anchored solder the remaining 16 connections in a similar manner. Carefully inspect each connection and make sure there is a good contact with no bridges and no bad connections (as shown in Figure 2).
Figure 2 - Soldering the RF module directly to the develop board
Figure 3 - RF Module attached to the main board
Step 2 - Connect the Battery Clips
Place the battery clips on the outer most pads as shown in figure 4. Solder them on the underside of the board. These pads are large and will need a lot of solder. If your soldering iron is not hot enough you may find it difficult to heat the whole pad and get a nice pool of solder around the battery clip feet. If this is the case then either turn up the heat or solder each side of the battery clip feet with two sets of solder.
Figure 4 - Connect the battery clips
Step 3 - Connect the Power POD
Next you will connect the power POD that will convert the 1.5V power to a regulated 3.3V. The board has an area specially designed to connect power pods. You will use some bare jumper wire, or some off-cuts from the resistors to connect the power pod to the developer board. Line up the holes in the power pod with the 4 holes for the power pod in the main board, as shown in Figure 5. Put a small piece of wire through each of the four holes and solder both the top and bottom so that the pads on the power pod connect with the pads on the developer board. You only need to connect the first three holes (VIN,GND and VOUT) as shown in the diagram.
Figure 5 - Attach the Power POD
Step 4 - Connect the FTDI connector
This step is optional and can be done at a later stage. The FTDI connector allows you to connect your sensor to an FTDI USB cable so that you can re-program the software on the device using the Arduino development application. Refer this section for more details on programming the micro-controller.Solder the 6 contacts of the FTDI header on the underside of the board.
Figure 6 - Connecting the FTDI connector
Step 5 - Connect the temperature sensor
Next you will connect your temperature sensor. You have the choice of using the DHT22, which will output temperature and humidity readings or a DS18B20 which will provide only temperature readings. Both are highly accurate to 2 decimal places digital sensors.
If you have chosen the DHT22 sensor attach it as per the Figure 7 placing the solder on the underside of the board. Important: Make sure you leave the legs of the sensor quite long so that you can bend the sensor over the power POD, otherwise it will not fit in the casing.
Figure 7 - Attach the DHT22 temperature and humidity sensor
If you have chosen to use a DS18B20 temperature sensor then solder it to the board, with the solder on the underside of the main board as shown in Figure 8.
Figure 8 - Attach the DS18B20 temperature sensor
Step 6 - Connect the resistors and the capacitor
Next attach the four resistors and the optional capacitor. You only need to connect the capacitor if you connected the FTDI connector in step 4. It is important that you connect the resistors to the correct pads. Each set of resistor pads are labelled 10k, 4.7k, 100k and 1M. In the left hand picture of Figure 9 the closest resistor is the 1M, then 100k, then 4.7k and 10k at the back.
Here are the 5 band color bands associated for each resistor:
10k - brown, black, black, red, brown
4.7k - yellow, violet, black, brown, brown
100k - brown, black, black, orange, brown
1M - brown, black, black, yellow, brown
Solder the resistors to their associated pad on the underside of the board, It does not matter which way round the resistor is facing.
If you have chosen to connect the capacitor then connect it to the pair of pads labelled 0.1uf. You need to solder the negative side of the capacitor (labelled "-") or the short leg to the pad on the right hand side when the main board is oriented like the right hand picture in Figure 9.
Figure 9 - Attach the resistors and capacitor
Step 7 - Connect the battery sensor
We've configured this board to allow you to choose whether you want to monitor the battery level. If you connect the two pads labelled 1M and A1 (in the middle of Figure 10) then the sensor will also transmit the battery level in addition to temperature and humidity. This will appear on the PrivateEyePI dashboard where you can monitor the battery level.We've made it optional because it does cause a slight drain on the battery. The battery estimates we did above were based on it being connected. If you are not interested in the battery level then you can save some battery by not connecting these two pads.In Figure 10 you can see we have used some wire to bridge 1M and A1 and soldered the wire in place on the underside of the board.
Figure 10 - Connect the battery sensor
Step 8 - Attach an antennae
Depending on the distance you need to transmit the signals you can attach an antennae for a stronger signal. Cut a piece of single core wire (any wire will do) to exactly 8.2cm (3.2") and solder it to the antennae pad on the RFu-328 shown in figure 11.
Figure 11 - Attach the antennae
Congrats, now that you have your sensor built set up your dashboard by following these steps.
See the following link
for instructions on how to load new firmware to the RFu-328.