This project is a demand-controlled ventilation using an air quality detection sensor than present real-time status on Arduino Cloud and turning on a fan when it's necessary. Arduino Cloud provides an easy to use an online platform for a complete, secure and interoperable IoT solution. This project tests the interoperability with other things like Rasperry PI using python code provided on GitHub by Arduino.
In the next image show the eCO2 Gas Sensor (SGP30) connected to I2C port on the raspberry pi. It takes an equivalent C02 value every second, until the value is under a predefined parameter each 20 sample the average value of these 20 samples is send to Arduino Cloud for hold a history data. When the value is higher that predefined parameter the fan turn on and the sample is sent immediately to Arduino Cloud and the status of fan is updated in dashboard in real-time. The fan is controlled with a relay connected to one GPIO.
The circuit for build the project can be implemented on protoboard and jumpers, without soldering points. In the next image preset details for the implementation, the sensor is connected to I2C port 1 and just using one OUTPUT connect to a relay module, this relay closes the circuit for gives the 12 VDC to the fan:
The code was written in python and connect to Arduino Cloud and show the information of VCO2 and fan state on a dashboard. Arduino Cloud provides all information needed to connect to it. First you need to create a new “think” and get a code for login to the cloud, Second define the parameters, then make for dashboard with a lot of widgets for built a great user experience. The python modules are public on Arduino´s GitHub, and full code on my GitHub with one correction on one dependency “senml” of arduino-iot-cloud. Once the think is configured update value on Arduino Cloud it is easy, just update the parameter in the python code and then it is refreshed on the cloud in real-time! For program you can use any python IDE but for Debug you can install Visual Studio Code on Raspbian.
For test, the raspberry must connect to internet, after run the code it connect to Arduino Cloud and you can see the information on the dashboard, it works in real time on web and android Arduino Cloud App. This proves the interoperability works perfectly!
Comments
Please log in or sign up to comment.