Sensors and issues with I2C

The alpha design that we first put together in October 2021 with a ESP8266 and two i2c sensors on a single channel provided reliable data capture. It was possible to leave the system running during the day collecting valid data.

In order to run multiple sensors with the same i2c address (where multiple addresses are not available on the device) we introduced a Adafruit TCA9548A 1-to-8 I2C Multiplexer Breakout. The introduction of this alongside multiple sensors (8 in total during development) we started to experience the well-documented i2c lockup phenomena that we had hoped to avoid. Despite multiple delays to allow i2c communications to complete the i2c bus would lock up and prevent further transfers from taking place.

The beta design of summer 2022 looked at using non-i2c sensors such as SPI and Analog which has proven to be more reliable but the downside being poorer choice.

There are so many sensors available to the maker community its overwhelming and its particularly difficult to keep track of which sensors use which communication method. The following table highlights some of the sensors that we have evaluated.

LabelDescriptionTypeLinkNotes
SHT31-DTemperature & Humidity Sensori2c (QT)±2% relative humidity
±0.3°C accuracy.
SGP30TVOC/eCO2 Gas Sensori2c (QT)Adafruit_SGP30 Class ReferenceVolatile Organic Compounds (VOCs) and H2,
Total Volatile Organic Compound (TVOC),
Equivalent carbon dioxide reading (eCO2).
LTR390ALS/UV Sensori2c (QT)Low cost UV sensor with both ambient light and UVA sensing
DSP310Barometric Pressure / Altitude Sensori2c (QT)High precision barometric sensor
MPL115A2Barometric Pressure & Temperature Sensori2cAdafruit GithubBest for barometric sensing only
SI1145Digital UV Index / IR / Visible Light Sensori2cAdafruit Learn
TSL2561Luminosity Sensor Breakouti2cRetired.
BMP180Barometric Pressure Sensor Breakouti2cRetired
ML8511UV SensorAnaSparkfun LearnRetired
GUVA-S12SDUV SensorAnaElectropeakFaulty Sensor maybe? Doesn’t seem to work.
BME280Temp + Humidity & Pressurei2c + SPIAdafruit Learn
MiCS-5524GasAna
MAX31856Thermocouple AmplifierSPIAdafruit Learnallows for a range of thermocouples to be connected

Some of you might be wondering why not design a PCB with all these sensors with their associated circuits laid out on a single board. Its definitely an option for the future if demand exists but for now its about simplicity and accessibility.

External Wifi

The NodeMCUs in the HiveScientia system rely on WiFi to transmit their signal to the receiving MQTT server. Depending on the distances involved you may need to provide an external WiFi access point.

If you have a good quality home router and/or good line of sight to the NodeMCU you might be able to use your home WiFi connection. The easiest way to test this is connecting your phone or device to the WiFi network and walking around outside and watching for it to drop off and lose the connection.

Bear in mind the stronger the connection the more reliable its going to be. Weather conditions and obstacles that come and go (cars) will all affect the strength of the signal.

May 2022 Update

We now have a semi-working PCB located in an enclosure plus various sensor enclosures and a solar panel mount. Most recently, I have been working on the SD Card functionality so a config file can be utilised and there is somewhere for a small amount of data to be stored.

My main aim right now is to get this system located in our garden collecting data so I can work on the software aspects while I have a reliable and on-going source of continuous data.

Questions and Hurdles

There are a number of hurdles and/or unanswered questions including:

  • The sensors currently communicate over i2c which has limitations of distance. Is this going to be a problem? Will a solution or alternative be required.
  • Will the current power arrangement work and keep everything alive?
  • The enclosures are currently printed in PLA blend – NatureWorks‘ PLA which although is environmentally better than the vast majority of plastics isn’t that keen on Sun/UV and rain. Will an alternative be required. I have a source of Bio-Pro to be tested.
  • I have ideas for a number of additional sensors which may or may not be possible or realistic including: Weight, Soil, Wind, Entrance Traffic.

Hello Beeks and beyond!

Hive Scientia has been in development since Oct 2021 although there was a winter hiatus when nothing happened. The motivation for the system stemmed from wanting to better understand the differences between natural and thin-wall hives. I wanted actual numerical data to support the generally agreed hypothesis of Natural Beekeepers.

Having had a personal weather station (PWS) for some years I was also keen to develop a platform that could replace this function when it finally gives up (its trying really hard to do this). In the past I’d also played with writing monitoring systems for green houses and poly tunnels so there was a desire for any system to be adaptable.

I envisage each station (maybe a location, apiary or hive) having an external sensor node and then one or more internal nodes. In the case of a hive being studied for the purposes of science you may have two or three internal nodes. For a beekeeper a single internal node on each hive with a single external node at the apiary may be sufficient. For more information on the sensors go to the Electronics page

My initial design structure was heavily influenced by WeeWX which for close to 10 years has been my software of choice for the weather station. Weewx is written in Python and runs on a Raspberry PI with a config and templating system that is extendable by users.

Below are some prototype enclosures and the initial test station I used to get a basic system working.

Since April 2022, I have been focused on getting a working prototype together so I can be collecting data – an essential requirement to writing better data analysis functions and output and as a means to test the capabilities of the NodeMCU, power system and sensors.

My general thought is that I would like the project to be open-source so that anyone can access the software and enclosure design files. Currently, all the micro-electric hardware is readily available from Amazon, PiHut and Pimoroni and this means the project lends itself towards the open source and maker market. I will make available for purchase ready-printed enclosures, PCBs and populated PCBs etc. for anyone who wants to avoid the assembly. In other words there will be an open-source option for people wanting to make their own and a ready-to-play kit available for purchase.