Showing posts with label weather. Show all posts
Showing posts with label weather. Show all posts

Sunday, October 6, 2019

Around Kenya in 4 days and a year ( part 2)

The New Year adventure continued past the sad mercury laden mines of Migori to the Tanzania border , Isebania in particular. We met up with professor Sangai Mohochi and had a brief gander into Tanzania ( Serere) for a beer. Later we had some Orokore Beer made from millet, we sat around a car tyre sipping still fermenting beer from straws.

We took our leave from the professor and had a long drive out to Rusinga island. A beautiful place without much of the tourist trappings lakeside places have. The Suba culture is being revived with festivals. We woke up early and did a trip around Rusinga Island and visited Tom Mboya's Mausoleum. One of my high school's illustrious alumni. 

After another long day of driving and some fiddling with charging phones directly from a car battery ( another story on how many engineers does it take to charge a phone), we ended up in Naiberi River Campsite. It is more like a glamping spot and ideal for a quiet New Year's celebration around a fire in the main hall.



A late lunch/early dinner at Rift Valley Lodge Golf Club. We went for a post dinner walk on the greens and ran into herds of zebras and antelopes. No wonder this golf club is classed as one of the best in the Africa. All the excitement was followed by an uneventful drive back to Nairobi.


We arrived tired but energized the beauty and possibilities in Kenya. The roads need to be built, electricity needs to be channeled to houses, there is a lot to do. We look forward to hanging around and getting it done. Eric is heading back to his PhD at Harvard, Gichini will be doing something about the weather prediction and I have helped put Lori Systems on a solid technical footing and change the Logistics landscape.

Tuesday, August 30, 2016

Counting Pulses with Maxim DS1682

I am often asked about interfacing the Energy Monitoring system with traditional spinning disk meters or blinking LED/Pulse type meters. For this application there used to be a very nice 1-wire pulse counter IC from Dallas/Maxim - DS2423. However it is end-of-life and no longer available. The next best option is the DS1682/83 series of RC oscillator based elapsed time recorders. The elapsed time function is not critical for pulse counting, however it is a nice feature. The lack of crystal makes is slightly inaccurate, but pretty robust and great for outdoor and industrial applications. It also has an EEPROM to store counted pulses, so the counts are retained across power cycles and the main MCU can sleep between long interval reads.



To test out this chips I built a Grove breakout which I am planning to use with a tipping bucket rain gauge. I have tested it on the ESP8266 with some basic Arduino I2C code and theres seems to be already existing Python code I can extend to use with my Udoo Neo Weather station.


Pulse counting can be easily done using a GPIO and an interrupt, however it requires the MCU to be constantly on. The DS1682 has a 17bit event counter giving it 131,072 total event counting ability before a reset is required.

Sunday, July 10, 2016

UDOO Neo Weather Station

I have been running my UDOO Neo solar powered in my shed for a while. I have been meaning to attach some bitcoin miners to it, just to support the network, since I am too far behind the curve with hardware to make any money off it. From what I read, the mining farms have taken over a whole hydroelectric dam somewhere in China.
Solar powered UDOO Neo
Anyway I finally got around to attaching the I2C bricks sensors that came with my UDOO Neo kit. There is an LM75 based temperature sensor and an MPL3115 based pressure/temperature sensor which can used an altimeter/barometer. These 2 sensors can be used to get some basic parameters for upload to Weather Underground or simply Thingspeak.

UDOO Neo with Sensor Bricks
The first set is grabbing the data from the sensors. The UDOO comes with modules to map the i2c devices to the linux device tree and fetch data from them by simple file reads, no I2C knowledge needed. I also found Tentacle Pi which is essentially an I2C multiple device driver library for Python. In my solution I ended up using a hybrid approach of direct i2c reads using Tentacle Pi and some /sys/ reads.
Results of i2c scan on channel 1
 The MPL3115 is read using the /sys/ method as shown in the gist below:
The LM75 is read using direct i2c and Tentacle Pi:
There is a few degrees of discrepancy between the 2 temperature readings, however I trust the temperature from the dedicated temperature sensor more. A simple test to show the data on console works fine.
Testing sensor bricks
From there it is a matter of pushing it out to Thingspeak to get a graph. I am looking at adding other sensors from the future bricks line or designing some myself using my I2C knowledge, particularly a wind speed sensor and a light sensor. The wind speed will help me determine if I can install a mini windmill generator and I can use the light data to correlate my solar panel output to solar intensity.