Showing posts with label carbon dioxide. Show all posts
Showing posts with label carbon dioxide. Show all posts

February 5, 2016

New CO2-sensor support for the WMS mk3

I have implemented support for an additional carbon dioxide sensor that is much cheaper and easier to get hold of compared to the S8 sensor from SenseAir.

The new sensor (MH-Z19) can be found on eBay or Aliexpress from $26 including shipment.

Of course there are differences between the two that is reflected by the price.

I have setup two WMS mk3 side by side. One WMS with an S8 sensor and one with an MH-Z19 sensor. The result is logged to ThingSpeak

The MH-Z19 variant used have a range from 0-5000ppm. As the digital output on the MH-Z19 only can be 0-1000, every digital step represents 5ppm. This probably contributes to the jagginess in the graphs presented below.

First observation when comparing the two graphs is that the MH-Z19 sensor gives a much more jagged curve. Both graphs have the same shape which indicates that the response time is about the same for both. The MH-Z19 has however a slower response time.

The left half of the graphs below should be close to 400ppm as both sensors was placed in the opening of a window. Outside air can be used to calibrate a CO2 sensor since the open air CO2 concentration is constantly very close to 400ppm.

A feature that the MH-Z19 is lacking compared to the S8 is auto calibration (a.k.a. ABC - Automatic Baseline Calibration). The ABC continuously keeps the S8 sensor calibrated.

This picture shows the difference between the two. The timescale is 1 hour.
This second image shows that the MH-Z19 averages out to shape the same graph as the S8, but the readout is not very smooth. The graph spans about 1 hour to make the comparison more obvious.

Another image that shows the jagged graph from the MH-Z19 sensor.
In the graphs below I had added a +45ppm offset to the MH-Z19 sensor readings as I thought it was showing around 45ppm too much compared to the S8. After calibration I reconsidered and had to change the offset factor to -30ppm. The offset change can be seen at about 14:50. When zooming out the comparison between the two is more fair.


Summary

The price/performance ratio for the MH-Z19 is good, and I think it is worth its price and good enough to measure the air quality in an apartment or house. The S8 on the other hand seem to be very much more accurate and there is usually no problem to detect presence of one or several persons in my 97m2 apartment.

I will update the blog when the 0-2000ppm MH-Z19 sensor arrives. That variant is likely to give better results as the resolution of the output is 2ppm per step.

Note that the output of the MH-Z19 is always 0-1000 which is shown by the WMS as 0.0°C - 100.0°C
To convert this to a proper carbon dioxide ppm reading, the temperature need to be multiplied by 50.0 for the 0-5000ppm MH-Z19 variant, and by 20.0 for the 0-2000ppm variant.




August 13, 2014

New Firmware and Manual for the WMS Mk2

Just before the summer vacations I finalized the Wireless Multi-sensor Mk2 firmware that I have been working with for quite some time.

News,

  • CO2 sensor S8 from SenseAir is now supported. It can be connected to the Event Input after changing the input mode of the Event Input (c.f. Manual). You can get the CO2-sensor here.
  • MAX31850K support. This chip is a Thermocouple Type K to 1-wire chip. This makes it possible to make a Type K thermocouple wireless. It can output 409.6°C as the highest temperature. It is a limitation set by the protocol I use. Here you can find a MAX31850K-module, m.nu.
  • DS2450 support. This is a 4 channel AD converter. All 1-wire sensors based on this chip will be compatible with the WMS Mk2. This,  this, this, this and this is also compatible modules since they are based on the DS2450 chip.

Improvements,

  • Events are now sent as a LMST-606 device. An ON or OFF signal will be sent depending on if the input pin is pulled up or pulled down.
  • The Manual is out in a first revision.

All Wireless Multi-sensors Mk2 will be shipped with this new firmware from now on.

March 19, 2014

Connection guide for the Wireless Multi-sensor

Here are the different connections to the Wireless Multi-sensor version 1.1.

First I start with presenting the different ways to connect sensors,

  • Temperature and Temperature/Humidity sensors
  • PIR and CO2 sensors
  • Passive switch-type of sensors

In the end I show how you can power the Multi-sensor and where you can feed it, under the section Power.




Temperature and Temperature/Humidity sensors

The 1-wire network is ideally a straight bus. But it could as well be pure star-shaped. This shape is however not recommended by Maxim. For more detailed information about the network topology I recommend reading Guidelines for Reliable Long Line 1-Wire Networks.
A network length of about 50 meters have been reported to work OK with the Multi-sensor, but do not see this as the maximum limit. Maximum network length is still to be found. Cable type is important if you plan to build a large network. Pair-twisted EKKX 2x2x0,5 is one of the recommended cables to successfully build a large working 1-wire network.

The following 1-wire sensors have been verified to work, DS18B20, DS18S20, DS18B22, DS1820 and MAX31820.

With the DS2423-firmware the Multi-sensor will support the DS2423-2-channel counter commonly used when logging energy consumption. however there is a simpler way.

The DHT22 can be connected with up to 100m cable according to the specification.


PIR or CO2 sensor

You can choose from many different types of sensors to connect to the PIR-input. Any of those types (or similar) can be connected right into the pin connector after removing the read jumper thing.


Passive switch-type of sensors

Any passive switch-type of sensor can be connected to the PIR-input. With this type of sensor you will need to add a Pull-down resistor to force the DATA-line low when the switch is open. The pull-down resistor should have a value of about 4k7 to 10kOhm, but it is not critical.
A transmission will only be done as soon as the DATA-line goes high.

Power

You can power the Multi-sensor in one of two ways. Either you use the USB-port, or you use the solder pads on the PCB marked BAT for battery, to power it with the power source of your choice.
The table below will guide you with what minimum and maximum voltages that are allowed.

The numbers within the parenthesis are the maximum ratings for each sensor. However, the PIC-microprocessor limits the maximum voltage to 5.5V. I have tested it successfully with 6.5V, but that is outside the PIC12F675 specification and not recommended.

You will be safe to feed the Multi-sensor with 4.5-5.5V independently of which sensors you combine. The easiest way is to use a USB-charger or similar. The USB port is only there to give power to the Multi-sensor. The D+ and D- pins are not used.

If you want to minimise the form factor you will likely want to choose a small battery. It can be useful to know that you can go as low as 3.0V as long as you only use 1-wire DS18X20 sensors. I have successfully powered a Multi-sensor and one DS18B20 with a CR2032 cell battery (3V). The test was speed up with increased transmission interval. The estimated lifetime of this configuration is estimated to more than 1.5 years.

The transmitting range of the Multi-sensor will depend on the voltage level.
Here is the specification for the Radio module used in the Multi-sensor (FS1000A):
Operating Voltage2.5 V to 12 V
Operating Current4mA @ 5V, 15mA @ 9V
Quiescent Current10uA
Operating Temperature-10C - 60C
ModulationASK
Max. Data Rate2.4K
Data InputTTL
RF Power20 mW@5V

For the advanced user it could probably be possible to boost the transmission range by feeding the RF module with 12V separate from the rest of the Multi-sensor.


March 9, 2014

Update: CO2 sensor support for the Wireless Multi-sensor

I am getting closer to a working version of the firmware that support the CO2-sensor S8 from SenseAir®.
You can get it from m.nu.

The sensor measures CO2 levels from 0 to 2000ppm and the Wireless Multi-sensor outputs this as 0.0°C - 100.0°C which corresponds to 0.0% - 100.0% of 2000ppm.

Here is a graph from the bedroom last night,
It averages around 50% during the night. This corresponds to around 1000ppm.
At first the sensor was placed outside, where the level is quite steady at 400ppm. The Wireless Multi-sensor outputs 20%.

We started the night with me and my two sons in the bedroom. The CO2 level increases until 3 o'clock, to a maximum of 56%. At 3 o'clock my eldest son leaves the bedroom and the CO2-level decreases to about 50%. After 6 o'clock me and my youngest son leaves the room and my wife enters and continue to sleep alone in the bedroom. The peak is probably me breathing too close to the sensor when checking its position.

The remaining task is to make this work together with DHT22 and the 1-wire-network. The Wireless multi-sensor is supposed to automatically detect if you have connected a CO2-sensor or if you have a PIR-sensor or other type of TTL logic type of sensor.

UPDATE: Here is another graph that shows the CO2-ppm level on the y-axis. The snapshot is taken after one night sleep with my wife and my eldest son in his bedroom.

Top notation is 1306ppm just before 7 o'clock in the morning.