So now that most of the parts have arrived for my weather station, I have begun designing, testing, and programming the circuits for both the receiver and the transmitter part of the weather station.
So far I have connected the thermometer, barometer, and hygrometer sensors to the Atmega328P-PU chip on the breadboard. I have also connected the MX-FS-03V transmitter to the board and I still have 10 digital inputs left over.
On the top-left you can see an Arduino Uno which has the MX-05V receiver attached. I went through the sample code from the RC Switch and Virtual Wire libraries to figure out what was best for my setup. I eventually went with the Virtual Wire library and my own code. I found this website to be helpful in describing how to connect the modules.
One of the challenges I faced was parsing the code though to the send function which was included in the Virtual Wire library. I eventually found a solution using this code:
float p = getPressure();
dtostrf(p, 7, 2, pbuf);
sprintf(msg, “%s %s %s”, tbuf, hbuf, pbuf);
vw_send((uint8_t *)msg, strlen(msg));
This following code takes a float temperature reading, turns it into a char array, then combines it and 2 other readings into a single char array, which then gets passed onto Virtual Wire send. Shorter messages have a lower chance of getting interrupted or lost so I will stick with those in the final program.
Another challenge I faced was providing the correct voltage to the 3.3v barometer. Since this is a minimalist breadboard design, the voltage actually comes from the 5v USB to Serial adapter; the BMP180 barometer will not work with 5v and it could get damaged.
I remembered that voltage dividers were a thing, so I incorporated one into the design. This is the circuit I used:
Using a 100 ohm and a 200 ohm resistor (common values) in the circuit above will provide 3.3v to the barometer. Voltage dividers should only be used to power low amperage devices, and will not work with items like motors. It’s a “quick” solution to something that should be handled with a static voltage regulator.
In the image above there is a formula for figuring out the voltage of Vout, as well as the formula for the resistor power dissipation, which is 0.08 watts. 0.08 watts is not a big deal.
Now that everything was hooked up, I wrote a simple little loop which transmitted values across the room.
Easy so far! All I need to do now is hook up a voltage regulator, put all of the components onto a perfboard, and maybe even try some reed switch sensors! The code also needs a bit of work in order to extend the range, but that will come later.
Also, I started building the enclosure for the weather station out of some plywood:
It looks like a bird-house!
While it’s not the best housing for taking accurate measurements, it should do the trick. In order to protect the wood, I plan to paint, then cover the entire thing with epoxy (or vice versa).
When I am done this project I will release all of the schematics/source files as well as publish some start-to-finish instructions on Instructables!