first Arduino project - home automation

First post here, so Hi from my end :slight_smile:

I ordered my first Arduino mega with Ethernet shield, but some days will pass before i'll have it to play with it :wink: ... meanwhile I would like to stock myself with various elements for it.

I'm renovating old house to live in for a while, so I decided to play abit with automation.

I plan to measure temperature and humidity in three locations, now I wonder if there is both T&H sensor who would only take one digital input? Otherwise I will use 2 I/O like here.
updated: RHT22 is the way to go :slight_smile:

Now I would also like to monitor power consumption of the flat, I suppose this would do?

For opening the main door lock, I would use RFID reader, this one should do the trick.

The biggest problem I have is what relays to use, I would like to control one relay per digital I/0 and read state if light is on or off with another - DPDT switching relay for monitoring "line", because I will also control lights with normal house switch (pulse). Keep in mind that we are talking about 230V here.

Also, what is the best idea for isolating I/O ... due to 40mA pin limits. I don't mind burning that element while testing and all, I just don't want to destroy arduino :roll_eyes: I also plan to have external 5V input.

Ethernet shield would be used for remote controlling and monitoring, I got my own web server & dedicated VPS so I hope it won't be to hard to realize it.

So ye, hit me with suggestions and corrections, Schematics/examples are appreciated :slight_smile:

I would like to control one relay per digital I/0 and read state if light is on or off with another - DPDT switching relay for monitoring "line"

I don't get this, you don't use relays to monitor inputs.

what is the best idea for isolating I/O ... due to 40mA pin limits.

Depends, if you're referring to driving the relays then a simple transistor will do.

Re the sensors, how far from the Arduino will they be. Driving a long wire might be a problem although people seem to get away with it.


Rob

I don't get this, you don't use relays to monitor inputs.

With two sets of independent contacts, one set operate some gizmo, and the other set as an on/off digital input for the contact status.

I'm starting to get my head around the idea to. I won't be able to use an Ethernet shield yet. But I've read about doing it over serial. I also am Planning on adding a live video feed. and maybe some gauges for light levels heat levels and humidity levels. The live video feed would be to make sure the stuff came on. I will add buttons on the page to control the lights and other things.

Graynomad:

I would like to control one relay per digital I/0 and read state if light is on or off with another - DPDT switching relay for monitoring "line"

I don't get this, you don't use relays to monitor inputs.

what is the best idea for isolating I/O ... due to 40mA pin limits.

Depends, if you're referring to driving the relays then a simple transistor will do.

Re the sensors, how far from the Arduino will they be. Driving a long wire might be a problem although people seem to get away with it.


Rob

Sensors won't be more then 6m from arduino, I hope that's distance that can be covered.

As for relays, zoomkat figured what I mean ye, but still, what relays to use?, and can I connect 5V from arduino directly to digital pin, with 250 ohm resistor between?

the other set as an on/off digital input for the contact status.

OK, a common enough scenario.

You can connect relays directly to the Arduino pin as long as the relay coil is 5v and it doesn't draw more than about 30mA for short periods (40mA is the max, not an operating value).

If you are going to have a relay energized for long periods I'd drop that to 20mA and don't have more that maybe 5 energized at the same time. If you use transistors none of that matters.

Another thing to do is to use "latching" relays. They are mechanically latched and will stay in whatever state you want even with power removed. In this case the above DPDT option is needed so you know what state the relay is in at power up/reset.

6m is way over the standard for I2C, however there are buffer/driver chips that can be used to extend the signals. Have a look for "i2c bus extenders", one example is the P82B715. NXP reckon that's good for 50m.


Rob

but if I use extender, more pins will be used right?

any straight forward guide that would work for my situation?