This repository contains materials and instructions of practicing a partial function, security sensing, on Andbot. Details described below are divided into two section--hardware configurations and ROS implementation for upper level application. Other devices, Rugby, for example, can also use the following sensing methods.
- Table of contents
- Hardware configurations
- Sensor list
- Installation on Andbot
- Upload code
- Sensor information published by using ROS
- Sensor Active List
- Topics of each sensor
- Specifications and other useful reference of each sensor
- Hardware configurations
- 2016/06/13--MQ9 have been removed from this project because it has similar features compared to MQ2. On the way of using MQ2 we select an alarm point 200ppm on CO Curve due to the fact that people usually cannot stand 200ppm of CO within 2~3hrs indoors according to safty level on [this] (http://www.nfa.gov.tw/main/Unit.aspx?ID=&MenuID=500&ListID=316) list. Also, the alarm point is before other detectable gases; that is, when readings from MQ2 increases, unknown but dangerous gases would be exist in certain space. We should be aware of the readings before sensor alarming.
- 2016/06/08--I have acquired two different type of Dust sensing earlier today, and they are on the testing schedule.
Item | Amount |
---|---|
MQ2 gas sensor | 1 |
DHT22 Temperature-Humidity sensor | 1 |
Flame sensor | 1 |
Dust sensor | 1 |
Motion sensor PIR | 1 |
Note: MQ9 has been removed from the list. Note: Order of sensor has been defined. Please follow this in any future discussion.
Please note: Sensor type of the Dust sensing are still on the discussion.
==========================================================
- metal1 --> head MEGA 2560 board
- Pin configuration
Please be carefull while setting up hardwares, and check twice before turning power on.
Input/Output | Pins |
---|---|
MQ2_PIN | A1 (Analog) |
DHT22_PIN | 22 (Digital) |
Flame_PIN | A0 (Analog) |
Dust_PIN_AI | A3 (Analog) |
Dust_PIN_DO | 25 (Digital) |
PIR_PIN | 23 (Digital) |
Please refer to the section--Specifications and other useful reference of each sensor if you encounters any problem.
==========================================================
All programs are included in this repository.
- Please copy all of files in the "lib" folder to Arduino/library. (This is critical because it cannot be complie without those libraries.)
- Main code: Please refer to folder MetalHeadVerROSSensingLED.
- ROS Usage:
- Open a terminal and type "roscore".
- Open another terminal and type "rosrun rosserial_python serial_node.py /dev/ttyACM0 _baud:=57600". Note: ttyACM0 refers to your serial port. It might be ttyACM1 or other.
- Open another terminal and type "rostopic list" to check ROS topics are ready.
- Type "rostopic echo /....." to listen to any topic.
Folder "Temporary Version" and "src" are debugging Version, and folder "MetalHeadPreviousVersion" contains program that will only turn the LED on. Please be aware! Do not use them.
Topic of sensors will be published in every 2 seconds due to some of the sensor requirements. Moreover, there will be 2 more seconds at the beginning for sensor warmup.
- ROS
- Topic: /SensorActiveList
- Msg type: UInt8MultiArray (Lib: std_msgs::UInt8MultiArray)
- Sensor ID definition:
Sensor | ID |
---|---|
MQ2 | 0 |
DHT22 | 1 |
Flame | 2 |
PM2.5 | 3 |
PIR | 4 |
- Output format: Analog (intensity)
- ROS
- Topic: /MQ2CO
- Msg type: float (Lib: std_msgs::Float32)
- Output: ppm (Approximation is derived from datasheet; please refer to section--Specifications and other useful reference of each sensor for details.)
- Alarm point: CO: over 200 ppm
- Output format: Analog (intensity)
- ROS
- Topic:
- Msg type: float (Lib: std_msgs::Float32)
- Output: ppm (Approximation is derived from datasheet; please refer to section--Specifications and other useful reference of each sensor for details.)
- Pending reason: We believe that this breakout board were designed not properly. There is no adjustable resistance for analog output.
- Output format: Digital
- ROS
- Topic: /CurTemperature
- Topic: /CurHumidity
- Msg type: double (Lib: sensor_msgs/Temperature & sensor_msgs/RelativeHumidity)
- Output format: Analog (intensity)
- ROS
- Topic: /FlameDetection
- Msg type: float (Lib: std_msgs::Float32)
- Value: 0 ~ 1023
- alarm point: greater than 100
- Output format: analog
- Physical meaning: signal can be transfered to Dust Density
- ROS
- Topic: /PM2dot5Detection
- Msg type: float (Lib: std_msgs::Float32)
- Unit: ug/m3
- Output format: Digital
- ROS
- Topic: /MotionDetection
- Msg type: Boolean (Lib: std_msgs/Bool)
Pay attention: Once the IR signal disappears, the output pin will output low level delay roughly 2.3~3 seconds.
- Supply Voltage: 5V
- Adjustable resistance RL = 10K ohm
- This sensor is suitable for detecting LPG, i-butane, propane, methane ,alcohol, Hydrogen, smoke.
- Preheat time: 24hr
- This sensor is pretty sensitive to temperature and humidity.
- Sensor calibration procedure (written in the code already):
- Before running Calibration:
- It must be placed in anywhere with clean air.
- Tune RL to 5k ohm, which is adjustable resistance on the sensor.
- Calibrating sensor resistance Ro in clean air:
- Pre-defined factor: Ro Clean Air factor. (Rs in clean air under given temperature and humidity is a constant,which is the “initial” resistance of the sensor named Ro.)
- Ro = Rs (sensor reading average in 500 samples) / Rfactor (derived from the datasheet)
- Before running Calibration:
- Measuring gas * Pre-defined factor: LPGCurve; COCurve; SMOKECurve. (logy = a * logx + b) * Calculation: gas (ppm) = 10 ^ ( a * logx + b)
- Reference
- Supply Voltage: 5V
- Concentration:
- 10-1000ppm CO
- 100-10000ppm combustible gas
- Good sensitivity to CO/Combustible gas
- High sensitivity to Methane, Propane and CO
- Preheat time: 48hr
- This sensor is pretty sensitive to temperature and humidity. We desided not to use onboard digital output due to its unknown programmed threshold for alarm.
- Sensor calibration procedure (written in the code already):
- Before running Calibration:
- It must be placed in anywhere with clean air.
- Calibrating sensor resistance Ro in clean air:
- Pre-defined factor: Ro Clean Air factor. Rs in clean air under given temperature and humidity is a constant,which is the “initial” resistance of the sensor named Ro.
- Ro = Rs (sensor reading average in 500 samples) / Rfactor (derived from the datasheet)
- Before running Calibration:
- Measuring gas
- Pre-defined factor: LPGCurve; COCurve; SMOKECurve. (logy = a * logx + b)
- Calculation: gas (ppm) = 10 ^ ( a * logx + b)
- Reference
- Output: alibrated digital signal
- Power: 3.3~5.5V
- Sensing range:
- Humidity: 0-100% RH
- Temperature: -40 ~ 80 Celsius
- Resolution:
- Humidity: 0.1% RH;
- Temperature: 0.1 Celsius
- Accuracy:
- Humidity: +-2% RH (Max+-5%RH)
- Temperature: +-0.5 Celsius
- Reference
- Supply Voltage: 3.3V to 5V
- Detection range: 20cm (4.8V) ~ 100cm (1V)
- Rang of Spectral Bandwidth : 760nm to 1100nm
- Responsive time : 15us
- Interface: Analog
- The flame sensor's operating temperature is -25 degrees Celsius to 85 degrees Celsius, in the course of the flame it should be noted that the probe distance from the flame should not be too close inorder to avoid damage.
- Reference
- Supply voltage: 5-7V
- Operating temperature: -10-65 Celsius
- Output range:
- Be aware of the wire color and pinout when setting up.
- Reference
- Input type: pyroelectic infrared. detecting infrared signals from moving person or animals.
- Output: switching signals High 3V Low 0V
- Power input: 3.3~5 V (It should not be bigger than 6V)
- Applications: body movements
- Working current: 15uA
- Detection distance: 7 m
- Reference