Depiction of women in heraldry

St. Gall Abbot Ulrich Rösch’s (1462-1491) book of heraldry, containing 1,626 coats of arms of prominent people from the laity and the clergy, mostly from the southern region of Germany. This heraldic book was probably prepared in the Heidelberg workshop of Hans Ingeram for an unknown customer from the area between the Neckar River and the Upper Rhine. In the 1480s St. Gall Abbot Ulrich Rösch purchased the volume and had numerous coats of arms from Swiss and German border areas added in the back pages; these were drawn by Winterthur artist Hans Haggenberg. One of the most important heraldic record books of the 15th century.

Link: https://www.e-codices.unifr.ch/en/csg/1084/bindingA/0/Sequence-729

My home environment and air quality monitoring system

We often hide the electronics in a box. And cases can be done well and nicely. But when our main interest is electronics then it is sad to hide it. That is way like to do it the opposite way.

Sensors will measure particulate matter (Ultrafine dust PM2.5 and fine dust PM10), co2, TVOC, ambient light, humidity, temperature and barometric pressure.

Most sensors use I2C to communicate. That makes it super easy to build.

Why and what

We spend much of our lives indoors. And that is why it is important that our main living environment is healthy.

  • CO2 level should be less than <1000 ppm
  • TVOC is the concentration of Volatile organic compounds (VOCs) present in the air. Should be less than <100 ppm.
  • PM2.5 refers to atmospheric particulate matter (PM) that have a diameter of less than 2.5 micrometres. The 24-hour concentration of PM2.5 is considered unhealthy when it rises above 35.4 (60) μg/m3.
  • PM10 refers to atmospheric particulate matter (PM) that have a diameter of less than 10 micrometres. < 100 μg/m3.
  • Humidity 40-60 %
  • Temperature 21-25 °C

Code

Code can be found on the GitHub repository.

Schematics

This is the basic schematics.

Because I still had free pins, I added four LEDs.

My power supply is 9V. This is a circuit to make 3.3C and 5V what my MCU and sensors need.

Data

There are four places to view real-time data:

In the long term, all data is stored on the ThingSpeak channel.

Display view:

Serial Monitor view:

Simple local website:

ThingSpeak view:

Notes

  • First, test all sensors separately to make sure they all work properly.
  • There are different libraries. Test them to be sure they will work with your MCU and sensor.
  • Keep code modular. So you can easily add and remove sections.
  • Wear gloves. The wires may become hot during soldering.

Links

Main board: WeMos D1 mini (ESP8266)

Default I2C SDA/SCL pins:

  • D2 – GPIO4 – SDA
  • D1 – GPIO5 – SCL

BMP280 Humidity, temperature, barometric pressure and altitude sensor

Pins

BMP280 ESP8266
VCC 3V3
GND GND
SCL D1
SDA D2
CSE
SDD

APDS-9960 Proximity, RGB and gesture sensor

  • I2C Address: 0x39
  • ambient light
  • colour measuring
  • proximity detection
  • touchless gesture. Operating range 10-20cm.

Pins

APDS9960 ESP8266
VIN 3V3
GND GND
SCL D1
SDA D2
INT

Library

CCS-811 (CJMCU-811) Digital gas sensor monitoring indoor air quality

  • I2C Address: 0x5A or 0x5B
  • Needs pull-up resistors
  • eCO2
  • eTVOCs

Pins

CCS811 ESP8266
VCC 3V3
GND GND
SDA D2
SCL D1
nWAKE D3 or GND
INT
RST
ADD

Library

Update sensor firmware: https://github.com/maarten-pennings/CCS811/tree/master/examples/ccs811flash

1.3″ Oled display module 128×64

Unknown manufacturer. After trial and error, I discovered my display driver is SH1106. Not SSD1306 like Adafruit uses. But when I use SH1106 constructor:

U8X8_SH1106_128X64_NONAME_HW_I2C display (/* reset=*/ U8X8_PIN_NONE);

Display will look good. But the AM2320 sensor will not work for unknown reason. I2C communication problem?
That’s why I still use SSD1306 constructor. The fonts do not look nice and on the screen right side has white scratched strip.

U8X8_SSD1306_128X64_NONAME_SW_I2C display(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);

Link to the store: https://www.digitspace.com/1-3-oled-display-module-128-64-i2c?2e40f3ca70399010

Pins

OLED ESP8266
GND GND
VCC 5V
SCL D1
SDA D2

Library

AM2320 Temperature and humidity sensor

Sensor will work normally a couple of hours. After that will not respond anymore. Needs power off restart.

Pins

AM2320 ESP8266
GND GND
VCC 3V3
SDA D2
SCL D1

Library

Nova PM SDS011 Dust sensor

Can measure fine dust and smoke = particulate matter (MP) concentrations in two categories:

Pins

SDS011 ESP8266
TXD D7
RXD D8
GND GND
25um
5V 5V
1um
NC

Dust sensor

Nova PM sensor SDS011 can measure fine dust and smoke = particulate matter (MP) concentrations in two categories:

  • Ultrafine dust particles with a diameter of 0 – 2.5 micrometres (μm/m3). Output PM2.5
  • Fine dust particles with a diameter 2.5 – 10 micrometres (μm/m3). Output PM10

The sensor is designed with a built-in fan to ensure sample air circulation to a chamber with a laser diode, where the size and amount of PMis determined. The scattered light is transformed into electrical signals and with further analysis, on the signal waveform, the digital output of the component is the particle concentration of PM2.5 andPM10 (from counts of particles with diameters from 0.3 to 10μm). The working principle is based on light scattering, where a light source illuminates the particles and the scattered light is transformed into a signal by a photodetector, the amplitude of which depends on the light wavelength, scattering angle, particle size and relative index of refraction between medium and particle. (3)

SDS011 layout

Hardware

SDS011 package includes sensor, cable and serial adapter module (USB to TTL). I got mine here: https://www.digitspace.com/sds011-air-quality-sensor-module?2e40f3ca70399010

And I use ESP8266 (Wemos D1 mini) to connect to sensor.

Sensor input voltage 5V. ESP8266 uses 3.3V. Sensor RX and TX pins are 3.3V tolerant.

Sensor have UART (Serial) output.

Its service life is up to 8000 hours. It is less than a year. So it’s better when sensor will not work all the time. And you make measurement from time to time. Like every ten minutes.

The sensor have more pins but we only need RX, TX, 5V and GND. Other can be left disconnected.

Simple SDS011 and ESP8266 circuit

We have to disconnect sensor TX and RX pins to upload new firmware. So maybe is better to add toggle switches between these pins.

Software

I use Nova Fitness SDS dust sensors arduino library. It works well with ESP8266 and uses Software serial.

I chose D3 and D4 pins to connect to sensor.

#include <Arduino.h>
#include <SdsDustSensor.h>

/* SDS011 Dust Sensor */
const int SDS_RX_PIN = D3; // D3 -> SDS011 TX pin
const int SDS_TX_PIN = D4; // D4 -> SDS011 TX pin
SoftwareSerial softwareSerial(SDS_RX_PIN, SDS_TX_PIN);
SdsDustSensor sds(softwareSerial); //  additional parameters: retryDelayMs and maxRetriesNotAvailable

const int MINUTE = 60000;
const int WAKEUP_WORKING_TIME = 30000; // 30 seconds.
const int MEASUREMENT_INTERVAL = 5 * MINUTE;

void setup() {
  Serial.begin(115200);

  Serial.println("SDS011 dust sensor");
  delay(MINUTE);

  /* SDS011 Dust Sensor */
  sds.begin();
  // Prints SDS011 firmware version:
  Serial.print("SDS011 ");
  Serial.println(sds.queryFirmwareVersion().toString()); 
  // Ensures SDS011 is in 'query' reporting mode:
  Serial.println(sds.setQueryReportingMode().toString()); 
}

void loop() {

  // Wake up SDS011
  sds.wakeup();
  delay(WAKEUP_WORKING_TIME);

  // Get data from SDS011
  PmResult pm = sds.queryPm();
  if (pm.isOk()) {
    Serial.print("PM2.5 = ");
    Serial.print(pm.pm25); // float, μg/m3

    Serial.print(", PM10 = ");
    Serial.println(pm.pm10);

  } else {
    Serial.print("Could not read values from sensor, reason: ");
    Serial.println(pm.statusToString());
  }

  // Put SDS011 back to sleep
  WorkingStateResult state = sds.sleep();
  if (state.isWorking()) {
    Serial.println("Problem with sleeping the SDS011 sensor.");
  } else {
    Serial.println("SDS011 sensor is sleeping");
    delay(MEASUREMENT_INTERVAL);
  }
}

And my sensor output:

Sensor output on my screen

Links:

  1. SDS011 Air Quality Sensor Module
  2. What is PM2.5 and Why You Should Care
  3. https://www.researchgate.net/publication/324176004_Development_and_On-Field_Testing_of_Low-Cost_Portable_System_for_Monitoring_PM25_Concentrations
  4. https://github.com/lewapek/sds-dust-sensors-arduino-library

24-Hour PM2.5 Levels

Fridays For Freedom

Only on July 1st, the #HongKong police conducted more than 370 arrests. It’s time to fight back.

Join #FridaysForFreedom, the counter-action organized by @now4humanity. See you in the streets, let’s show #China what we got! 

www.now.world/fridaysforfreedom

Liberate Hong Kong revolution of our times!

光復香港 時代革命