As warm time of the year approaches, people spend more time outside and there's a need for measuring outside parameters devices.
I connected the sensors and a solar battery to micro:bit device to measure different parameters. This is a very convenient and easy to use a weather station that can run independently without batteries or USB connection to the computer. It contains four sensors - a temperature sensor to get air temperature, a CO2 sensor to receive information about a pollution level, a light level sensor and a moisture sensor to detect the state of the soil for a possible pique-nique on the grass or for sport games.
Each sensor provides specific information:
- A grove temperature sensor gives information about air temperature in C°. It uses a thermistor to detect the ambient temperature. The resistance of a thermistor will increase when the ambient temperature decreases. In general, the most comfortable air temperature for a human is considered to be between 18C° and 24C°.
- A grove light sensor has an integrated photo-resistor to detect the intensity of light and it's resistance decreases when the intensity of light increases. It's considered to be a dark time if the value of the sensor decreases to less than 50 Lux.
- A grove gas sensor (SGP30) is an air quality detection sensor. Output range for CO2 detection is from 400 ppm to 60000 ppm. Normal outdoor level: 350 - 450 ppm.
- A grove soil moisture sensor gives values based on soil resistivity meansurement. The value higher than 300 indicates a humid soil.
.So I connected the sensors to the grove shield for micro:bit:
- CO2 sensor → I2C port
- light sensor → P0 port
- temperature sensor → P1 port
- moisture sensor → P2 port
Then I wrote a code in MicroPython to get values from the sensors (the code is located in the part Attachments). I used Polysilicon solqr pannel and it provides 6V to the micro:bit, but the board authomatically changes it to needed 3, 3V.
But I also added notifications in the sode: micro:bit will display warnings if a sensor value goes out of the range of comfortable and safe parameters. For example, if outside temperature goes below 18 degrees then micro:bit will display "! COLD !" and if the temperature goes higher than 24 degrees then micro:bit will display "! HOT !". The same happens if a light level drops to less than 50 Lux - micro:bit will show a warning "! DARK !". If a solar weather station is located in a polluted place and the value gets higher than 700ppm - micro:bit will display "! POLLUTED !". To check amoisture level you should place a moisture sensor inside the soil and if the value goes higher than 300 - the warning "! HUMID !" will be shown. I added 1 second pause between the appearance on the display of the values of each sensor to avoid information overlap.
I hope that my project Solar weather station will be valuable for everybody!
Comments