Both sides previous revisionPrevious revisionNext revision | Previous revision |
en:iot-open:hardware2:sensors_environment [2023/11/21 21:37] – ktokarz | en:iot-open:hardware2:sensors_environment [2024/05/27 12:07] (current) – ktokarz |
---|
====== Environment Sensors ====== | ====== Environment Sensors ====== |
| {{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\ |
== Temperature Sensor == | == Temperature Sensor == |
A temperature sensor is a device used to determine the temperature of the surrounding environment. Most temperature sensors work on the principle that the material's resistance changes depending on its temperature. The most common temperature sensors are: | A temperature sensor is a device used to determine the temperature of the surrounding environment. Most temperature sensors work on the principle that the material's resistance changes depending on its temperature. The most common temperature sensors are: |
| |
</code> | </code> |
| |
| <note>Digital temperature sensors using 1-Wire are handy when communication speed is not crucial. 1-Wire offers longer distance and less cabling compared, e.g. to I2C and SPI.</note> |
| |
== Humidity Sensor == | == Humidity Sensor == |
| |
<figure humiditysensor2> | <figure humiditysensor2> |
{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_humidity.png?200 | Arduino Uno and humidity sensor schematics}} | {{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_humidity.png?230 | Arduino Uno and humidity sensor schematics}} |
<caption>Arduino Uno and humidity sensor schematics</caption> | <caption>Arduino Uno and humidity sensor schematics</caption> |
</figure> | </figure> |
} | } |
</code> | </code> |
| |
| <note important>DHT sensors use their own One Wire communication standard that is incompatible with standard 1-Wire, even if it uses a similar connection schema.</note> |
| |
== Sound Sensor == | == Sound Sensor == |
| |
<figure gassensor2> | <figure gassensor2> |
{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_gas.png?200 | Arduino Uno and MQ2 gas sensor schematics}} | {{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_gas.png?230 | Arduino Uno and MQ2 gas sensor schematics}} |
<caption>Arduino Uno and MQ2 gas sensor schematics</caption> | <caption>Arduino Uno and MQ2 gas sensor schematics</caption> |
</figure> | </figure> |
<code c> | <code c> |
#include <HardwareSerial.h> | #include <HardwareSerial.h> |
#include >Arduino.h> | #include <Arduino.h> |
| |
// Define the serial port for the PMS5003 sensor | // Define the serial port for the PMS5003 sensor |
Serial.begin(9600); | Serial.begin(9600); |
| |
pinMode(SET_PIN, OUTPUT); //controls sensor's low power mode (LOW) -> controls fan down | pinMode(SET_PIN, OUTPUT); //controls sensor's low power mode |
| //(LOW) -> turns fan down |
pinMode(RESET_PIN, OUTPUT); //controls sensor's reset (LOW) | pinMode(RESET_PIN, OUTPUT); //controls sensor's reset (LOW) |
digitalWrite(SET_PIN, HIGH); //enable both | digitalWrite(SET_PIN, HIGH); //enable both |
| |
<figure sensor_bme280_2> | <figure sensor_bme280_2> |
{{ :en:iot-open:hardware2:bme280_schematics.png?200 | BME 280 connection circuit (I2C)}} | {{ :en:iot-open:hardware2:bme280_schematics.png?230 | BME 280 connection circuit (I2C)}} |
<caption>BME 280 connection circuit (I2C)</caption> | <caption>BME 280 connection circuit (I2C)</caption> |
</figure> | </figure> |