16 January, 22Category: electronics
This is an introduction to one of my older projects which, unlike a lot of my projects, is actually useful.
Navy Bear was a project I started over 2 years ago. The name came from one of those online project name generators and I really liked it. It is an environmental sensor that measures temperature, humidity, pressure and air quality. Its based on a Bosch BME680 sensor which includes a hot plate sensor to detect pollutants in the air such as VOCs, ethanol etc. At the time I did not realise that the C library required to calculate the air quality index value is a pre-compiled and closed source. Having spent months writing the firmware, designing the printed circuit board I wasn’t going to let that get in the way of finishing it.
My son is severely disabled and can sometimes struggle with his breathing. We had heard that humidity can play a part in causing, or relieving, breathing issues. A little bit of research into sensors came up with this sensor. Not only can we keep the humidity in his room at an optimal 60% but we can also check to see the air quality.
The main reason for the post is that after 18 months of continuous use (it just sits on a shelf permanently on) there were a few bugs that I wanted to sort out. The board includes an LCD display. The contrast can be controlled externally via a potentiometer and the backlight LED is driven by a constant current source. This current source can also be adjusted using a potentiometer to allow the brightness to be changed. Occasionally, when adjusting the contrast or brightness, the device would freeze. The display would just stay on the last thing it was on. Turns out, for those who know anything about embedded systems, that I was attempting to use the I2C bus whilst it was still in use. An interrupt caused by turning the knob triggered the ‘update potentiometer’ function. If this happened whilst the BME680 was in use the I2C bus would lock-up. The fix was to set a flag during the interrupt and then check for an update to the potentiometer setting once the sensor was not busy.
This did not take very long to fix. Finding out that Bosch had released a new version of the library, however, took hours to sort. It was one of those times when you start to regret making the swap but you’ve spent this long you might as well finish.
So here is to many more years of service my friend. May you keep smelling the air and keep us informed as you have done so since July 2020.
#100daystooffload 2022. Post 4/100