Skip to main content

You are here

Homemade BMP085 Node in a Garden Light

15 posts / 0 new
Last post
Homemade BMP085 Node in a Garden Light

The idea of using solar power for a JeeNode always seemed magical and I had need to build an outdoor temperature sensor as a reference for another project. Using parts I had on hand and a sale at Lowes (3 large lights for like 8 bucks) I built this camouflaged little remote node

Which one is the light and which houses the transmitter? You'll have to wait for nightfall to know!

The insides are just an ATmega328P (because I have a tube of 16 of them) running on its 8MHz internal oscillator connected to a Sparkfun 3.3V boost converter and a BMP085 breakout. The RFM12B is connected on a scrap of PCB I made to adapt it to through-hole. Why didn't I make a PCB that held all the components? I actually started this project a year ago and didn't have a way of reliably making boards. The little RFM adapter took me like 8 tries to get a usable result

With the antenna curled up inside of the metal housing I only got about 20 feet of range on it and I'd have to leave my front door open to get any signal. To get around that I ran the antenna wire through a hole in the light and extended it out 78mm over a piece of sheet metal connected to the battery's ground. This setup gave me a lot more range, within about 5-8 feet as an actual jeenode in free air.

I don't recommend the Sparkfun 3.3V boost board for running JeeNodes on. When everything is sleeping there's still a pretty good amount of power draw, about 470uA at the AA battery for 4.8uA output. It's ok though because the sun puts out a lot of power. With the included "600mAh" NiCd battery, one hour in the sun provides enough power to transmit every 2 seconds for several days (blinking a 5mA LED every time as well).

I've been playing around with other antenna designs as well-- half wave and helical but haven't had much luck reading the RSSI from the RFM12. I've modified the interrupt handler to store the DRSSI bit on the reception of the last byte of a JeePacket (because it takes 500us typical for the DRSSI to indicate a signal after the threshold has been reached) but even with the two sitting on the same table I get DRSSI=0 for a -103dBm threshold about 25% of the time. I may start a new thread about it but has anyone been able to get a better RSSI indicator aside from using the analog pin?

I've also tried adjusting the threshold up or down based on the value of DRSSI on the first received data byte (which is actually 5 bytes into the transmission) but that just gave me somewhat random results.


Actually I take back what I said about my antenna. I've hooked up the ARRSI pin from the RFM12B chip to an analog in on the ATmega, because I can't get the DRSSI to work correctly at all. My fancy grounded plate + wire = 192 on the ADC. A standard JeeNode with a piece of wire sticking up is 288. Max signal with the two close together is a 340 and I lose data at 160.

160 - Min Receive 192 - My "antenna" at distance 288 - JeeNode at distance 340 - Max Signal

Great job. I am planning to do something very similiar as my next project, though I need to use a garden light with a PIR already in it. The have about a dozen spread around near the boundary of out property, and have them trigger remote flood lights.

I will have a DS18B20 in each as well. (unique serial number and temp for fun - I am sticking one in every project I am doing).

You antenna info is particularly interesting. That bit I hadn't given any thought to as yet.


Oh and I plan to put the solar lights LED under control of the node, and then only turn it on when the PIR is triggered, or on remote trigger.


Nice build. FYI, the aerial requirements don't follow the textbook numbers for fractional wavelength calculations. There is a matching network between the differential transmit pins on the RFM12B chip (most of the discrete components are involved) and the chip itself has some automatic impedance adjustment capability. Bottom line is that you are not targeting 75Ω resistive as the driving impedance for your variants on omni directional "whip" aerial.

Unfortunately, this area is poorly documented - just a few pearls scattered in the weak Hope docs and not much better in the original Silicon Labs data sheet . Monitoring the transmit current is useless to monitor "match", there is at least one feedback loop attempting to stabilise notional output power and reflected power is included. The most effective for "trim & try" is a remote reporting field strength indicator along the lines you are following.

Very interested in your practical results on this, I'm putting some material together for a "Tune Up" article.


There is a whole lot of information about antennas on the internet but most of it is way over my head and most antenna tuning information involves "well you hook it to your analyzer and keep cutting antenna and swapping inductance until it works well". What I've learned this morning is that the reason my antenna is not working as well as it could is because the wire that goes to it is part of the antenna as well. To avoid the feed line from becoming antenna, you have to use coaxial cable. That is, the signal line needs to be wrapped with a ground sheath to help prevent it from picking up any signal. This is well before you get to any matching of impedance issues.

To get around the DRSSI not working reliably, I have hooked up my analog RSSI thusly

Note that the "chip" version of the RFM12B (as opposed to this "blob" model) has the polarity on this capacitor reversed. Before soldering, use a multimeter across the capacitor and solder the wire on to the positive side. Should read around 300mV during receive idle.

That gets you hooked up to this action, where the red is RSSI and the yellow is SPI bus traffic of data coming in. This is for my "high" signal

And here is a signal which is just at the far end of the range of reception

To read this value I added a uint8_t rfm12_rssi to the library and read it in the interrupt handler

if (rxfill >= rf12_len + 5 || rxfill >= RF_MAX) { // BRY: Store the current RSSI voltage rf12_rssi = analogRead(0) >> 2; rf12_xfer(RF_IDLE_MODE); }

You can either read it when rxfill = 0 or at the end as I've illustrated here. They both seem to come up with just about the same value. Checking the DRSSI bit in either place with the threshold set the lowest (-103dBm), I sometimes get 1 sometimes 0 even for a closely-placed transmitter.

I've got plans today so I probably won't get a chance to try out my different antennas hopefully someone will be able to use this procedure to do some testing on their own and report back. The results of reading the ARSSI are very consistent so I'm excited about the opportunity this affords.



Could this give a hint



Turns out my plans fell through because of bad weather. That's ok because I wanted to play with this more today.

I took a piece of aluminum foil and wrapped my antenna wire from the RFM12B solder point all the way down to the hole where it exits to the ground plane. Then I tried about 100 different times to solder the foil to a grounding wire with little success. I tried flux, I tried high temperatures, I tried asking nicely but solder just will not stick to it. I eventually laid the stranded wire on the foil then wrapped it with another layer of foil and some tape. The multimeter said the foil was now grounded so I was good to go.

Overall I saw little improvement. Now I am getting about 200 on the ADC vs 192 before vs around 290 for a standard jeenode.

I turned my attention to the receiving antenna to see if there was a way to boost reception on that end. Between the Hope RF Antenna Guide and an article about a 900MHz antenna it appears to me that a piece of wire is the second best omnidirectional antenna. A dipole would be the only improvement, reception-wise. Just for fun though, I made a 915MHz helical antenna based on the specs from that eBay listing. 10 turns of 22 gauge wire around a 5mm post with a length of 17mm, which works out to ~1mm turn spacing. It worked, although not as well as the wire. I'd get nothing from my device and the jeenode reception was reduced approximately 10%. I tried stretching and compressing it without much luck. The best reception was with the helix "lying down" (i.e. colinear with the PCB) and the whole thing oriented vertically to match the polarization of the transmitting antenna.


Cptn, interesting experiments and empirical improvements are certainly to be found. There is a fundamentally difficulty however - the RFM12B module designer has made assumptions about the aerial you will attach.

Stepping back a little, how can wrapping foil around a wire make such a difference? Assuming we are dealing with a/c in the multi MHz range, this is approximating a co-axial cable; lossy since the dielectric becomes the pvc of the wire, instead of PTFE or similar designed specifically for RF.

Why should this help? Well a coaxial cable is a special form of a transmission line and ploughing into the text books produces the following gem.

a transmission line driven and terminated at Z0 (characteristic impedance) is entirely lossless

So our little foil pipe (or better a co-ax cable that is actually spec'd for low loss at sub Ghz) is moving RF energy from the antenna pin to what you have declared to be "the antenna"? Were life so simple at RF - note the qualifier above. The efficient transfer only occurs when the coax impedance (typically designed to be 50Ω, pure resistive) is matched at both ends. And if it doesn't? Well, the energy bounces backwards and forwards, some consumed by the losses in the non-ideal cable, most lost as heat in the transmitter output circuit.

Recall the module designer had a different target in mind - a self-contained device, possibly handheld where space is at a premium, the aerial connected right to the antenna pin. What is possible? If the actual antenna attached can be made to look like 50Ω, then one end is fixed and the murky "auto tune" facility on the RFM12B module will attempt to match this at the driving end. A λ/4 stub does not naturally look like 50Ω but can approximate with some tweaks to loading inductance and top capacitance. The next gains can come from making unidirectional more focused, dropping a corner reflector over a vertical stub (lots of designs in the Free WiFi community) gives several db gain for free.

Actually there is a wealth of information out in the Amateur Radio community on this.

One good aspect - reciprocity applies. Anything you improve for reception, also helps transmission and vice versa


Impedance matching aside, the reason (in my mind anyway) the foil works is because a piece of wire attached to the antenna pin of the RFM12B becomes an antenna across its entire length, because radio waves are able to excite the wire. When I wrap a grounded foil wrapper around part of the wire, it is shielding that part of the wire from transmitting, making only the length of wire which isn't shielded the antenna.

Think of it like if you made a 120mm straight wire antenna, it wouldn't be very good for 915MHz transmitting, which should be around 78mm. Now take a piece of foil and wrap it around the 42mm of that wire and ground it. Effectively you've got a 78mm antenna now because of the shielding. At least that's how I understand it.

As far as impedance goes, theoretically could now be a worse or better match than before. According to the Hope RF document, a piece of wire standing straight up over a ground plane is about 35ohms and if you bend it parallel it is only about 10ohms. In my project, the antenna ran alongside the RFM board, then folded under the breadboard back under the module (over the "back" of the ground plane), then out my new antenna hole. Who knows what sort of impedance that created during transmission, but now whatever effect it had should be much less due to the shielding blocking some or most of the signal.

Be careful with the foil though, I noticed my battery was way low after just a minute of use and the transmitter went out completely in no time at all. Luckily the short I had created didn't kill anything besides the battery.


UPDATE: Two weeks into use, the battery died completely.

The problem with this setup is that the AVR/RFM uses such a small amount of power that the NiCd battery doesn't ever really drain. I started with a dead flat battery and it charged up fully the first day. Each night it would bottom out at 1.25-1.27V and every day the sun would try to pump more juice into it. As you might imagine, a NiCd battery does not like being charged at ~1.45V for 6-8 hours a day without ever being discharged.

I'm not sure what can be done aside from using maybe using 2 ADC channels to track the battery voltage and solar panel voltage and only charge the battery when needed.


Would this work - might be simpler.

If you know your average consumption from the AVR, you could turn the LED on every so often to consume more power, and just track voltage out of the panel or use an LDR, and only consume excess power if you are getting too much sunlight.


I'd be concerned about "burning battery" just for the sake of using up the battery. What if there'a a cloudy day? I'd run out of juice only because I was intentionally draining myself!

I'm wondering if maybe I can just replace the schottky diode with a 1N4001. If the solar panel maxes out at 2.0V and the forward voltage drop is 0.7V that would mean the battery would stop charging around 1.3V. Either that or set up some sort of transistor configuration that only enables the solar input if the battery is below 1.2V or some arbitrary point.


Another way to prevent overcharge is with a MOSFET across the battery: you can short out a solar cell without adverse effects. You do need a diode towards the rest of the circuit to prevent discharging the battery. To avoid losing energy when you need it most (dark days), better use a schottky diode with only 0.3V drop. Furthermore, consider adding a resistor in series with the solar cell, to limit the current into the battery during periods of very strong sunlight.


I might try that MOSFET idea, but it looks like I was wrong about what caused it to die.

It wasn't that the battery had a reduced capacity, it was that I started drawing excessive current. For some reason, my BMP085 sensor now pulls over 10mA at 3.3V just being connected to power. Amplify that by the 1.2V AA boost efficiency and I'm pulling close to 40mA at the battery continuously. It doesn't take long to kill a fresh battery like this:

On Saturday about 2pm you see the battery voltage start dropping fast despite actually being boosted by the solar panel at the time. It doesn't last through the night. I've popped the BMP085 breakout board off and tested it for any sort of ~330ohm short that would cause it to pull 10mA but no luck. There's only 4 components on the whole board so it isn't exactly complicated. I might try to remove the pressure sensor from the board altogether and measure it out of circuit.

Since I've removed the sensor, the device has been transmitting all day today every 2 seconds as the battery charges back up in the sun. I've ordered a new sensor breakout. Maybe I just got a bad one? I swear I never hooked it up to 5V!

Premium Drupal Themes by Adaptivethemes