Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

aoirint/RSSensorArduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSSensorArduino

Program for Arduino to send sensor data of a room environment.

Requirements

Parts

Circuit

[5V]-[Long]Illumi Sensor[Short]-T--[PIN A0]
                                L-[200kΩ]--[GND]
(top view)

            (rounded)
           ___--^--___
[5V]-[Left]Temp Sensor[Right]-[GND]
             [Center]
                 L--[PIN A1]
[GND]---o [Aluminium pieces(electrode)] o---[PIN 2 (PULLUP)]

Data Format

This program transmits data as json via serial port (baudrate=38400).

Sensor data

{
  "type": "sensor",
  "light": 1023,
  "temperature": 1023,
}

The values of light, temperature are examples (Range: [0, 1023]).

Door open/closed data

This is only transmitted when door open state is changed.

{
  "type": "doorSensor",
  "doorState": "open",
}

doorState is open or closed. This value will be open when aluminium pieces connects the circuit.

Temperature Calculation & Calibration

Temperature can be calculated like below (temperatureRaw is temperature in json).

#define TMPR_VOLT            5.0
#define TMPR_V_OFFSET        0.6
#define TMPR_DEGREE_PER_VOLT 0.01

float v0 = (float)temperatureRaw / 1023 * TMPR_VOLT;
float temperature = (v0 - TMPR_V_OFFSET) / TMPR_DEGREE_PER_VOLT;

Probably some offset (calibration) is required (I needed to subtract about 10℃). Use another thermometer.

About

RoomSystem - Arduino Program for Sensing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages