A few days back I posted a bit about a DIY air quality monitoring project I’ve been working on. That post just outlined why the project started, what we hoped to achieve, the high level design, component selection and software stack. In the last few weeks the project has moved past the breadboard stage into a real physical prototype. It’s a little ugly, built on generic perfboard and full of design compromises, but it works like a charm. Now that it’s working, it’s time to share what went into the build, the bill of materials, and a few pics!
Top of board
On the top of the board I have mounted the Wifi module, the MQ series sensor array, a 6 circuit Molex connector for the particle sensor, a 5V regulator and the Arduino. The Arduino mates to the perfboard using a bunch of 0.1″ male pin headers. You can think of the perfboard as just a ridiculously, comically oversized Arduino shield. The WINC1500 mounts the same way. The MQ sensor breakouts use a right angle female pin connector. Why so many connectors? I like to reuse stuff. With the way this is put together it is easy to pop modules on / off of the board to be reused in other projects or replaced if they stop working. One thing to note here is that the Arduino uses wacky spacing for one of its sets of headers. The spacing between pins 7 and 8 is not the standard 0.1″. Why? Who knows, seems silly to me. I didn’t need one of those sets of headers, so I just left the problematic one with the weird spacing off of the board.
A word on power in this design. The MQ series sensors all have internal heaters that are required to keep them at the right operating temperature. These heaters need regulated 5V. They consume more power than the Arduino has available from its 5V output. So, 7.5V is fed into the regulator, which provides regulated 5V output for the MQ sensors and the DHT-22. The same 7.5V is fed into the Arduino’s vin pin, which powers the Arduino itself. The other low power items (WINC1500, Sharp particle sensor) are driven off of the Arduino’s regulated 5v output. While it is possible to run the 7805 regulator without a heat sink for low current loads, my total load was high enough that it needed one.
Bottom of board
On the back of the board we find the Sharp GP2Y1010AU0F sensor, the DHT-22 temperature and humidity sensor, and a bunch of ugly globs of solder. The one thing I don’t like about the Sharp sensor is the lack of real mounting holes. It does have some little rails, so I used some short plastic standoffs and nuts to sandwich that rail and provide a secure mount. The Sharp sensor’s data sheet prescribes a specific orientation for mounting. Once this board is slid into its housing and the housing is stood up, the sensor will be oriented correctly. The DHT-22 sensor is also mounted on this side of the board. Why is that when it looks like there is plenty of room to mount it next to the MQ sensor array? Recall that the MQ sensors have heaters in them. The first iteration of this board had the DHT-22 right next to the MQ sensors on the other side. When the MQ sensors came up to temp, the DHT-22 was consistently reading 10-15 degrees higher than it should have been. Moving the sensor to the other side of the board seems to have corrected that.
This type of enclosure is a pretty standard thing for sensors that live outside. A louvered radiation shield keeps the rain and sun off of the bits and pieces. Strong driving rain would probably still find its way in and I don’t want all these parts getting wet, so it will be mounted up under a covered area where it will stay nice and dry. This particular shield enclosure was designed for an Ambient Weather temperature sensor but it works great for this project. Luckily at its widest it was just a few mm narrower than the perfboard I used for the project. Cutting a few little notches in the sides of the enclosure allows the board to easily slide in and out like it was designed to be there. The oval shape of the enclosure cavity made part layout a little tricky. The taller parts like the MQ sensors and dust sensor needed to be kept toward the middle so they would have enough clearance.
Bottom plate installed
The bottom plate has a standard power jack that is used to supply the system with power, and three status LEDs that show the state of the system. Red means that there has been a fault detected and the system has halted. When that occurs it will restart in 8 seconds or so when the watchdog timer kicks in. The yellow light signals that the system is starting up, connecting to the network and taking test readings. Green means that everything has started up and the monitor is successfully connected to the network. It’s a bit crude, but does a good enough job to indicate the system status without having to hook up a USB cable and look at the serial monitor output.
All buttoned up!
The perfboard slides right in, and then the bottom two louvers are attached to the threaded posts with wing nuts. Looks nice and clean once it’s all put together and you can’t even see that ugly board.
The posts on top of the enclosure are used to attach it to an L bracket included with the enclosure. This bracket also comes with some U bolts that make it easy to mount the whole assembly to a pole.
Here’s what was used to build the monitor. If you have been hacking around on electronics for a while you probably already have some of this stuff just laying around. If you haven’t and you don’t have a good stock of bits and pieces, now’s a good time to order extras of stuff you know you’ll use a lot. Passives, wire, that ubiquitous 0.1″ male pin header strip and of course you can never have too many LEDs!
I’ve put the wire in the BOM as well, even though it’s not strictly necessary. I like the pretinned 24AWG stuff for laying out power and ground busses on one side of the board because it’s easy to solder it down to the pads on the board as you are routing it around. 22AWG stranded wire is good for connecting the board to stuff mounted on the enclosure (like the power jack) where some flexibility is needed. The 30AWG insulated wire wrap wire is good for signal connections. The 30AWG wire wrap wire is fragile though, so after I have it all working I like to tack it down with a dab of hot glue. If you have to do some rework, the hot glue peels off easily enough.
- 1x Arduino Mega 2560 or 1280
- 1x Adafruit WINC1500 Wifi breakout
- 1x 7805 TO-220 5v regulator + TO-220 heat sink
- 1x 10μF 25v electrolytic capacitor
- 1x 1μF 25v electrolytic capacitor
- 1x 220μF 25v electrolytic capacitor
- 1x 150 Ω resistor
- 1x 10k Ω resistor
- 1x each green, yellow and red LED
- 1x MQ-7 carbon monoxide sensor breakout
- 1x MQ-135 air quality sensor / hazardous gas sensor breakout
- 1x MQ-131 ozone sensor breakout
- 1x Sharp GP2Y1010AU0F dust sensor w/wire
- 1x DHT-22 temperature and humidity sensor
- 1x Radioshack 2200 hole perf board
- 1x Ambient Weather SRS100LX radiation shield
- 0.1″ right angle female header
- 0.1″ break away male header
- Some 22AWG stranded wire
- Some pretinned 24AWG solid bus wire
- 30AWG insulated wire wrapping wire
- 2 pin M+F power connector
- Molex 6 circuit 0.1″ KK crimp housing
- 7.5V 2.5A regulated power supply
Moving from the breadboard to a real prototype was pretty straightforward. With a good schematic and lots of pictures of the working breadboarded design translating it to the perfboard was mostly a matter of laying out the components in such a way that they fit neatly in the enclosure. The schematic and Fritzing diagram will be added to the Github project shortly, they just need a little cleaning up. If you are going to try a project like this, make sure you have your enclosure and bare board in hand at the same time or you may find that things don’t fit like you expected them to. I was expecting the enclosure I ordered to have a larger cavity, for example. Now that the monitor can be moved around without wires popping out everywhere we can move on to some real world testing, data collection and analysis.