Tale of how the MT8060 c Arduino made friends
This article focuses on the MT8060 air quality monitor with a carbon dioxide sensor and the ability to read its readings on a PC and Arduino.
From this article you will learn:
Caution traffic!
Once I went to Geektimes I found several articles about the carbon dioxide sensor MT8060 from DAJET. In the comments there was an active discussion of the possibility of connecting this device to a computer to receive data. In the comments, I could not share my experience on this issue (there was no R&C mode yet), so I decided to write an article, at the same time opening the question in more detail and with “pictures”.
Unfortunately, this modification of the device does not have the ability to transfer data via USB. But there is a diagnostic port on which you can read all the data, as well as calibrate the device (probably). The next section describes how to get to this port and how to connect to it. Repeating this is not necessary - at the end of the next section, all the data is shown to connect to the port without disassembling the device.
Photos were taken on the phone’s camera, sometimes not very high quality, I didn’t try hard because I didn’t think that I would write an article, but I did just in case.
So, on the back side there are three rubber plugs, behind which are three bolts. The plugs can be removed with tweezers, or picked up with a needle.
In addition to the bolts, the two halves of the body also hold on the latches, which are located around the entire perimeter of the body. To separate the halves, it is enough to hold a toothpick around the perimeter of the case, a gap of half a millimeter is enough for the latches to open. Next, gently open the case and see that from the microcircuit to the back cover there is a rubber hose, and you can damage the mounts and microcircuits to which it is attached during sudden movements.
Now you can see the back of the device’s PCB, diagnostic leads, and RJ45 connector. After going through the notation that was plotted on the circuit, I went to the CO2MeterHacking article , which looked at a similar device. By connecting, as described in the article, and running the sketch proposed there, I received the treasured data, which partially coincided with the data displayed on the screen - the main goal was achieved.
In addition, the pinout of these pins to the RJ45 connector was noticeable. Having looked at the wiring, and phoned, just in case the contacts, I drew a connection diagram.
The designation and purpose of the contacts is as follows:
The pinout was suitable for a standard four-core connector, and for testing purposes such an arduino-compatible connector was assembled.
The device can be assembled, but I previously removed the dongle, blocking outside access to the RJ45 port. It is mounted on four latches, which I gently bent from the inside, but I think you can get it by simply picking it up from the outside, without having to disassemble the device. The photo below shows how it holds and what the latches look like.
Further research was conducted on the assembled device, with an “open” port, and they were purely software.
We connect the orange wire (pin D ) to the D3 pin of the arduino, the white-green (pin C ) to the pin D2 of the arduino-compatible board.
Data is transmitted using the SPI protocol. For reading and decoding data, a method and a simple sketch were written that outputs the humidity, temperature and carbon dioxide concentration to the serial port.
After starting the sketch, data identical to the readings on the screen of the device begins to flow to the serial port monitor once every second, or so.
Although the humidity level on the device is displayed as Lo, when reading readings through the port, they are quite visible to themselves as values less than 20. It is not clear why this was done, probably in order not to make another “traffic light” in terms of humidity, but to output Lo if the humidity is already critically low.
That's all, actually: the data arrives every second, you can plot in high resolution, or write any other logic. For example, I made a notification via Telegram about the indicators going beyond the norm, which eliminates the need to constantly monitor the indicators. I also set Mi Band to the appropriate notifications - it is convenient if the readings exceed the limit at night, and you need to turn off the humidifier or ventilate. You can go further and integrate these indicators with the automatic ventilation system, or to a smart outlet in which the same humidifier is connected - further restrictions are only for imagination.
An article on revspace suggests using wireless data transfer, but you can also find an example sketch for sending data using the NRF24L01 + transmitter. In addition, inside the case there is enough free space, as it seemed to me, which is enough for a small controller and wireless module. In addition, there is a 3V power supply inside (contacts G and V ), which eliminates the need for third-party power supplies, well, 5V from a USB port can be used if 3V is not enough. If I decide to implement some kind of wireless data transfer method, I will write another article on this subject.
That's all for now, thanks for watching!
The author of the article is not responsible for attempts to repeat or apply the results presented in this material!
From this article you will learn:
- How I disassembled this device.
- How to connect a CO2 sensor to an arduino without disassembling it.
- How to read data, and how to convert to the form in which they are displayed on the screen (and even in a larger range of values).
- Sketch and cable routing included.
Caution traffic!
The essence of the problem
Once I went to Geektimes I found several articles about the carbon dioxide sensor MT8060 from DAJET. In the comments there was an active discussion of the possibility of connecting this device to a computer to receive data. In the comments, I could not share my experience on this issue (there was no R&C mode yet), so I decided to write an article, at the same time opening the question in more detail and with “pictures”.
Unfortunately, this modification of the device does not have the ability to transfer data via USB. But there is a diagnostic port on which you can read all the data, as well as calibrate the device (probably). The next section describes how to get to this port and how to connect to it. Repeating this is not necessary - at the end of the next section, all the data is shown to connect to the port without disassembling the device.
Disassembling and exploring connectivity
Photos were taken on the phone’s camera, sometimes not very high quality, I didn’t try hard because I didn’t think that I would write an article, but I did just in case.
So, on the back side there are three rubber plugs, behind which are three bolts. The plugs can be removed with tweezers, or picked up with a needle.
In addition to the bolts, the two halves of the body also hold on the latches, which are located around the entire perimeter of the body. To separate the halves, it is enough to hold a toothpick around the perimeter of the case, a gap of half a millimeter is enough for the latches to open. Next, gently open the case and see that from the microcircuit to the back cover there is a rubber hose, and you can damage the mounts and microcircuits to which it is attached during sudden movements.
Now you can see the back of the device’s PCB, diagnostic leads, and RJ45 connector. After going through the notation that was plotted on the circuit, I went to the CO2MeterHacking article , which looked at a similar device. By connecting, as described in the article, and running the sketch proposed there, I received the treasured data, which partially coincided with the data displayed on the screen - the main goal was achieved.
In addition, the pinout of these pins to the RJ45 connector was noticeable. Having looked at the wiring, and phoned, just in case the contacts, I drew a connection diagram.
The designation and purpose of the contacts is as follows:
- C (Clock) - a clock signal.
- D (Data) - data signal.
- G (Ground) - ground.
- V (V DD ) - power supply + 3V.
The pinout was suitable for a standard four-core connector, and for testing purposes such an arduino-compatible connector was assembled.
The device can be assembled, but I previously removed the dongle, blocking outside access to the RJ45 port. It is mounted on four latches, which I gently bent from the inside, but I think you can get it by simply picking it up from the outside, without having to disassemble the device. The photo below shows how it holds and what the latches look like.
Reading and decoding parameters
Further research was conducted on the assembled device, with an “open” port, and they were purely software.
We connect the orange wire (pin D ) to the D3 pin of the arduino, the white-green (pin C ) to the pin D2 of the arduino-compatible board.
Data is transmitted using the SPI protocol. For reading and decoding data, a method and a simple sketch were written that outputs the humidity, temperature and carbon dioxide concentration to the serial port.
After starting the sketch, data identical to the readings on the screen of the device begins to flow to the serial port monitor once every second, or so.
Although the humidity level on the device is displayed as Lo, when reading readings through the port, they are quite visible to themselves as values less than 20. It is not clear why this was done, probably in order not to make another “traffic light” in terms of humidity, but to output Lo if the humidity is already critically low.
That's all, actually: the data arrives every second, you can plot in high resolution, or write any other logic. For example, I made a notification via Telegram about the indicators going beyond the norm, which eliminates the need to constantly monitor the indicators. I also set Mi Band to the appropriate notifications - it is convenient if the readings exceed the limit at night, and you need to turn off the humidifier or ventilate. You can go further and integrate these indicators with the automatic ventilation system, or to a smart outlet in which the same humidifier is connected - further restrictions are only for imagination.
Thoughts aloud about wireless data
An article on revspace suggests using wireless data transfer, but you can also find an example sketch for sending data using the NRF24L01 + transmitter. In addition, inside the case there is enough free space, as it seemed to me, which is enough for a small controller and wireless module. In addition, there is a 3V power supply inside (contacts G and V ), which eliminates the need for third-party power supplies, well, 5V from a USB port can be used if 3V is not enough. If I decide to implement some kind of wireless data transfer method, I will write another article on this subject.
That's all for now, thanks for watching!
References and Sources
- CO2 Meter Hacking
- ZG01 Sensor Documentation
- Original sketch with wireless data sending
- My sketch version
The author of the article is not responsible for attempts to repeat or apply the results presented in this material!