Disclaimer

Please, proceed carefully following the tips published in this blog, specially when Main Power is involved. I'm not responsible for any damages caused by what is written in this blog.
Thank you
Showing posts with label sensor. Show all posts
Showing posts with label sensor. Show all posts

Saturday, 29 August 2015

Data Acquisition - Remote Gas Detector




Now, it's time to connect a remote sensor to my new receiver and begin a real data acquisition.

I think I'll go back to my sensor gas prototype...I already made some experiments with it:

First experiment: a simple gas detector

I'm going to use it as a remote gas sensor with MQ-4 [Datasheet].



and a wireless RF-433 transmitter.


with a lot of wire, led and a push button to reset sensor status.

HARDWARE

This is the fritzling design:


As well as Wireless transmitter and gas sensor, we could see a red led, a green led and a RGB led. On the left side of the schema, there is also a push button. Led are powered by Arduino 5V power line, protected by resistors...Arduino is powered by a 12V transformer just like the wireless transmitter, to ensure the best transmission power.

PIN 11: push-button

PIN A1: analogue pin linked to GAS sensor

PIN 9: wireless data transmission

PIN 12: red led for wireless activity indication
PIN 8: green led for data acquisition activity
PIN 3, 5 and 6: RGB led for showing system status
 - off: normal values;
 - yellow: an out of tolerance value under the danger threshold;
 - rosso: an out of tolerance value over the danger threshold;

Here is it:



FUNCTIONALITY AND MESSAGES

When the system is powered up, the gas sensor warm up stage starts; this is necessary to ensure better precision...during this time, RGB led blinks.

Then, data acquisition starts.

Every second the system gets 10 samples data from the sensor (the green led flashes every second) and calculates the average...Every 5 seconds the average of the collected values is sent to the receiver (the red led flashes every 5 seconds).

When the average is out of tolerance, RGB led lights up.

The push buttons reset the system status and turns off the RGB led. If a value is out of tolerance and then other samples return to normal values, the led still lights on...to get the attention...only through the push button, led could be turned off.

The wireless data sent every 5 seconds is a text string with the following format:

GAS;VALUE;STATUS|

VALUE is the calculated average, STATUS is a numeric value indicating the system status according to the following schema:

 - 1: ok;
 - 2: warning
 - 3: danger

SOFTWARE

You can download the complete Arduino Sketch from here:

DOWNLOAD

As for the receiver, I used RADIOHEAD libraries to manage wireless transmitter.

Setup:

- wireless receiver setup;

- status led setup;

- MQ-4 sensor warm up;

Main loop:

- First, the system checks the push button status...If it was pressed, the variable which manages the system status will be set to OFF;

- Then, the system read 10 samples from the gas sensor and calculates their average; during this time the green led lights up (PIN 8);

- Every 5 seconds the system calculates the average and set the system status according to this value; then, this value is sent to the receiver;

- In case of out of tolerance value, RGB status led (PIN 3, 5 e 6) will light up;

- The average value is sent to the receiver; during this time the green led (PIN 12) will light up;

And finally, here is a short video:



Saturday, 1 August 2015

My first project - data acquisition system




I started design my first data-acquisition system with Raspberry PI and Arduino. The idea is to have a sensors network which send data to a receiver which, through ethernet, send these data to WEB/APP server.

The main components are:

- one or more sensors
- a receiver
- a DB Server for storage purpouse
- a WEB/APP server to acquire data and let remote user monitoring the system

Here is the design:



More details:

SENSORS

They can send data in different ways:

- wireless RF-433 towards receiver
- ethernet towards receiver
- USB directly towards server

They can be Arduino board or Raspberry PI or others...
Depending on the type of communication, there can be other interface boards or control led...

RECEIVER

It receives data via wireless RF-433 or via Ethernet
Through ethernet, it transmits data to WEB/APP server, for storage and monitoring purpose

It's built over an Arduino boards with Ethernet Shield and wireless RF-433 receiver. There are also control led.

WEB/APP SERVER

It receives data from receiver through ethernet or from sensor directly connected on its USB port
It stores data on DB server
It runs a web application for remote monitoring

The WEP/APP server software is the world famous Apache HTTPD, installed on Raspberry, running Fedora linux distro.

The monitoring web application is written in PHP / HTML5 using Bootstrap framework, which make it responsive.

DB SERVER

It stores data received from WEB/APP server.

The RDBMS is Mysql Community Edition installed on the same Raspberry of WEB/APP server