FFS! Give your list a story!

General wisdom among indie authors is that if you maintain one marketing tactic to help your writing business, make it an author email list. I completely agree with this, and it’s rare for me to…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Measuring CO2 with ESP8266 and MicroPython

As I wrote in Monitoring Air Quality Open Data I wanted to build a small device for monitoring the air quality and noxious gases, and since lately I have been hacking with Python for the ESP, I wanted to do it with MicroPython.

Most of the experiments, libraries and calibration details related to the MQ135 are based on two main articles:

Note: R0 (RZERO) may have different values in different sensors, so in case you want to have your sensor calibrated more precisely it is recommended to follow the next steps:

In case you want to test the device yourself, you need to install MicroPython for the ESP8266 first.

Install ESPtool (the bootloader utility for ESP8266)

Erase the flash and deploy MicroPython firmware

Then, clone or download the MQ135 git repository

and then connect to the device with the serial communication program (e.g.: minicom) to see the output.

MicroPython could be configured to load a script after the device boot. If you want to load the code just after the boot, use:

The required hardware is just a breadboard, some wires and:

This is the final prototype, including the Wemos D1 mini and the MQ135 and DHT11 sensors.

Wemos D1 mini + MQ135 + DHT11

Dweet allows to easily upload to the cloud the values you got from your sensors and Freeboard is used to visualize the data in a dashboard.

For uploading the data to Dweet is enough to define the URL with a unique name (line 21) for logging your data, and then use Python urequest to get the URL with the parameters (lines 41–45).

Once the device is uploading data to the cloud you could see in the next URL if the data is being recorded in Dweet.

Dweet and Freeboard are well integrated, so, to show the data in the dashboard it is enough to add dweet.io as datasource, then add new pane to your dashboard and a gauge or text widget with the variable you want in the value field. The result could be something similar to this:

Freeboard MQ135+DHT11 dashboard

Add a comment

Related posts:

The Infamous Slap Of Kabir Singh!

The Infamous Slap Of Kabir Singh is totally justifiable and acceptable!. Never in the history of Indian Cinema was a movie so severely criticized for its general portrayal of a man with clinical anger issues and….

Vengeance From The Grave Part 8

My name is Henry Allen James, and I’m Roberto De La Cruz, and we’re writers for Dark Sides of the Truth magazine. What Roberto found wasn’t much, but at least we had a starting place. Of the hundreds…

eu me tenho

Estava acomodada demais com a ideia de ser de alguém, de ser pra alguém. De repente você se vê sozinha de novo e se desespera. Mas por sorte me dei algo que eu precisava: tempo. E ter um tempo…