Tuesday, January 22, 2019

Measurements Back Online

The replacement analog to digital converter that I ordered last week arrived, and I was able to get it nicely soldered up onto a prototyping board with some screw terminals for the 4 channels of signal inputs (signal and ground for each channel):

The software for collecting data from this board also needed to be re-written, and this ended up taking a couple of days to get right. It works quite well now though; measuring the battery voltage at least gave very nice, stable readings, and it is a bit faster than the old ADC converter. If I wanted to dedicate an extra input on the Pi to it, I could also sample it continuously which would probably be even faster, but it seems quick enough and I have plenty of wires to worry about already.

On my last order to robotshop.ca I added a few extra items to qualify for free shipping. One of these items was the DHT-22 temperature and humidity sensor:


I wired it up and put it in the main enclosure where the Pi and some other electronics are located. I also found some C++ code for it online, that worked OK, but sometimes gave bad readings. This sensor uses just a single wire for data, and requires fairly precise microsecond level timing of pulses in order to read it correctly. A dedicated micro-controller could probably handle it, but timing on the Pi with all its complexity and various threads is not always that precise. It messes up about 20% of the readings, which doesn't really matter that much for a humidity sensor I guess. It's not like the humidity is going to be changing very quickly. If one sensor read fails (timeout or checksum failure), just try again. This sensor should be able to tell the user when it is time to change the bag(s) of desiccant in the enclosure(s). It measured the relative humidity in our basement at 35% today, so no need for any desiccant just yet.




No comments:

Post a Comment