Arduino based home monitoring project - best approach

So I thought posting here to get the Guru's advice and opinions on my upcoming home monitoring project. Basically, last winter I built a small ethernet thermometer from an Arduino UNO and a Dallas DS1820 sensor and it works very well (except some minor glitches).

Now I'd like to do the following, either using arduinos or through some other way:

  • Monitor the temperature of 3 rooms
    Monitor the humidity of 2 (perhaps all three) of those 3 rooms
    Monitor the outside temperature and humidity
    Monitor the hours of sun
    Monitor the electrical usage of the house from the main
    Additionally, maybe somehow connect my bathroom scale to the infrastructure to log my weight every time the scale is used..

Some thoughts about these things:

  • I cannot afford to fish network cabling throughout the house as I am almost done renovating it.. Somehow, all these sensors will have to be connected wirelessly (Wifi, bluetooth, ??)
    Some sensors will be 60ft + away from each others. I cant run a cable between the sensor and whatever collection point will be used.
    To monitor the hours of sun, perhaps a light sensor or UV sensor?
    Monitoring the electrical usage, I am thinking about monitoring on the main breaker but Im not sure if there's a reliable way (and safe!) to do so. At any rate, Ill ask my cousin who's an licensed electrician to install it since its required by local code.
    Using wireless sensors will require somehow powering them also wirelessly (battery).

Obviously I dont want a huge rig for every sensors.. I was thinking about using Xbees but they require an arduino board.

Has anybody built such monitoring system?

In my opinion there's 2 ways to built this:

The top configuration has the sensors wirelessly connected to the arduino (located somewhere in the middle of the house) so the sensors-arduino are more or less a single device from a network point of view. The arduino has an IP address and collects the data from the sensors. Then my server retrieves the data from the arduino, the sensors being transparent to it..

The bottom config has the sensors with each their own IP addresses and connected to my wifi access point. My server then will retrieve data from each sensor's IP independently.

Is this project feasible? Any thoughts???

Thanks!!

Its going to end up being a balance between cost and difficulty. The easiest way to do it would be to give each "node" an Arduino and WiFi shield. Your base station would then simply need to send a small HTTP request to each device to get its data. The cheaper way would be to build small, cheap nodes that communicate over more general RF. The RFM12Bs and NRF24L01s are pretty common transceivers, and have a good deal of support. Examples of such include the JeeNode and Moteino. If you don't need guaranteed and two-way communication, you could pick up some cheap 315/433 MHz transmitter and receiver pairs and use the VirtualWire library. Instead of polling, the nodes would just send their data out and rely on the base to decode it. Power wise, you would probably have a difficult time trying to run the WiFi Shields off of batteries, so unless you have a plug near where your sensor will be, the small, cheaper wireless nodes would probably suit you best. I've build small little devices that act as sensors:

Base Station:

Battery Powered Sensor "Shield":

The light sensor can run a couple months on a coincell battery, sending the sensor information out every 8 seconds and sleeping in between.

Arrch, MANY thanks for replying!

I am very interested by your suggestions and your feedback. I think using RF as opposed to WiFi would work better and be much cheaper...

Using WiFi would probably require implementing several security layers especially if used to control remote equipment (baseboard heaters, A/C fans, cameras, etc)... so "hackers" cannot sneak in between and cause a "man in the middle" attack.

Regarding the RF modules you suggested, I have a few questions and Id rather ask here instead of looking on tech specs and tech papers that are only providing theoretical values and not real life behaviors..

What is the average range of these RF modules? Lets say I put the "collection" point in the middle of the house, would the RF sensors be able to send their data 50 to 75 feet away?

Are there any limitations such as brick walls, electrical disturbances ?

Is it possible to have interference problems with other RF equipment ? I currently have a ceiling fan that is controlled by a RF remote controller.. Will my fan be affected by the arduino RF sensors? The other way around? Is there a way to have all sensors to use specific frequencies so nothing can interfere?

Regarding battery life, I have changed my mind. Even if the sensor is a bit bigger, I could use more batteries to extend the sensor's life. A nice feature could be that the sensor sends a signal to the arduino collection point to notify it that the batery level is low.

On your picture (the bottom one), you show a "Battery Powered Sensor shield" but it doesnt have an arduino board with it. SO does it mean that my sensors wouldnt require a arduino board and only a RF module with a sensor (temperature, light, moisture) and batteries??

lpallard:
What is the average range of these RF modules? Lets say I put the "collection" point in the middle of the house, would the RF sensors be able to send their data 50 to 75 feet away?

Maybe, depends on the layout. I have them scattered throughout my house, and don't have any issues.

Are there any limitations such as brick walls, electrical disturbances ?

Any wireless signals would suffer from such potential disturbances. Things like walls will reduce the distance. The only true way to tell is to test it in your environment.

Is it possible to have interference problems with other RF equipment ? I currently have a ceiling fan that is controlled by a RF remote controller.. Will my fan be affected by the arduino RF sensors? The other way around? Is there a way to have all sensors to use specific frequencies so nothing can interfere?

Possible, but not likely. These devices have built in features like CRC and header packets to help prevent these type of issues.

On your picture (the bottom one), you show a "Battery Powered Sensor shield" but it doesnt have an arduino board with it. SO does it mean that my sensors wouldnt require a arduino board and only a RF module with a sensor (temperature, light, moisture) and batteries??

Not the last word in that: shield. It plugs into the "base station"

Not the last word in that: shield. It plugs into the "base station"

Ok but would it be feasible to have something like:

Sensor (temp, moisture, etc) + Circuit board + RF module + Batteries ???

To minimize the overall layout..

I feel its a waste to buy 11 Arduino boards just to have a $2.00 sensors running... Perhaps I dont know what Im talking about.. :slight_smile:

lpallard:
Sensor (temp, moisture, etc) + Circuit board + RF module + Batteries ???

Some boards, like the XBee, have this capability. There are other concepts out there like DCDW that don't require a microcontroller, but is very limiting.

I feel its a waste to buy 11 Arduino boards just to have a $2.00 sensors running... Perhaps I dont know what Im talking about.. :slight_smile:

That's why I don't buy 11 Arduino boards. You can use smaller, standalone AVRs microcontollers that cost ~$2. The above posted base station costs me about $8-9 to make, with about 80% of that cost coming from the RF transceiver.

After much thinking, I cam up with something like this:

Do you see anything unfeasible or overly complicated?

The only glitch is the amount of battery I will need......

I may run

Room 1 to 4 on battery or AC since during power outage its not a big deal if they're offline

Outdoor has to be run on batteries since no power outlet will be available

Electrical will be run on AC since its pointless to monitor electrical usage when there's a power outage

The central collection board will be on the Server's UPS so technically speaking will run on AC

Emergency lights will run on batteries since they're for power outages

All thre door sensors will run on batteries since they will be part of my "security system" and need to be available at all times.

Monitoring power consumption on the Mains can be quite dangerous. You'll need a current sensor that can handle many many amps (I honestly don't know how many, but keep in mind it needs to be able to measure the power that your Fridge + Microwave+ Washer +Dryer + Water heater + AC + TV + Computer + Lights + ... (I think you get my meaning) on it (Gotta assume worse case). That is not a small amount, and depending on how you hook it up, if something goes wrong it can start a fire, or kill all the power in your house.

Voltage is easy, and you can do that fairly safely, though you will need to power the thing. Fuses are your friends.

A possible solution is to find a clip on ammeter from someplace like fluke that you can then safely clip around your mains line, and modify it to run off some external power supply (rather than batteries), and have some form of either digital or analog output. Unfortunately, that probably isn't cheap. Fiddling around with your mains is not what I would describe as safe, so just be careful.
Another option is to split up the power and monitoring each line separately on your breakers (The requirements per channel is better), then processing it all later. That alone would be a fairly big project (But could be quite interesting).

Monitoring power consumption on the Mains can be quite dangerous.

I totally agree. Its why if there is any modification to be done on the main's wiring, it will be a licensed electrician , due to code conformity and inherent dangers...

But I dont see a problem regarding sensor's capacity for this one. Whatever the capacity of the main is (in my case 200A & 220V) the sensor capacity will be that. Anything drawing more than the main's capacity will trip the main breaker off and will practically speaking draw 0A at that moment... At least this is what I think.

I agree with the clip on ammeter but I worry about its precision and limitations. Does it need to be far away from another line? As most people are certainbly aware, wires in electrical panels are rather tight and cluttered... Finding a standalone straight 20inch of main wire will be difficult/impossible in my case...

Fiddling around with your mains is not what I would describe as safe, so just be careful.

I wont. Im too scared of electricity to do that. Above 115V, I never do it myself, always use a licensed electrician. I think its the message that should be sent to the population here and on several other forums where I read scary stuff.. real scary..

On a related note, I have found something interesting: Home | OpenEnergyMonitor

Its more or less what I want to do but they already bundled and prepared the boards with CT connectors for current metering, and other things...

In regards to my specific project, and the picture I posted 2 posts ago, here a few more questions:

Do I need to use an arduino board for the nodes that have more than one sensor?

The project openenergymonitor uses a Raspberry PI instead of an arduino for the base collection, but uses arduino boards for the nodes... What are the benefits of using a Raspberry PI instead of an arduino for the base?

Can these "standalone AVR microcontrollers" process data and such? I mean, can they be programmed easily? Programming the arduino with the IDE was a piece of cake because of this forum and the popularity of the platform.. If I end up with some rare or unknown microcontroller and I need to ask a university professor, its no good to me..

Can arduino boards (UNO for example), 2 or 3 sensors, a RF emitter or transmitter run on batteries for a decent period of time? lets say 6 months? I have access to cheap reliable Powerex rechargeable AA batteries so I could use that,... Maybe cheaper in the long run compared to small calculator batteries.

The way I see it now, I could use whatever standalone AVR microcontrollers for the simpler nodes (single sensor, emitting a signal only), arduino boards for the more complicated nodes (2+ sensors or if processing required).

In a nutshell, this is what I have in mind now:

Nodes

Room 1 TO 4:
RF emitter
All AC powered (no more batteries)
AVR Microcontroller (perhaps Arduino if required due to several sensors ??)
temperature sensor
humidity sensor

Outdoor:
Battery powered
RF emitter
low battery annunciation to base
AVR Microcontroller (perhaps Arduino if required due to several sensors ??)
temperature sensor
humidity sensor
light sensor
encapsulated in weatherproof shell

Electrical:
AC powered
RF emitter
200A CT clip on sensor (possible?)

Emergency light 1 TO 4:
RF receiver
Battery powered
low battery annunciation to base
AVR Microcontroller (or simpler board since only a flip state device, if OFF & receive instruction from base, turn ON; if ON & receive instruction from base, turn OFF)...
LED puck (size to determine)

Door sensors:
Battery powered (to eliminate the possibility someone disable them simply by unplugging)
RF emitter
low battery annunciation to base
Proximity sensor (or similar function) to tell if door is opened or closed. Logic (if opened during certain hours, i.e. work, then someone entered the house, alarm to be triggered) either done in the node or on the base..

Any thoughts on this? Any advice? (dont do that, do that instead because...) Any recommendations? Experiences to share?

Im thinking about ordering parts and starting to seriously work on the project within the next weeks... Ideally, Id like the project to be functional by november.

I will need help selecting the proper (best and most reliable) components, assembling them, and especially programming the controllers...
As usual, thank you !!

lpallard:
Do I need to use an arduino board for the nodes that have more than one sensor?

No. The only thing that the Arduino board provides you with is a voltage regulator and an on-board way to program through USB. Those features are good for prototyping, but not practical for real-world use.

lpallard:
What are the benefits of using a Raspberry PI instead of an arduino for the base?

Pretty much the same advantage of using a PC as a base: you can do a lot more on a PC than you can on an Arduino.

Can these "standalone AVR microcontrollers" process data and such?

Yes. If you use the same microcontroller as the Ardunio's use they can do the same "processing" as the Arduino.

I mean, can they be programmed easily?

Not as easily as the Arduinos in that you need an additional piece of hardware connected between your PC and the standalone unit. Otherwise, you can write code and program it in the same IDE. Luckily, your current Arduino can emulate an ICSP programmer. Lookup "Arduino as ISP"

Can arduino boards (UNO for example), 2 or 3 sensors, a RF emitter or transmitter run on batteries for a decent period of time? lets say 6 months?

Maybe on a car battery. This is the big advantage to standalone Arduino's, you don't waste energy on the on-board regulator.

Sounds good.. I will order some parts to start playing with the stuff..

Should I start by building the Base or the nodes? Or perhaps the base and a node?

What RF modules should I buy? I guess below $10 each is OK with me..

Which microcontrollers? Again, with a specific model number I can order online... Can you provide a link?

How do you power these microcontrollers? I can do with AC power, I guess I'll need to purchase and weld a 12V port on it? I feel silly powering a small microsontroller and a few sensors with a 120V to 12V power supply but I guess its better than batteries..

Talking about batteries, can I use AAA batteries?

I guess next time Ill start ordering parts!
8)

Thanks!!!

lpallard:
Should I start by building the Base or the nodes? Or perhaps the base and a node?

Start with the base and one node.

lpallard:
What RF modules should I buy? I guess below $10 each is OK with me..

Up to you. You can probably narrow it down to either some cheap (1) 315/433 MHz pair on eBay, (2) RFM12B or (3) nRF24L01.
(1) will probably be the cheapest, and easiest to work with, but you don't get two way communication.
(2) Will give you the best range, and an easier form factor to work with if you're making custom circuit boards, but will be the most expensive.
(3) Is going to be the cheaper than (2), but doesn't have quite the same range (although, can get greater with an external antenna).

(2) and (3) are going to be the most robust and are fairly widely used with Arduinos.

Which microcontrollers? Again, with a specific model number I can order online... Can you provide a link?

ATmega328 with Arduino Optiboot (Uno) - DEV-10524 - SparkFun Electronics - What comes on the Uno Boards. You'll have to be weary of the programming methods, though. The previous listed can be programmed with with something like this https://www.sparkfun.com/products/9716. Again, Google "Standalone Arduino" for more information on these. You can also use a ATTiny like the 84 or 85, but I've never tried it with the 85s and don't know what kind of support there is for them in the libraries.

How do you power these microcontrollers? I can do with AC power, I guess I'll need to purchase and weld a 12V port on it? I feel silly powering a small microsontroller and a few sensors with a 120V to 12V power supply but I guess its better than batteries..

These microcontrollers can't take 12 volts. If you're powering them from wall power, you'll need 5v regulated power.

Talking about batteries, can I use AAA batteries?

Yes, but you'll have to put a few in series to make sure you have the right voltage.

I see there are several traps into building these things. First one I the keyword "regulated" voltage. So if I opt for the atm328mega microprocessor I will need a voltage regulator between the breadboard and the power supply? By the way yeah you are right, these take 5v and not 12v... my mistake.

So either a voltage regulator or a regulated power supply? I bet the cost of these will make it a wash with buying a full blown arduino board...?

Same thing for batteries... I will need a regulator...? Say I put 4 1.5v AAA batteries, I will need something to step from 6 to 5v...

As Arrch mentioned, the RFM12s are definitely something to look at. They operate at 433 Mhz and the range is on the order to 40m (120'). The nRF2401s can be bought a little cheaper on ebay, but I played with them, and rapidly decided against them. Range is only about 10m, so they'll not even transmit the distance of a typical house. Best to use within the same room.

This week, I'm in the process of putting together several RFM12 nodes, coupled to a Mega2560 board with Ethernet, transmitting via my home router to xively for general data tracking, and twitter to signal alarms and major events. So far, so good. Turned out to be very easy to set up both online accounts. Some test data here,
https://xively.com/feeds/66573328
https://twitter.com/nwncave

BTW, I started this all off with buying a couple of jeenode modules, but the s.w. was full of bugs, and the modules have an invisible 6-mil jumper that shorts the input battery to the USB port in your PC if you're not careful.

Mmm very interesting!! Can you share your hardware setup with me?

I am seriously considering buying the RFM12 modules but I am still unsure about the microcontroller, voltage regulation, best way to power wirelessly, and other electronics details..

In the end I will need a clear recipe. I'm not an electronics guy by any means but I like challenges.

Regarding the base, I am leaning toward a raspberry pi with a rf module...

lpallard:
So either a voltage regulator or a regulated power supply?

Yes.

I bet the cost of these will make it a wash with buying a full blown arduino board...?

Not really. If you bought the Arduino, you would still need something to step the voltage down and rectify it (Wall wart). The only thing the Arduino is providing is the regulator and a couple caps, which is only a few dollars. For the tiny devices handling my wall switches, I hacked some cheap ~$2 USB Wall adapter. That gave me the step down and voltage regulation.

Same thing for batteries... I will need a regulator...? Say I put 4 1.5v AAA batteries, I will need something to step from 6 to 5v...

No, you don't need a regulator. Check the voltage of the 1.5V batteries, they probably won't add up to 6. If it's less than 5.5, you're fine. If not, you could always use 3 AAA batteries, and just run it off ~4.5 volts. The devices I have are all powered from 3V coincells.

oric_dan:
BTW, I started this all off with buying a couple of jeenode modules, but the s.w. was full of bugs, and the modules have an invisible 6-mil jumper that shorts the input battery to the USB port in your PC if you're not careful.

I started moving my RFM12B devices to library by Low Power Labs; it appears to less bloated and less limiting that the JeeLib. I had to make a small modification in the library, however, to get it working with the 84s.

You can see the jeenodes here, they are simply an Arduino 328 bootloader chip, plus 3.3V regulator, plus RFM12 transceiver, for $22.50/each. The 433-Mhz will likely have a little better range than 915-Mhz.
http://shop.moderndevice.com/collections/jeelabs

You also need an FTDI cable or FTDI Friend (basically only 1, although 2 goes a little easier) to connect to your PC.

Like Arrch said, look at the lowpower labs library.

Personally, I think it's easier to start with something like this, and later maybe do your own designs.

oric_dan:
You can see the jeenodes here, they are simply an Arduino 328 bootloader chip, plus 3.3V regulator, plus RFM12 transceiver, for $22.50/each. The 433-Mhz will likely have a little better range than 915-Mhz.
http://shop.moderndevice.com/collections/jeelabs

You also need an FTDI cable or FTDI Friend (basically only 1, although 2 goes a little easier) to connect to your PC.
FTDI Serial TTL-232 USB Cable : ID 70 : Adafruit Industries, Unique & fun DIY electronics and kits
FTDI Friend with Micro USB Port + extras [v3] : ID 284 : Adafruit Industries, Unique & fun DIY electronics and kits

Like Arrch said, look at the lowpower labs library.

Personally, I think it's easier to start with something like this, and later maybe do your own designs.

Yes as you are new to all of this i would not recommend buying bare chips etc.

You can get Arduino Minis on EBAY for around $5 - perfect for what you want to do

http://www.ebay.com.au/itm/atmega328-Board-5V-16MHz-Module-For-Arduino-Pro-Mini-/400509178303?pt=AU_B_I_Electrical_Test_Equipment&hash=item5d403511bf&_uhb=1

I would use the Nordic modules personally and if range becomes an issue move from the units with onboard aerial and to the external aerial (around $12 each)

Craig