Redesign and Rebuild

Because the first version performed well, it would be interested to scale up the sensor cocktail with more sensors and refine the already existing functionality. We first look at an errata that mentions the problems that were spotted, as some sort of list of QA detected faults that will now be addressed in the next version, whilst leveraging the overall idea of the first version.

Errata

  • Some sensors are just not designed to work without calibration, such as the gas sensor, its values being meaningful only relative to successive measurements and even then, it is not clear what an intrinsic value means. It is clear that some of the existing sensors should be swapped out for better alternatives and now we have a sensors rundown writeup that documents the experiences with various sensors.
  • Initially the idea was to scale up the wood tower but also build small notches so the tower could be expanded upward. The problem during the first build was that the notches were too fidgety to get right, and even building struts out of wood and then gluing them down, just did not hold well enough. So for the revised build, just holes will be drilled and some PCB distancers, like for motherboards, will be used to both construct and hold up the tower structure.
  • The WEMOS LOLIN32 Lite is a very pretty controller with plenty of options, but one major drawback of the LOLIN32 is that if Wifi is used, then half of the analog pins simply cannot be used, which massively reduces the usefulness of the LOLIN32. In fact, counting, the total mount of analog inputs is 6, while using Wifi, which is necessary for this project, such that the LOLIN32 should rater be replaced by something else. A WEMOS D1 Mini on the other hand, does not have the Wifi limitation and it is loaded with analog inputs.
  • Painting the whole box black was mainly meant to reduce the influence of the sun on the sensors but it does not help much when some of the sensors are sensors that detect light of UV rays. In fact, the UV sensor never even worked, and did not provide any value, in spite of ulterior efforts to build-in windows into the box.
  • I2C seems to be both touchy and sketchy in terms of requirements and proper contacts and given that the project is kept modular, the wires cannot be soldered onto the board, such that alternative sensors will have to be used and preferably by keeping everything uniform by only reading analog signals.
  • The cable management was a mess and no solution was really found such that Dupont wires were just pulled on the outside of the tower, floating in mid air and for the last level, a hole was even drilled through the wood. It would be nice to have a pipelined method of pulling wires between the various levels of the tower. For that purpose, it was decided for a hole to be drilled into the middle of the tower, all the way, through all the levels, which will become the main plexus for the cables.

Design

The overall design follows the initial design but uses PCB/ circuit standoffs with screws to separate the levels of the tower which allows for the tower to be infinitely expandable. Note that the structure only needs to hold, but it will not be subjected to any sort of torque and will be suspended in mid air so there is no need for any vertical stability.

Naturally, expanding the tower requires larger outer shell that, this time will not be pained over. Ironically, the same producer that provided the box for the first version, has a larger variant of the same box, exactly double in size as the original one.

With all that laid out, it's time to build the solution and see what can be obtained.

Tower Realization

Wood is a great material to work with when the realization does not need to be waterpoof. First, wood is a perfect isolator and then wood is also a very malleable material that is easy to work with and easy to correct mistakes if necessary. In this case, the tower will be protected by an outer transparent plastic shell such that the only requirement here is to make the tower stand and no water proofing is necessary.

For starters, three levels are cut as small shims of wood, and then a hole is drilled through all of them. The hole will be used to pass wires such that the different levels will be able to communicate and will also keep the wires contained within the tower itself without reaching around and making the wires prone to disconnections. Keep in mind that Dupont cables will be used and Dupont cables are really meant for prototyping; definitely not the type of connection that is renowned to be resistant to shocks.

The painting process is all the same as usual:

  • one coating of primer,
  • one coating of paint,
  • one last coating of acrylic paint

Some excess purple paint was available, so it was used for this project in order to spare up on the most used paints (white and black). Later on, another fourth stage was added and the process was all the same.

It was decided to use nylon standoffs, the biggest benefit being less metal and hence less weight, along with the fact that nylon is not conductive so it provides a better protection in case wires end up detached and dangling. After the tower is finalized and then placed next to the old box, just to compare the dimensions, although a later stage will make the older box unusable due to the size of the tower.

The initial design had the power cable reaching through the wood but for this revised build, a bottom seal made out of rubber will be used instead. The rubber seal will be glued onto the last layer, cut as a star and then the power cable will reach through the bottom seal in order to prevent any water from splashing inside the cocktail tower. The same design is preserved, with the bottom part being cut off and then replaced with a metal grate in order to allow air to circulate through the box freely in order to be able to impress the sensors.

The rest of the job will not be detailed because it involves nothing too eventful. A Brother label printer came very much in handy because it became very easy to mess up all the Dupont cables so many of them had to be labeled along with keeping a map of which cable goes to which corresponding GPIO analog pin on the WEMOS ESP32 D1 Mini.

Maybe as a deviation from the plan was that the levels were built with variable height, which is a great solution to preserve space in case the sensors being used do not need all that extra space. For example, one of the tower stages hosted a temperature and a noise / decibelmeter sensor, both of which where fairly large in size, such that they occupied the entire level, but at the same time the sensor were fairly short in height so smaller circuit board standoffs could be used. The same was true for another stage hosting a dust sensors, that could be made shorter in height.

All the same, the very first level (the one on the bottom), that hosted the WEMOS ESP32 D1 Mini and the buck convertors ended up double in height compared to the rest because it was deemed very handy to be able to just move the Dupont connectors with fingers without having to dismantle the tower. Even so, given the multi-stage build, it is fairly cool to be able to just unscrew the level that needs to be worked on, instead of having to take everything apart (this can be done simply by rotating the standoffs for a given level, that remove themselves and open the build in two).

Sensors Swapout

  • the MQ gas sensor was removed, given no capabilities to calibrate,
  • the DHT11 was swapped out for a DHT22, an excellent sensor with a phenomenal performance for the price, also from an excellent Chinese producer called Gravity (albeit, a little peppered in terms of expenses),
  • also by Gravity, the linear analog sound meter v1.0 was left there (and repaired due to blowing out a capacitor after reversing the polarity, all is well now),
  • a GP2Y1010AU0F dust sensor was added, mainly because it was cheap and offered a good performance, detecting up to $0.8\miu m$ dust particles (it is great for detecting upcoming dust storms),
  • the UV sensor was swapped out for an UV sensors that does not use I2C but rather one single analog wire,
  • the "light sensor" was left there; even though it does not produce "scientific measurements" it is still very accurate in terms of illumination (for example, for easy detection of day and night cycles),
  • as mentioned the WEMOS LOLIN32 was replaced by a more compact WEMOS ESP32 D1 Mini (a beast of a machine, like a WEMOS but with a double rail on BOTH sides) with plenty of analog inputs as well as very good performance in terms of power consumption

Some sensors were configured but did not fit the plan:

  • O3 (ozone), O2 and/or CO2 sensors, both being per-calibrated and with linear, as well as analog variants available, but also massively expensive (ie, about $USD50$ per sensor, which is massive compared to the rest of the expenses that are in or up to 10s of USDs)

Conclusions

Interestingly, all the sensors and the WEMOS could have been powered directly from the $5V$ rail with the $3.3V$ rail not being used at all but it was decided to keep both rails for now, just in case something else gets added that needs the $3.3V$ rail.

Either way, at least three more levels could be added, just judging by the look of the external box, which promises good extensibility in the future.

In order to get an overview of how the sensor cocktail will be used in practice, the box will be suspended from a tree or a metal rod, just like a lamp, with the bottom cable being used for power that will be pulled to the power source.

One further development might be to add a solar panel and make the cocktail self-powered, which is now even more feasible given the low consumption of the WEMOS ESP32 D1 Mini that has been swapped in. Similarly, the sensor cocktail only collects data on a timer, such that in-between collections, the ESP could deep sleep and greatly reduce the power. For the time being, it was decided that the build requires Wifi anyway, such that it might just be powered by a longer cable that can reach to a power source.

Index


iot/creating_a_sensor_cocktail/revisions/2.0.txt ยท Last modified: 2025/03/31 14:27 by office

Wizardry and Steamworks

© 2025 Wizardry and Steamworks

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.