Let's get started with the first component: The Receiver.
Here is it still as a prototype
It's made up by an Arduino Uno Board, with the ethernet shield to get network access and the wireless RF433 receiver
Functionality and communication protocols
The wireless receiver receives messages sent by sensors and then route them towards WEB/APP server, using http protocol. It acts as a simple router.
Communication protocols are very simple and currently not secure, so for now this system cannot be in a public network.
The message sent by sensors is a character string made up in the following way:
SENSOR;VALUE;STATUS|
where SENSOR is the name of the sensor; VALUE is the current value of the sensor and STATUS is a particular condition for the sensor (DANGER, WARNING, and so on...)
The receiver gets this string and send it to the WEB/APP server, using the following HTTP GET request:
http://SERVERNAME/data.php?u=PASSWORD&d=STRING
where SERVERNAME is the domain in which WEB App is installed, PASSWORD is a secret key known also by the WEB/APP server and STRING is the sensor's data.
As already said, communication protocol is very simple and without ACK...for now it's just a prototype and it aims only to debug system
HARDWARE
Fritzling Schema (approx)
PIN 2 OUTPUT for RF status led (RED), reporting wireless activity;
PIN 3 OUTPUT for ETH status led (GREEN), reporting ethernet activity;
PIN 5V to power up wireless received and led;
PIN GND linked to wireless receiver GND pin;
PIN 7 INPUT to receive wireless data;
The Ethernet shield is linked to Arduino UNO; all the system is powered up by external 5V.
SOFTWARE
Setup
- wireless receiver setup using RadioHead library;
- ethernet shield setup using standard Ethernet library; it this case we use a static IP (but you can use DHCP if your network provides it);
- status led setup;
Main Loop
- the main thread wait for a wireless message;
- after received a new message, RF status led lights up and the message is sent to WEB/APP server using HTTP request;
- during the http request, ETH status led lights up and it turns off after the HTTP response;
Here you can find source code for the receiver: DOWNLOAD
And here is a video about the receiver doing its job...
No comments:
Post a Comment