Tuesday, June 26, 2012

Enviromental Monitoring Device

Something I've been wanting to make for a while, and finally decided to tackle it.   Found out about Arduino which is an open source C++ based electronic platform.  In very basic it is a device with inputs and outputs where you can connect things to it.  You can set the pins to input or output.  In input mode, analog pins will read a voltage from 0 to 5 and convert it to a value of 0 to 1024.  Using a voltage divider circuit (where 12v can be equal to 2 volts and 6 volts equal to 1, for example) then you can measure voltage.  Certain devices such as gas detectors will generate a voltage based on the concentration.   Then there are digital inputs which have a voltage threshold, if they get less, it's 0 if they get more it's 1.  This is good for on/off stuff like whether AC power is present, for example.  You can read up more about it here.  It's really cool, and they are fairly cheap.  I bought mine at Canakit.com.

So that said, I set it up in a "box" which is actually a HDD insert for my supermicro enclosure.






Like my hvac control system I posted about previously, I wanted a central point where sensors can be wired to, and to make it cleaner I added some power distribution blocks.  Rather than use the voltage and ground from the arduino device and splicing it by soldering a bunch of wires together and ending up with a mess, I now use the enviromental control server's PSU output to feed the voltage.  Conveniently, the DC ground of a computer, and most electronics, is bonded to the earth ground. Otherwise I would not be able to do it this way as the +5v from the power supply would not be at the same potential as the +5 volt of the arduino board.  But thankfully it is, so it makes my life easier.





It looks complicated, but all it really is is 3 terminal blocks that are interconnected with the center bar in the middle.  One wire per block goes to the server to get power.  All the other wires go to the other DIN blocks to feed the sensor's ground and +5v.   I also feed the hvac relay controller off this, that way it shuts down when the server shuts down.


I'm hoping to get the voltage sensor and AC power fail sensor connected shortly.  The AC power fail sensor will be as simple as having a power adapter plugged directly in the wall and it will keep a relay open.  When the power goes out that relay will close, closing the input on the arduino and triggering a power outage notice.

I still have to code the software that will interface with the arduino to get and interpret the readings. 

I will also add it to Pandora, or other monitoring tool. Eventually I want to add smoke detectors and CO detectors to this so if one goes off, I will get an email notification if I'm at work.  I may even look at SMS text.  

No comments: