-
Notifications
You must be signed in to change notification settings - Fork 0
Sensors
The tiny house contains 8 sensors, which are taking 12 measurements. Each measurement has an unique ID for the EPF API.
sensor | measure | unit | API ID |
---|---|---|---|
DHT22 1 | upper air layer humidity | %RH | 57 |
DHT22 1 | upper air layer temperature | °C | 58 |
DHT22 2 | lower air layer humidity | %RH | 59 |
DHT22 2 | lower air layer temperature | °C | 60 |
DHT22 3 | upper tube humidity | %RH | 67 |
DHT22 3 | upper tube temperature | °C | 68 |
DHT22 4 | lower tube humidity | %RH | 69 |
DHT22 4 | lower tube temperature | °C | 70 |
Thermocouple 1 | upper surface temperature | °C | 61 |
Thermocouple 2 | lower surface temperature | °C | 62 |
Pyranometer | irradiance | W/M² | 52 |
Anemometer | outside wind speed | km/h | 53 |
The following diagram shows their locations on the prototype.
The collected values are accessible at https://preprodapi.mde.epf.fr/measure.php?id=<id>, where <id>
is a number corresponding to the sensor ID.
It is recommended to test each sensor individually before the whole system, here are the individual circuits associated to each sensor type, the code are stored on the P5A-Enerlog/sensor_testing repository.
This sensor is often used with Arduino, thus its documentation can be easily found.
measure | unit | min value | max value | accuracy |
---|---|---|---|---|
temperature | °C | -40 | +125 | ±2°C |
humidity | %RH | 0 | 100 | 2-5% |
The Max6675 is measuring a surface temperature, it can work between -20 and +80 °C but can measure higher temperatures.
measure | unit | min value | max value | accuracy |
---|---|---|---|---|
surface temperature | °C | 0 | +1024 | ±0.25°C |
power supply | 5.5 to 24 V DC |
sensitivity | 2.5 mV per W.m⁻² |
spectral range | 360 to 1120 nm |
The pyranometer is a bit difficult to calibrate, as the response is not linear, a post processing may have to be done. Also, the sensor output needs to be adjusted to the ESP32.
We measured the maximum voltage output from the sensor with an artifical light, and reached 4.6 V. As the ESP32 pins can only receive up to 3.3 V, a voltage divider can be used to have the supported range. Based on the following diagram, the maximum received voltage is
This value will be read by the ESP32 as an int between 0 and 4096, due to its 12 bits ADC (Analog to Digital Converter).
The final irradiance value is obtained with the following conversion:
The 0.4 is coming from the datasheet (1/sensitivity) but may have to be adapted because of the voltage divider.
A strange observation is that during night the sensor is giving values around 600 W.m⁻²
WiFi needs to be turned off when sensing with an analog pin due to the ESP32 ADC
An anemometer is actually equivalent to a switch that is activated at every revolution, and the ESP32 will count the occurences of activations over a certain time (we defined it to 10 seconds to have a smoothed average). According to the datasheet, one turn per second equals a wind speed of 2.4 km/h, so the wind speed is obtained with:
This blog explains it well, they use 5 V but this signal is then sent to the Arduino board, we noticed that in our case 3.3 V is better and works fine (otherwise the board is receiving 5 V and can be damaged).
The two wires from the anemometer can be inverted, that is why there is no distinction on the diagram.
The 12 V computer fan used can be replaced by any other fan, as long as the power supply is adapted. An analog output from the ESP32 is controlling how much voltage is granted to the fan and so the resulting wind speed.