Sensor network with ethernet for Home automation

Hi,
I'm new to Arduino, but skilled in programing and eletronics.

I a'm looking to make a dedicates wired network to link sensors to a server on a home automation system.

Thought about Arduino and Ethernet shield, for server and sensors, on a dedicates network, phisicaly separated from me internet home network.

I want to get the server to ask each and every sensor for their state, and also send commands to them.

Can I do this witn Ardunino hardware/software?

I so, can you help on recommending an programming approach to the way to use Ethernet commands library.
I need to
-Ask a specific IP for their state (variable length response)
-Send commands to a specific IP?

Many thanks.
JB

Can I do this witn Ardunino hardware/software?

Certainly.

-Ask a specific IP for their state (variable length response)

Making a GET request is simple. The ethernet library comes with examples.

Send commands to a specific IP?

That, too, would be done by making a GET request.

PaulS:
Certainly.
Making a GET request is simple. The ethernet library comes with examples.
That, too, would be done by making a GET request.

GET request?? I cant find a "GET" command on the Ethernet library reference.
Can you please point me to an code example??

One more thing: will this network be efficient driving dozens of sensors, repeatedly??

Thanks

the Arduino side should be straight forward, use an arduino and Ethernet shield or just one of the cheaper Ethernet adapters (the shield has an SD card slot which you may not need)

two ways of doing this

Each device has a fixed ip address

the automation server sends an UDP message to each sensor in turn , asking its status (or updating its outputs) the sensor then replies with a confirmation packet

or

each sensor picks up an IP address via DHCP, obviously the home automation server wont know what this is, so each sensor will need to send a UDP packet to the home automation server stating its status

I would prefer the first method as you have more control of the data packet timing .

big question is what home automation server ?, is this another arduino or a windows /Linux app?

sureview:
the Arduino side should be straight forward, use an arduino and Ethernet shield or just one of the cheaper Ethernet adapters (the shield has an SD card slot which you may not need)

two ways of doing this

Each device has a fixed ip address

the automation server sends an UDP message to each sensor in turn , asking its status (or updating its outputs) the sensor then replies with a confirmation packet

or

each sensor picks up an IP address via DHCP, obviously the home automation server wont know what this is, so each sensor will need to send a UDP packet to the home automation server stating its status

I would prefer the first method as you have more control of the data packet timing .

big question is what home automation server ?, is this another arduino or a windows /Linux app?

Yes , the first method was on my mind also. :slight_smile:

The server is another Arduino that will compute some actions, store historical data, and will be connected to other systems,. For example this system will command the heating individually on every room, also controls the blinds, and also this will work as an alarm system, connected to a siren and alerting my phone. ( but this will be the second phase...)

How can I use the ethernet library for this task?

Thanks,

thamks

I cant find a “GET” command on the Ethernet library reference.

That’s probably because there isn’t a GET command in the Arduino library. That library manages communication between the Arduino and the ethernet shield. What the Arduino sends to the ethernet shield is sent by the shield to the router and on to the network, JUST LIKE IF YOUR PC SENT THE DATA.

So, learn about client/server communications on the PC BEFORE you try to use an Ethernet shield on an Arduino.

Or, read the damned client example, which makes a GET request.

One more thing: will this network be efficient driving dozens of sensors, repeatedly??

You can’t drive a sensor. How could you possibly make a carbon monoxide sensor generate carbon monoxide to poison the inhabitants of your house? Why would you want to?

You read sensors, to get information. You drive devices, like heaters, air conditioners, speakers, lights, etc.

And, no, the Arduino with Ethernet shield, as a client, can not deal with “dozens” of servers at one time.

You realize, I hope, that each sensor or device will need to be connected to an Arduino, with ethernet shield, acting as server, so that the sensors can be queried and the devices driven. That is going to get quite expen$ive.

I think using the 'get' which is a html command is not the best way of doing it , you would be implementing a full web server/client setup , when in fact you only need a system of sending information over the IP network

there are example of UDP packet send and receive in the standard arduino libraries

PaulS:
That's probably because there isn't a GET command in the Arduino library. That library manages communication between the Arduino and the ethernet shield. What the Arduino sends to the ethernet shield is sent by the shield to the router and on to the network, JUST LIKE IF YOUR PC SENT THE DATA.

So, learn about client/server communications on the PC BEFORE you try to use an Ethernet shield on an Arduino.

Or, read the damned client example, which makes a GET request.

One more thing: will this network be efficient driving dozens of sensors, repeatedly??

You can't drive a sensor. How could you possibly make a carbon monoxide sensor generate carbon monoxide to poison the inhabitants of your house? Why would you want to?

You read sensors, to get information. You drive devices, like heaters, air conditioners, speakers, lights, etc.

And, no, the Arduino with Ethernet shield, as a client, can not deal with "dozens" of servers at one time.

You realize, I hope, that each sensor or device will need to be connected to an Arduino, with ethernet shield, acting as server, so that the sensors can be queried and the devices driven. That is going to get quite expen$ive.

there are many ways I can see this working ....

the maximum number of sensors on the network would be limited by the number of available id address , so assuming you don't want to go down the route of complex subnet addressing, that would be 254, less your server,router and any other devices you may want to use, you could of course have more than one ip address range over the same physical lan, but to keep it simple and to allow for your other lan devices lets say approx. 200

but then

each arduino / lan shield could have more than one function , for example if you had one arduino in each room, it could have a temp sensor, a PIR, window sensor, light sensor. several relay outputs, for blinds, heaters fans, solenoid operated radiator valves etc, and you would still have pins to spare, maybe also include IR out , IR in and a nice LCD display..

the Arduino server could simply Poll its registered devices once every few seconds to get their status and update the device outputs, as we are only sending short UDP packets the load on the LAN would be tiny

each sensor could store the status of any inputs until it gets polled , then reset and wait for the next sensor triggers

with setup you could do a lot....

occupancy sensor, ie if the PIR is triggered , the room is occupied
this could also be used as an alarm trigger

independent room temperature control

blind control

light , with maybe auto dusk to dawn option, or even random switching when your away from home to fake occupancy

the list goes on.....

PaulS:
That's probably because there isn't a GET command in the Arduino library. That library manages communication between the Arduino and the ethernet shield. What the Arduino sends to the ethernet shield is sent by the shield to the router and on to the network, JUST LIKE IF YOUR PC SENT THE DATA.

So, learn about client/server communications on the PC BEFORE you try to use an Ethernet shield on an Arduino.

Or, read the damned client example, which makes a GET request.

One more thing: will this network be efficient driving dozens of sensors, repeatedly??

You can't drive a sensor. How could you possibly make a carbon monoxide sensor generate carbon monoxide to poison the inhabitants of your house? Why would you want to?

You read sensors, to get information. You drive devices, like heaters, air conditioners, speakers, lights, etc.

And, no, the Arduino with Ethernet shield, as a client, can not deal with "dozens" of servers at one time.

You realize, I hope, that each sensor or device will need to be connected to an Arduino, with ethernet shield, acting as server, so that the sensors can be queried and the devices driven. That is going to get quite expen$ive.

When I say drive the sensor, is just to interact: sending and receiving data only.

Also , when I say deal with dozens of sensors , I say sequentially send and receive data to/from every existing sensor and at the end: start all over again. and yes every sensor will have their arduino and ethernet shield.

Thanks

sureview:
there are many ways I can see this working ....

the maximum number of sensors on the network would be limited by the number of available id address , so assuming you don't want to go down the route of complex subnet addressing, that would be 254, less your server,router and any other devices you may want to use, you could of course have more than one ip address range over the same physical lan, but to keep it simple and to allow for your other lan devices lets say approx. 200

but then

each arduino / lan shield could have more than one function , for example if you had one arduino in each room, it could have a temp sensor, a PIR, window sensor, light sensor. several relay outputs, for blinds, heaters fans, solenoid operated radiator valves etc, and you would still have pins to spare, maybe also include IR out , IR in and a nice LCD display..

the Arduino server could simply Poll its registered devices once every few seconds to get their status and update the device outputs, as we are only sending short UDP packets the load on the LAN would be tiny

each sensor could store the status of any inputs until it gets polled , then reset and wait for the next sensor triggers

with setup you could do a lot....

occupancy sensor, ie if the PIR is triggered , the room is occupied
this could also be used as an alarm trigger

independent room temperature control

blind control

light , with maybe auto dusk to dawn option, or even random switching when your away from home to fake occupancy

the list goes on.....

Exactly, and a few functions more, ie: humidity sensor for each room, automatic ventilation, when needed, weather sensors, etc..

and I have AC on most rooms and it would be nice to controle it centrally with PIR from arduino ( if i gat the ir codes for this AC.