A CO2 meter with high quality colour TFT display with colour screenconnection with your mobile phone via BluetoothThe new, Wifi communication, ESP-NOW and MQTT, which you can take with you everywhere thanks to its rechargeable battery (optional) and know how, discreetly and at all timesthe quality of the air you breathe.
Here I bring you the meter TUTORIAL FOR THE CONSTRUCTION OF THE CO2 GADGET HARDWARE. The most advanced CO2 meter in existence (that I know of, at least).
Contents
This tutorial is accompanied by a video, which you can find below, with everything explained step by step and in detail so that you can build the CO2 meter with TFT colour display., CO2 Gadget, easily.
You are going to see, in a very easy way, how to prepare the hardware for the CO2 Gadget and how connect the SCD30 sensor to the TTGO T-Display Board
Below you'll find something I'm sure you'll love: My own extended and improved version of the CO2 Gadget firmware with new interesting features:
- Multiple communication modes: Bluetooth, WIFI, and ESP-Now
- More sensors supported, including CO2, temperature, humidity and pressure sensors.
- Support for more screens
- Sending data via MQTT
- Works with many different sensors and displays
This tutorial contains my own improved version, with colour display and rechargeable batteryfrom another previously published project: Mobile CO2 meter with ESP32 and Sensirion SCD30 sensor. If you haven't seen it yet, I suggest you watch it now, because it contains basic information:
Material required
To complete this tutorial, and build your own CO2 meter with TFT colour display, CO2 Gadgetyou will need:
- A TTGO T-Display Board with TFT colour display
- A Sensirion SCD30 Sensor
- A few wires to make the connections
- One rechargeable li-ion battery (optional)
- USB-C cable to connect the TTGO T-Display Board to your computer
Below, in the "Shopping basket" section, I will give you some examples of what you can buy. advice on equipment to buyas well as some useful links to places where you can buy them. at a good price and with guarantees.
Preparing the Hardware
The preparation of the CO2 Gadget hardware is very simple.
I give you two options for mounting: a version in which the sensor and the board are connected by means of small cables and a version in which the sensor and the board are connected by means of small cables and a version in which the sensor and the board are connected by means of small cables. super compact in which sensor and board are bonded together as a single compact block.
Normal" version
For the first version, carefully plug in the TTGO T-Display Board at Sensirion SCD30 Sensor as explained below. Pay attention to each wire so that it goes from the correct pin on the sensor to the correct pin on the board..
You have to connect by means of some wires:
- The VIN pin of the SCD30 to the pin marked 3V on the TTGO board.
- The GND pin of the SCD30 to the pin marked G on the TTGO board.
- SCL pin from SCD30 to pin marked 22 on the TTGO board
- The SDA pin of the SCD30 to the pin marked 21 on the TTGO board.
Sandwich version
The aim of this assembly is to achieve a CO2 meter with a TFT colour display. as compact as possible.
The sandwich version of the meter is connected by means of a pins or hard wires. In this way the TTGO T-Display Board and the Sensirion SCD30 Sensor form a single block.
- The VIN pin of the SCD30 to the pin marked 3V on the TTGO board.
- The GND pin of the SCD30 to the pin marked G on the TTGO board.
- SCD30 SCL pin to the marked pin 21 of the TTGO plate
- The SDA pin of the SCD30 to the marked pin 22 of the TTGO plate
Note that the difference with the normal version is that pins 21 and 22 are reversed.
Below is the video with all the assembly details of this version.
Note that this version is very compact and that the heat generated will affect the temperature sensor and will not be very accurate (in the advanced firmware version, you can enable a temperature offset and disable the temperature display, if you want).
The shopping basket
Here are a few tips and links to websites where you can find buy the materials.
Buying the components from these links will ensure that you get exactly the same components as in the tutorial and that everything matches (not all boards, for example, even if they look almost the same and have the same name, have all the pins in the same place or are labelled in the same way) and you will avoid possible fraud or counterfeiting.
Buy the Sensirion SCD30 sensor
This is the same AliExpress shop where I bought it and it arrived at home in 7 days..
Almost all eMariete users have purchased the sensor from this link and received it quickly.
I recommend you buy it here: Sensirion SCD30 Sensor
You also have the option to buy the sensor on Amazon. It is more expensive, but you will have it at home quickly.
- Model: SCD30
- Name: air quality sensor
Buy the LILYGO® TTGO T-Display
This is the official shop of LILYGO®, the manufacturer of the board, so you have the guarantee of seriousness and that the board is original.
I recommend you buy it here: TTGO T-Display Board
You will see that there are several versions. I recommend that you buy the one that says "4MB CH340K Chip".
Versions with 16MB are currently not supported.
You also have the option of buying the plate on Amazon. It is slightly more expensive, but you will have it at home quickly.
- Chipset: ESPRESSIF-ESP32 (Wi-Fi and Bluetooth) LX6 32-bit Xtensa 240MHz single core/dual core microprocessor
- FLASH: QSPI flash 4MB / PSRAM 8MB
- Display: IPS ST7789V 1.14 inch, USB: C-Type
- Working current: approx. 67MA, quiescent current: approx. 350uA
- Modular interface: UART 、 SPI 、 SDIO 、 I2C 、 LED PWM 、 TV PWM 、 I2S 、 IRGPIO 、 ADC capacitor touch sensor pre-amplifier DACLNA preamplifier
Step-by-step video tutorial
In the following video you will find step-by-step instructions for the construction of the CO2 Gadget meter to make it very easy for you to assemble it.
Update from the video
If you want to to achieve an even cleaner assemblyThe power supply cable of the sensor can be positioned in this way:
Note that you will have to remove the plastic from the last pin of the strip in order to solder the positive from the inside (I recommend you do this formerly welding the sandwich, it will be much easier for you).
Making these videos takes a lot of work. If you like the video don't forget to like and subscribe to the channel. That will motivate me to keep making more videos like these.
3D printed box
With the idea of the CO2 Gadget being a small and compact meter, which you can take anywhere, ideally you should use a 3D printed box.
Here you have a collection of boxes, specifically designed for CO2 gadgets, to give your project an almost professional result:
Cellular Polypropylene (PP) Boxes
If you don't have access to a 3D printer, you can make a cellular polypropylene (PP) box very easily.
Here is the complete step-by-step tutorial:
Use with battery
The first thing you have to bear in mind, in order to have the right expectations, is that this is not a low power meter, although it can be powered by batteries. so you can easily take it with you wherever you go.
The TTGO T-Display board features built-in battery charger and charge the battery connected to about 300mA (default, but can be changed by replacing a resistor) when connected via USB.
The primary use of this meter is connected to a power supply or charger and the battery is an extra to use it autonomously for a few hours from time to time. Of course, there's nothing to stop you from adding as big a battery as you like and getting much longer battery life.
In the picture below you can see one of the 3D printed case prototypes with an 800mAh battery.
In the following image you can see the consumption profile of the meter for 10 seconds:
As you can see, the meter consumes approximately 97mAwhich can be rounded up to 100mA.
This means that we would theoretically have an autonomy of approximately 10 hours of continuous operation with a 1000mAh batteryThe battery life is about 20 hours with a 2000mAh battery and about 35 hours with a 3500mAh 18650 battery. In practice, the battery life will be shorter because the hardware is not particularly optimised and will not be able to squeeze all the power out of the battery.
Please note that, as with any battery-powered device, you must use a battery that has the appropriate protections. At a minimum the battery should have short circuit, overcharge, over-discharge, and over-current protection.
Many batteries include these protections, but if yours does not, you will need to fit a protection plate like this one:
Battery protection
Battery protection plate on AliExpressAdvanced CO2 Gadget firmware
The CO2 Gadget firmware is one of the most advanced available, both in devices made by makers and in commercial devices, and has many advanced features.
In the following article you can see all about the firmware for CO2 Gadget, as well as the instructions to record it in the meter we have just built, with just a couple of clicks and without the need to install anything on your computer.
Having problems? Meter Frequently Asked Questions
Although the project is very straightforward, there is always the possibility that you may have a question or a problem.
In this list you will find answers to the most common questions and doubts.
Share this article
Thank you very much for collaborating with the most difficult thing: SHARING IT AND MAKING IT KNOWN. It's no use how hard I can work on these tutorials if people don't get to know them. THANK YOU TO EVERYONE WHO SHARES!
Just below you have buttons that make it easy to share it on Facebook, Twitter, WhatsApp and Telegram.
Good.
I am a first timer and I have made this setup. With the sandwich firmware the screen kept showing the Sensirion logo. In the app it always shows -45 degrees Celsius, 0 RH and 0 ppm C02.
I have tried the advanced version. Now the emariete logo is displayed and then the screen shows 0ppm in green. The app also shows the same as before.
I don't know if there's something I might have done wrong... Ah, I struggled to find the right drivers, I think the ones that worked fine were the ones from the link on the Chinese page.
Thank you and congratulations on your work.
P.
Hello P.
It is very likely to be due to a wiring error. It would be a good idea to see detailed photos of the assembly, where the connections are clearly visible, to make sure. It is also very important to load the correct version of the firmware (normal or sandwich version), depending on the installation you have done.
Otherwise, the best thing to do is to connect the meter to the computer via the USB port and use a serial monitor to view the messages that the meter outputs via the USB port, which are numerous and indicate step by step what is happening.
I recommend you to go to the Telegram chat group where it will be much easier to see it: https://t.me/emariete_chat
I'm sure we'll find the problem in no time!
Best regards.
Thank you very much!
I'll drop by and ask there. I anticipate that as a newbie anything is possible 🙂
Best regards,
P.
I just dropped by again to say that everything is working perfectly and to thank you for your help and your work to make it possible for any handyman like me to be able to assemble and make this work.
Best regards.
P.
Great! I'm so glad it worked out perfectly for you! 😀
Visit the Telegram group from time to time so you don't miss CO2 Gadget firmware updates - there will be interesting news soon!
Good morning. I have the same problem, how did you solve it in the end?
In the end it was a problem with the wiring (the soldering).
I recommend that you check your connections and if you continue to have problems, please go to the Telegram group so that we can take a closer look.
Thank you. I'll check it out more calmly and if not I'll drop by the group.
Thanks for everything!
Hi, I like this idea, I did read your other articles. Great work. It is possible to use MH-Z19B or Senseair S8 LP sensor, with this TTGO as they are cheaper?
Hi.
Yes. New firmware version (in the works) has full support for Winsen MH-Z19B, Senseair S8 LP, Sensirion sensors SCD30, SCD40 and SCD41 and Cubic CM1106.
You can find the current development version at https://github.com/melkati/CO2-Gadget
Great work! Thank you very much for your effort.
I have a question about the battery. You said in the article that we must use battery with build in protection (overcharging etc.).
But the ttgo t-display esp32 has a build in battery circuit. Doesn't that take care of the charging? So would it be possible to use a simple cell like the panasonic ncr18650b?
And alternatively, would it be possible to connect 3 x AA NiMh to the board?
Hi Patrick.
The built-in circuit in the TTGO T-Display board is just a charger, that's why you need additional protections.
I don't have any experience with the Panasonic NCR18650B battery, best that you check in the datasheet with the exact reference if it has built-in protection or not.
The charger on board is only good for Li-Ion and Li-po batteries. It can't charge NiMh batteries.
Best regards! 😀
Hi Mariete,
Thank you for your answer.
After some research I found that the the charging circuit in the TTGO protects against overcharging but NOT against over-discharging, which can also ruin the battery. The NCR18650B does not have protection.
I also found this readit- thread where someone tried NIMH, with success, but it was only experimental, but it might work: https://www.reddit.com/r/esp32/comments/hcku6p/ttgo_tdisplay_with_nimh/
For this project I will order a LiPo-pack (with protection), but when I have time I will also try some NiMh AA's, because they are cheap and readily available.
Kind Regards
Great work, thank you for sharing the results of your time and efforts !
I'll take a look to your code, trying to understand how you deal with clockstretching on esp32...
And a question, the sensirion App do not fetch the data, and I do not see any part of your code that could possibly be related to this aspect. Do I miss something or this ability was left alone ?
Hi Mathieu.
The code in this tutorial is not mine. It's from Sensirion. I only wrote the tutorial.
When I tested it, few months ago, fetching the data from the meter to the phone via BLE was working fine. If the problem is with the Sensirion's code you should open an issue at their GitHub repository (link in the post).
My code is at the post "CO2 Gadget: Advanced CO2 Meter". If the problem is with my code and you think it's a bug you should, please, open the issue at CO2 Gadget's GitHub repository.
Good morning. First of all, I'm completely useless when it comes to electronics. I've been reading you guys for a while and I'm sorry I don't understand it as easy as you do. I tried to make the co2 meter and it just stopped trying. It keeps looping giving a 0x10 and 0x13 fault. I have changed the soldering from sandwich to wire and nothing. I don't know if it has a solution or leave it as impossible. I could send you the sensors and you can keep them if I've loaded them or if there is a solution you can tell me. I would be happy to pay for shipping. Thank you for your time.
Hello Arkaitz.
The error you are getting is probably nothing to do with anything having gone wrong, but something else (maybe something silly).
The best way to see it is through the Telegram group. https://t.me/emariete_chat because a bit of research and testing will have to be done to find the problem...
I'm sure we'll have it sorted out in no time.
Best regards.
Good morning. As I am a novice in everything related to electronics, the soldering also leaves much to be desired. Thanks for your time and soon I'll show you the problem and we'll see if it can be solved. Thank you very much for your time.
Hello,
Thank you for the information and your blog.
The reference of the TTGO I have is 19-6-28 V1.1 XY-CP / 16MB CH9102F Chip
[ https://fr.aliexpress.com/item/33050667207.html ]
The pins are different from the TTGO in the tutorial
G - 36
21 – 37
22 – 38
17 – 39
2 – 32
15 – 33
13 – 25
12 – 26
G - 27
G - G
3V - 5V
(connect for USB)
How can I connect it to the SCD 30 captor to make the system work in wired version ?
Is your firmware compatible ?
Thank you for your answer.
As I am not sure you have received my message I am sending it again...
Thank you in advance for your help.
Hello,
Thank you for the information and your blog.
The reference of the TTGO I have is 19-6-28 V1.1 XY-CP / 16MB CH9102F Chip
[ https://fr.aliexpress.com/item/33050667207.html ]
The pins are different from the TTGO in the tutorial
G - 36
21 – 37
22 – 38
17 – 39
2 – 32
15 – 33
13 – 25
12 – 26
G - 27
G - G
3V - 5V
(connect for USB)
How can I connect it to the SCD 30 captor to make the system work in wired version ?
Is your firmware compatible ?
Thank you for your answer.