Showing posts with label CO₂. Show all posts
Showing posts with label CO₂. Show all posts

2025-05-22

Evolution of my code and PCBs

One the last few weeks my code and PCB designs have evolved a bit!

EPD

This is still called EPD (E-Paper Display), but in practice it is now a general purpose signage system allowing a number of widgets to be displayed getting data from many sources. Making it work with the 2" and 2.4" waveshare LCDs was nice. I got my PNG code doing colour nicely for this, and alpha blending.

One aspect I was very pleased about was the display connection - the display has 8 pads/holes at 0.1" spacing for a normal 0.1" header pin strip. Making a board to work with this is easy and you solder top and bottom - done! But it makes it almost impossible to remove cleanly if ever needed.


The trick is a surface mount header on my board, on top of pads/holes to allow for longer pins. This then allows 0.1" header pins on the display that then just plug in. It can be unplugged simply if access needed for connectors, or if changing display/board at any point. 

But the code has evolved even more - allowing a wide number of sensors (I2C and one-wire-bus), and formatting specially for temperatures (small C/F, colour based on range), etc. And now even BLE based temperature and humidity sensors as well.

In fact, with all of the sensors reporting to Home Assistant, I have had to make a "non display" version of the code for someone that is using this with no display - which is crazy for code designed to display stuff.

I also added handing of buttons as the board (see below) has them, causing Home Assistant triggers.

Faikin Remote

This other code has worked very much in parallel with a lot in common - including adding a load of sensors, the same as EPD. The main use case is to work a Faikin.

However the PCB design for this has ended up being a key module for use with my EPD code. It too has changed.

The initial sensors were temperature (as main thing for Faikin remote), humidity, and CO₂. The module is designed to also work a fan and radiator based - fan based on humidity and CO₂, and radiator based on temperature for cases where you have air-con and radiator. But it works for rooms I have that only have radiator, obviously. So it is an environmental monitor (working with HA) and a remote for the Faikin.

It also has pressure, so the CO₂ can be calibrated, and a light sensor so it can go off when dark (ideal for a bedroom).

But it is growing, with my latest designs (not yet on sale) having a microphone for noise level, and also an IR remote receiver. The idea of the IR is that a Daikin remote could work this directly. I'll need to code these soon.

It is becoming a really comprehensive environmental monitoring board now.

I was also asked to make the snap off bits (button, CO₂, and now IR) have pads to allow them to be wired in, so that is done - you can remove and mount nearby and wire back to the board.

Practical uses

Obviously I have these working with Faikin modules, and have them working with radiators (with and without air-con), and in places just monitoring. Some customers have them around offices to monitor workspace environmental conditions.

One good use case with remote BLE sensors is the pub. Showing BLE sensors in various places, and the DS18B20 temperature probe from another of the boards in the cellar monitoring the beer cooler. The fact this is all visible from the bar now makes life easier, and highlights any out of temperature readings (like when someone opened the beer keg store room to put in a sensor).

What is ideal is this is all reported and logged and graphed on Home Assistant as well. Any issues with the beer/lager the bar staff can see if there is an issue with the cooler at a glance (as had happened a couple of times). We also have logs and graphs which helps when the engineer comes in to sort the cooler.

Next step is probably one monitoring all the fridges. I found these small BLE sensors manage to work inside a metal fridge, if you are close enough. They will still do their temp checks, but this will alert quickly in one place if any issues, and provide historical records nicely. Obviously we check these with a calibrated thermometer as well.

All I need to do now is find a source of the BLE sensors that still work and can be flashed with Telink Flasher. Any pointers welcome.

Tindie

Yes, the code and PCB design is all open source, and I have these on Tindie. I do a tad cheaper for collection from Aber if you are local. Check it out as there is quite a lot on there now.

2025-05-08

Environmental monitoring

The new Faikin Remote have sold a few, nice. Thank you. Now on Tindie, and more coming soon. The BLE linking to Faikin is working really well now.

But ironically more have sold not as Faikin Remote, so far, but as environmental monitors. The boards have pressure, temperature (via many means), humidity, and CO₂.

What is even more amusing is that the monitoring is probably best done using my generic display signage code (EPD) as it has all the sensor code to allow display of the values. No link to Faikin, but links to Home Assistant, and simple http polling, and so on, for all sensors.

Irony on top of that is I have had to just make a version of my display code for no display, a blind version, as it is ideal for this monitoring application even when you have no display (data centres, etc).

Home and office monitoring of CO₂ levels is becoming more important as people realise how much of an impact a lack of fresh air really has.

2021-12-06

Tech, and mince pies

We have environmental sensors in the house. They are linked to HomeKit (via a firebrick, and raspberry pi, don't ask).

My phone went mad, telling me several of the rooms had High CO₂. This happens occasionally in the kitchen (aka living room) when we have a few people around, but it is only the two of us, and it is lots of the rooms in the house.

I checked, not the loft, not the outhouse, so not coming from outside it seems. But several rooms throughout the house!

Seems I have found the answer...



It seems that "Vinegar ( ethanoic or acetic acid ) is used in pickles and mincemeat and ... The acid reacts with sodium hydrogen carbonate to produce carbon dioxide ."

So yes, mince pies are picked up by the technology! wow.

They do look yummy though :-)

2021-03-26

Environmental sensors (now in colour)

I made these ages ago, but they have moved on a little. I may add more "air quality" type stuff in future, but for now they are temperature, humidity and CO₂. I have updated for a colour display.

The new house has coax cabling in place, which is no use to me, so I have redeployed as 12V DC supply so I can install these on existing single gang back boxes.

The main thing is that they are all on GitHub. This includes the code, PCB, and 3D case designs. This includes linux code to log the MQTT to a database. It also can send MQTT for controlling heating and ventilation based on temperature and CO₂ levels, which I am using with tasmota flashed relays (Shelly).

The PCB is now all KiCad, so easy to get printed properly.

The 3D case design has been fun - I made code to generate an SCAD model from the KiCad PCB layout so ensuring all connectors, and spacing for all components is always accurate. That was fun! I have included simple boxes with USB-C socket and also one gang face place boxes, with and without OLED or CO₂ sensor.

So have fun.

P.S. I have updated the repository Documentation to have detailed step by step instructions with pictures for building these.

2019-09-12

Environmental sensor

For my latest little R&D project I have made a new environmental sensor. These should help us see how good the air quality is in the office, and as usual, I have published this as an open source project for anyone else to make the same.

This proved to be a bit of a challenge, as always. I have already managed to get my head around the ESP32 and the Espressif ESP-IDF now, and have a set of  MQTT based tools as a base (here).

Hardware

I used an ESP32-WROOM-32 again, as they are really nice. I also used an SCD30 CO₂ sensor, which is the most expensive bit at around £40 from RS. I got a nice 128x128 OLED display from Amazon, and a DS18B20 temperature sensor.

One challenge was space - I decided to make the the PCB the same size as the OLED PCB and sandwich the CO₂ sensor in between. This was definitely a challenge to get connectors to fit!

I also decided to try the Molex SPOX connectors as they seem relatively cheap and easy to use.

The other aspect which is especially challenging is power. Most of the bits I have done to date have been alarm and access control and so use 12V on screw terminals. As it happens the unit (pictured above) takes 12V which is in the wall for the door control. But for use in bedrooms I need power to these and so I went for a micro USB. This is simply because that is a really easy and readily available and cheap way to provide a device with power.

The challenge itself is that the connectors have tiny tiny 0.635mm spaced contacts, and are also mechanically crap and come off the board. I ended up getting some connectors that I could superglue to the PCB, and thankfully the power contract are the end, so even though milling and soldering at 0.635mm pitch is just about possible (surprisingly) I can avoid this by actually only soldering the end pins for power. I decided to make the 3D printed case design fit tightly around the connector as well for extra mechanical support, except that means removing from the case pulls the connector off the PCB!

In short, some interesting new hardware challenges.

Software

There are a lot of libraries around for ESP32 and ESP-IDF already, which is nice - but perhaps not as many as for the ESP8266/Arduino based environment.

That said, these are simple enough devices, so actually I ended up doing the I₂C interface for the CO₂ monitor myself using the ESP-IDF directly.

I used a library for the DS18B20 though, and it seems they have been quite clever using the IR remote control hardware to make the one wire bus work using DMA. Impressive. I decided to use a DS18B20 as (a) it allows the thermometer to be positioned where you want, (b) it is away from the components that could get slightly warm, and (c) it seems way more accurate than the one built in to the SCD30 CO₂ sensor. However, the code is happy to use the SCD30 if you don't want to use a DS18B20. Similarly, the code is happy to work without a display, but I am quite pleased with the display, to be honest.

For the display, there is a good Adafruit GFX library, but I ended up doing it myself. The commands for the SSD1327 OLED controller are simple enough, and only a few lines of code to send a whole frame buffer over I₂C. As such, I decided to make some 16 grey level renders of my existing font designs. There is also a logo (configurable).

I found the CO₂ reading was liable to change quite quickly. This is great, except just standing looking at it caused it to change a lot due to your breath. So I ended up damping the reading (biased average with last reading) to remove spikes.

I also decided to round the values for reporting on MQTT so that it is not flooding with updates every second. Configurable rounding, preset to CO₂ at multiples of 10ppm, RH at whole percent, and Temp at 0.1℃. I also added some hysteresis to the reporting.

Obviously I have my air-con control code working with it - just had to tell it a different topic to watch for on MQTT, but I added logging of CO₂ and R/H as well just for fun.

And finally I added settings so it can send MQTT to turn a fan on or off based on CO₂ levels.

It is interesting to see how CO₂ changes during the day.

Overall I am very pleased with it. It is all on GitHub (here) with PCB milling, 3D printed case design, and code. Have fun.

P.S. The OLED displays are made of glass, and very very very easy to accidentally break. Especially if the 3D case design is a fraction out!


P.P.S. I have one by my bed, and it is quite bright, so I now have an MQTT contrast command tied in to the sleep tracking stuff so when I get in to bed it goes dim :-)


2019-03-21

Understanding CO₂ air quality better

I have had my new CO₂ meter for a couple of days now, and using it actually requires a bit more understanding than I expected. So here is what I have worked out so far...

First off, what the levels mean!

The tweet I posted listed 1000 ppm as an "acceptable" maximum, and 1400 ppm as "impaired decision making". The 1000 ppm comes from a recommendation of a heating/aircon organisation (ASHRAE), but it seems that was a maximum for comfort and is not in their later specifications at all.

There are other places that talk of 1000 ppm as a target for comfort, and that 600 ppm over the outside level is an "acceptable" maximum (outside typically 400 ppm). I don't understand why the reference to outside matters - one comment is we get acclimatised, but if that is the case then my spending all my time inside (well I used to) would acclimatise me to a much higher level.

Interestingly, the hand-held meter I have has a "calibration zero" feature which involves it being outside for half an hour but what it does is set that as 400 ppm exactly. This makes no sense to me, as calibration needs a known reference and I have measured outside from 430 ppm to 560 ppm at different times and places, so not a reliable reference.

Whilst 1000 ppm may just be for "comfort", I see no reason that I (or my staff) should not be comfortable, and indeed with the prospect of higher levels causing tiredness and impaired judgement, it seems like a perfectly sane target for me to use.

I have obtained a couple of different CO₂ meters that I can leave plugged in for me office (I had a simple temp/humidity one before). It has an interesting view on levels :-


Interestingly it has an automatic baseline calibration that sets 400 ppm as the lowest it sees over the last week. I don't understand why the meter is not accurate rather than relying on measuring my local outside CO₂ levels!

The two meters are pretty consistent, but a bit higher than the hand-held meter - none have been "calibrated" though.



Levels accumulate!

This is what really fooled me. I expected that levels would reach an equilibrium with people breathing and air flow to/from the room quite quickly, so one could measure and see what say "one person working in this 5m x 5m room" gets to. I was wrong.

It my home office today the level started shortly after 9am at 430 ppm, but with just me in here (even coming and going a bit) the level has steadily increased throughout the day reaching 1000 shortly after 2pm. It kept going! It has dips when I was out of office for a walk, and when the outside door was open for a while for a delivery, etc, but it has shown no sign of stopping yet!

This means, for example, when I checked the office and saw 1200, that could have been the result of a reasonably ventilated office with a lot of people and be like that all day, or could just be where it has got to in a poorly ventilated room at that time of day (getting way higher as the day goes on). I'll have to do a trace for the whole day to know.

Ventilation

What I have concluded is my office at home needs some validation. The small vents over the windows (with windows closed) are clearly not enough. My plan is getting some whole day graphs before and after to confirm how well it works, and I'll post more details.

The same is true for my bedroom - not wanting a window open to fight the air-con. I saw that the levels similarly just keep going up when in there awake. Once asleep they do slowly go down, but that was tested with only one person in the room.

I'll post more once I have more data and comparison with the fans installed.

P.S. Nice thing about my man-cave is it has two doors - open both for a minute and you remove all the excess CO₂ and back down below 500 ppm ready to start again.

2019-03-20

Air quality and CO₂ levels

I saw an interesting report that a few people in a conference room can quickly result in CO₂ levels such that there is impaired decision making. Wow.

So I thought, I wonder what CO₂ levels I work in normally.

Of course a good start is understanding what CO₂ levels are sensible. Wikipedia has some answers. It seems below 1000 ppm is acceptable, but there safety levels set way higher than that.

I went and got a meter off Amazon (where else!). It seems to be easy to use, and gives two particulate values and a CO₂ value as well as temperature and humidity.

So, first off, my man-cave where I work...

This is a small room, under 5m x 5m, with windows (that I keep closed), two doors (also closed most of the time) and no air vents as such. It has air-con which seems to filter quite well, so the day starts with this - very low particulates and sensible CO₂ well under 1000 ppm. It is only myself in the room normally though.

Once I am in here a while, CO₂ gets to over 900, but it depends what I am doing.

I have a treadmill - if I use that then the CO₂ gets over 1000 in a few minutes.

So maybe I don't need extra ventilation in here - if I open a window when using treadmill perhaps. This time of year a window is not problem but in summer or winter it is not ideal, obviously.

For reference, outside this morning varied between 520 to 560 as I walked through town to Tesco for my Costa breakfast. At Costa it was 700 ppm, and particulate levels of 3. Impressive.

Where next - well, my bedroom. I have air-conditioning in there as well, and as such do not normally have a window open. The bathroom has a window slightly open but the door to bedroom is normally closed. I was quite surprised that during the night the levels were over 1300. I suspect I do need some ventilation! I tried a window but it is behind curtains and did not result in much in the way of extra air circulation or a noticeable drop in CO₂!

I also checked the office, which was around 1200. They have a fan but normally off, so I think we can improve working conditions there. I also wonder what a plant or two would do.

Do I really need to do anything? I am thinking a bit more ventilation perhaps in some cases, maybe. In practice, I am planning to install some almost silent low power alternating external air vent/fans with heat exchangers. I'll report back on how well they work in due course.

Assuming I improve the CO₂ levels I won't be able to say if that makes any difference as no real objective way to tell without huge biases creeping in, I don't think.

However, for one final bit of fun - I went in to the kitchen while there was much cooking (so much that shortly afterwards the smoke alarm went off), even with a couple of windows open...

That was impressive - particulate meters literally off the scale (100 is a level that is bad), and CO₂ at silly levels.

If you can't stand the heat, etc, etc...

And yes, I do like my gadgets.

Evolution of my code and PCBs

One the last few weeks my code and PCB designs have evolved a bit! EPD This is still called EPD (E-Paper Display), but in practice it is now...