>>> Join Us in the Fight Against Air Pollution

AirGradient Forum

Wiring up an XBee 900 Mhz module?

I received my Airgradient kit last week and finally assembled it yesterday. It’s been an eye opener for sure! For instance, our bedroom CO2 levels got to 1500 overnight which makes me wonder if that’s the reason I tend to wake up so groggy in the morning. That’s one of a number of fun things I’ve been doing with it and expect I’ll be getting another one soon.

I modified the code to publish to my local MQTT instance which I’m tossing into InfluxDB and then graphing via a Grafana dashboard. I expect I’ll hook up Home Assistant to it too to display the current stats.

The one place I wanted to use this was in my darkroom shed. When I need to escape from IT for a while I go in there to make conventional analog photography prints and things. It’s a smaller space so I expect there may be air quality issues in there. While I can simple disable wifi and read the display, that’s not great while I’m actively using the space for printing (only certain types of red lights are safe for my papers or no light at all in the case of color paper).

Unfortunately Wifi doesn’t reach out that far. While I can look at an extender, since I already use XBee 900Mhz devices for a few things (as well as ZWave on that note), I was thinking about the best way to add an Xbee module. I’m thinking of using Xbee since I already have a Sparkfun Xbee receiver and have all that setup already so adding another Xbee device shouldn’t be too problematic.

I see the Airgradient board exposes RX/TX and 5V so I think I can just wire up to an Xbee module and call it a day, but wanted to see anyone else was doing this and had any thoughts.

Sounds fun.

I’d probably just set my cell phone to hotspot mode and connect the Airgradient V2 to it instead of my regular home wifi. (Not sure if you have cell service, though).

(Note: I don’t have an airgradient kit yet - I’m waiting on V3 :slight_smile: )

My cell signal is also poor in there alas - generally cell isn’t great anywhere around our house. One of the nice things about 900MHz is it’s an ISM band, not particularly populated, longer range, and wouldn’t require the recurring cost and reliance on a cell company. XBee’s aren’t the most cost effective way to utilize the band but since I already have the stuff for them, probably makes the most sense for me.

If I wanted long-range and didn’t have any XBee stuff, LORA radios might be my next pick. Crazy range with minimal power with the only major downside being it’s very low bandwidth, though it’s still plenty fast for telemetry like what the Airgradient sends out. I expect LORA will likely eclipse Zigbee/XBee for a lot of folks as a result.

1 Like

Sounds really interesting. Please keep us posted how things are going.

Ah actually I’ve had it working for about a week or so now - the way I wired it up isn’t particularly elegant at the moment as I just have some wires with female pin header ends plugged right into the pins on the Xbee which is attached to my 900Mhz antenna that is, in, taped to the wall :slight_smile: So not professional but was good enough to test. I have a proper adapter board for the Xbee I can use to wire something more reliable. I haven’t pondered how to keep everything together. Making a case for both the AirGradient and Xbee would be ideal but since it’s out of the way, I may just velcro the Xbee adapter to the AirGradient case and call it a day for now.

The code ends up being really really simple and I’d be happy to share what I have there! Xbee talks serial so I just ended up outputting the JSON string directly out to serial and then capture it in a Python program running on my NAS that has the Xbee receiver. Xbee is just wired up with 3 wires (3.3V, GND, TX).

Since I can’t use the display in the darkroom, I basically commented that and the Wifi stuff out. Kinda defeats the purpose of the nice microcontroller but it works for my needs.

It’s a bit of a shame Digi hasn’t made any effort to make their programmable Xbee’s Arduino compatible (as far as I’m aware anyway). I haven’t messed with those features basically at all as a result but I think they are plenty powerful to manage the suite of sensors of the AirGradient. Seeed might have some microcontrollers with a built in LORA radio? I know they’ve been offering LORA products so that might be something to look at perhaps for situations where Wifi won’t due. As mentioned I’m using Xbee because I already had them for other purposes. But if I was going to do something from scratch, I’m not sure they’re the best option. And that’s only if dealing with unreliable or no-Wifi. I would imagine a majority of folks using AirGradients won’t have this need. Even so, Xbee 900Mhz and LORA can get miles of range which is significant for remote monitoring.

Anyways as far as the results go, this part isn’t really new since it’s the data coming off the AirGradient sensors, but still I thought I would share some of my data for viewing. I was able to draw some pretty useful conclusions in a short period of time, which is great!

Basically, though the above doesn’t show it, I found the CO2 levels rise a lot more quickly in my darkroom than I expected when I have the door closed. First night they shot up to 2800. Next time I was in there, I made a concerted effort to open the door more often and these kept the levels under 1000.

A more permanent solution is darkroom louvers (light tight vents). But now that it’s getting warmer where I live, I’ll need to start running the air conditioner and want to see how that changes things. Since that pulls in fresh air (at least to some degree) I wanna see how that changes things. Opening the door means I can’t regulate the temperature nearly as well and that can matter for some applications.

Anyways the TLDR is that it’s working very well in there! I need to have a more permanent solution for the Xbee wiring as noted but otherwise it’s great! I do expect I will still get at least one more for the house (which I can use over Wifi - no need for the Xbee there).

2 Likes