# AEM1000 Multi Sensor ESP8266 with TFT (Co2, VOC, PM2.5, Temp, Humidity)

**URL:** <https://discourse.nodered.org/t/aem1000-multi-sensor-esp8266-with-tft-co2-voc-pm2-5-temp-humidity/94121>\
**Category:** Share Your Projects\
**Tags:** function-node\
**Created:** [23 December 2024 13:42 UTC](https://discourse.nodered.org/t/aem1000-multi-sensor-esp8266-with-tft-co2-voc-pm2-5-temp-humidity/94121 "2024-12-23T13:42:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajaybnl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ajaybnl/32/97442_2.png) [@ajaybnl](https://discourse.nodered.org/u/ajaybnl)\
**Post date:** [23 December 2024 13:42 UTC](https://discourse.nodered.org/t/aem1000-multi-sensor-esp8266-with-tft-co2-voc-pm2-5-temp-humidity/94121/1 "2024-12-23T13:42:42Z")

</div>

I have made a cheap multi Air sensors project using ESP8266 , 1.8" TFT.  
I have used Node-red to upload the sensor data to mysql db from Mqtt.

The ASAIR AEM1000 is a cheap alternative. The data it provides is calibrated from factory. We can fetch the data by modbus protocol either from Uart or modbus module.

AEM1000 Photos:

 ![111](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/60c60864773dfe5926820a46d868a40571688284.jpeg)  
 ![222](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/431141d71a74258e4088c34f7716c7c1673e025f.jpeg)

**You have to transfer 2 resistors and remove 2 big resistors to use UART**

 ![333](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4d4e4b9eb70580b161822bd481338a8a0a0dddd7.jpeg)

Datasheet: [http://www.aosong.com/m/en/products-78.html](http://www.aosong.com/m/en/products-78.html)

I was new to this protocol, and not found a library for this sensor. I have chosen this library for this sensor :

> **[GitHub - 4-20ma/ModbusMaster: Enlighten your Arduino to be a Modbus master](https://github.com/4-20ma/ModbusMaster)**
>
> Enlighten your Arduino to be a Modbus master

**Using the code :**

```auto

//Note: Defaultly there is only MODBUS protocol supported on AEM1000
// You have to transfer 2 resistors as shown in image in the main page

// Create SoftwareSerial instance
SoftwareSerial modbusSerial(D1, D2); // RX, TX pins
ModbusMaster node; // Create Modbus master instance

**Setup:**
 modbusSerial.begin(9600);
  node.begin(1, modbusSerial);

```

**Reading Sensor Values**

```auto

//The AEM1000 sensors registers are from 0-4 and size max is 4
const char *names[] = { "temp", "hum", "voc", "co2", "pm2.5" };

    for (int i = 0; i <= 4; i++) {

      result1 = node.readHoldingRegisters(i, 4);

      if (result1 == node.ku8MBSuccess) {
        data1 = node.getResponseBuffer(0);

//store sensor values in values[] array
values[i] = (int)data1;

//Print senor name and value
Serial.print(names[i]);
Serial.print(" : "):
Serial.println(values[i]);
      } else {
   //error fetching sensor data or corrupt data
      }
     
    }

```

**To Calibrate Co2 (keep sensor in open air outside for 20 minutes and run this) :**

```auto

//set co2 calibration to manual
 node.writeSingleRegister(32, 0);

//set value 405 as co2 value of open area (natural air)
    node.writeSingleRegister(33, 405);

```

**To Check Sensor Status (If Sensor Working or faulty or unplugged)**

```auto

const char *names[] = { "temp", "hum", "voc", "co2", "pm2.5" };

//The registers are from 11-14 (for same sensors register from 0-4)

 for (int i = 11; i <= 14; i++) {
    
      result1 = node.readHoldingRegisters(i, 4);

      if (result1 == node.ku8MBSuccess) {

       status1 = node.getResponseBuffer(0);

       // Status : 0:OK, 1:Faulty, 3:Unplugged

      const char *statuses[] = {"OK","Faulty","Unplugged"};
    

        // Print Status
         Serial.print (names[i - 11]);
         Serial.print(" : ");
        Serial.println(statuses[status1]);     
        
      } else {

        Serial.println("Error reading register");
      }

    }

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [23 December 2024 14:59 UTC](https://discourse.nodered.org/t/aem1000-multi-sensor-esp8266-with-tft-co2-voc-pm2-5-temp-humidity/94121/2 "2024-12-23T14:59:12Z")

</div>

Are you a representative of the company that makes those sensors @ajaybnl ?

How much do they cost?

Where can I buy **one**?

Just from looking at the picture, it looks like the temperature/pressure/humidity sensor it uses is a DHT22 or similar, I thought they were rather less accurate than the BME series of sensors, also very cheap.

---

<div class="post-metadata">

**Author:** ![ajaybnl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ajaybnl/32/97442_2.png) [@ajaybnl](https://discourse.nodered.org/u/ajaybnl)\
**Post date:** [28 December 2024 13:20 UTC](https://discourse.nodered.org/t/aem1000-multi-sensor-esp8266-with-tft-co2-voc-pm2-5-temp-humidity/94121/3 "2024-12-28T13:20:41Z")

</div>

> [@jbudd](#):
>
> I thought they were rather less accurate than the BM

I am not related to any company. I just build a couple of sensors (with tft) for me. Yes it looks like DHT22 but its resolution is 0.1 degree.

I found it cheap (30$ or 2500 Rupees Indian) Found it cheapest multi sensor board online.

I found simple solution (code) after 2 days of finding no libraries for this sensor.

I have created a Arduino Code on Github : [GitHub - ajaybnl/AEM1000: AEM1000 Sensor Reading Methord for Arduino , ESP32 , ESP8266 Like MCU](https://github.com/ajaybnl/AEM1000)
