Adding flame sensor, pir, dht11 and gas sensor on ethernet


#1

Hi everyone. I am doing a project on home security and i want to see all my sensors on thinger dashboard. Can you help me with the codes? I started using Arduino for 1 month only and i would really appreciate your help.


#2

Can you post what you have so far?

How many Devices are you using? from each device you can create multiple resources, and multiple values in that resource.

This Example shows how one device can send multiple sensor readings using a resource.

thing[“SensorInputs”] >> [] (pson& out){
out[“Sensor_1_Output”] = Sensor_1_Reading;
out[“Sensor_2_Output”] = Sensor_2_Reading;
out[“Sensor_3_Output”] = Sensor_3_Reading;
out[“Sensor_4_Output”] = Sensor_4_Reading;
out[“Sensor_5_Output”] = Sensor_5_Reading;
}


#3

Hello,
Thanks for responding. Here where am at with the sensor(s).

Thanks for taking your time and helping.
Regards.


#4

The sensors that am using are;

  1. DHT11(temperature)
  2. Gas sensor(MQ 135)
  3. Flame sensor
  4. Water sensor
  5. Pir(motion) sensor

#5

Hello Navisen, For security reasons, when posting your code you should remove your username, deviceName, and Passkey. so that no one can fake your data, I would suggest changing them up.

Since you are a beginner to Android I would suggest doing some tutorials on each one of your sensors. once you feel like you understand the code and how to pull the data from the sensor, then add it to your thinger resource. in your code this would be the thing[“dht11”]. you could either add another one or change dht11 to what every you want.


#6

Hello,
Thanks for responding. I already have the programs for each sensor but I don’t know if compiling them together, I will be able to view them on thinger. Each sensor works fine and I have their programs. I just need to know how to add multiple sensors and if I need to include their libraries when compiling.

Regards.


#7

Hello Navisen, Yes you will need to add the necessary liberarys for each sensor to work. IE # include “DHT.h”, As to how you want to program to operate there are many ways to do it. Adding additional outs to your resources would send information to the thinger server. Or you could add a different resource for each sensor. But that is up to how you want to organize your information. If you send me a sample of one of your other codes I could try and make a quick example for you.


#8

Hello,
Thanks for responding. I want to implement a gas sensor(MQ135) to my program and visualize it on thinger dashboard.

Regards.


#9

Ok great, so basic implementation would be you would still need to setup everything.

thing[“SmokeSensor”] >>[](pson& out){
out["smokeValue] = analogRead(smokeA0);
}

if you want a boolien value also then:

thing[“SmokeSensor”] >>[](pson& out){
analogSensor = analogRead(smokeA0);
out["smokeValue] = analogSensor ;
if (analogSensor - 100 > sensorThres)
{
out[“alarm”] = true;
}
else
{
out[“alarm”] = false;
}
}


#10

Hello,
Thanks for helping me. I know its taking your time for helping me and i appreciate it. Am having \stray 342 when compiling. Can you help?

Regards.


#11

Hello Navisen,

  1. You need to define the variable smokeA0. and what the value of it is.
  2. you are missing a " a the end of smokeValue in your SmokeSensor Resource.
  3. You need to setup your pin mode, to read the analog pin.

Let me know if this doesn’t make sense and I will try to go through your code and explain what the different parts do.


#12

Hello shnapps,
I’ve understand the first part you said and not the other parts. Can you please help me?

Regards.