At the junction of I.T. & homesteading – continued

 

Figuring out a good repeatable & maintainable way to deploy Pi Zeros.IMG_7684

My favorite project screws in action.IMG_7693

The boxes I picked a very tight and leave no room for any other hardware.IMG_7694

I made a hole for a cable gland which is very helpful for cable strain relief, removing friction on sharp edges and making a right cable entryway.IMG_7695

This little guy is only monitoring temperature, I’ll need a bigger box for the greenhouse device as it needs a bit more hardware.IMG_7746

At the junction of I.T. & homesteading

I started acquiring multiple Raspberry Pi Zeros for the purpose of starting to figure out a consistent deployment scheme for the various automation related projects I envision for our homestead.

For now I’ve simply deployed 2 DS18b20 temperature sensors. One on the existing Pi in the Solar shed which serves this blog, and another on a Pi Zero in the house. Only sensing for now which complements the data I’m gathering from the solar array.

The Pi Zero consumes between 0.1 and 0.2 AmpsIMG_7476

Sample data being gatheredScreen Shot 2016-12-10 at 10.25.03 PM

Here are my current install notes for the Pi Zero.

To limit power consumption, add this to /etc/rc.local to turn off HDMI output

/usr/bin/tvservice -o

To be able to read from the temperature probe, add the following line to /boot/config.txt

dtoverlay=w1-gpio:3

Get the python-w1thermsensor package

sudo apt-get install python-w1thermsensor

Reboot & make sure devices are listed in /sys/bus/w1/devices

The python code necessary to read the probe is:

from w1thermsensor import W1ThermSensor
# assuming only 1 sensor
sensor = W1ThermSensor.get_available_sensors( [W1ThermSensor.THERM_SENSOR_DS18B20] )[0]
temperature = sensor.get_temperature()
if temperature is not None:
    print '%.1f' % (temperature)
else:
    print "failed to get reading."

Nosy Monster

Robin & I have been working on a rover for the land since his toy RC car broke. I opened it up to see if I could fix it, and as with many things, I quickly came to the conclusion that “I’ll just throw a Pi in there and do it myself”.

Here’s the supposedly amphibian piece of shit that broke withing 1 hour of use.

Screen Shot 2016-10-16 at 6.04.40 PMThe engines still worked so I bought a Raspberry Pi Zero with a Pi cam, some super cheap Sunfounder Relays

From the ground up

Before anything else, we introduced the notion of a relay. In the past we used Lego motors and batteries to apply power directly to actuators and create little robots. I just snipped one of the wires and had Robin create contact manually so he could make the correlation between a closed circuit and the motor going.

nosy_monster_01

With this “manual relay” in mind, we added a Pi controlled relay to make him realize that what the new gizmos do, is what he was doing by hand.IMG_7013

nosy_monster_02

Ok we have a web controlled Lego motor going. Let’s see if we can replicate with the RC car’s motors.

IMG_7020IMG_7021First the manual relay

nosy_monster_03

Then with the Pi controlled relaysIMG_7024nosy_monster_04Our first iteration looked like this and had a few issues. I separated the circuit powering the DC motors and each were powered by only 1 AA battery. I also had many adjustments to make in the logic.

IMG_7064Eventually, by adding a DROK voltage regulator, I was able to power everything from a single USB charger and prevent the motors from affecting the rest of the circuits.

IMG_7127But the extra hardware is hard to fit in the Nosy Monster so it’s unlikely that I will be able to fit the solar panel that would turn it into a completely autonomous robot. So I started googling for other potential frames and OH GOD I JUST STUMBLED INTO THE WORLD OF RC ROBOTICS. Oops…

In any case, I broke down the control into a step by step process. Instead of pressing “Go” and “Stop”, pressing “Go” will make it go for 1 second. There is 2 reasons for this. First, web based control introduces delays which make for a shitty live driving experience. Second, I would like this to behave like an actual rover on another planet. It reports back its sensors status and human decide on the next steps to follow. Heck I’m even thinking the next steps could be something that is voted on online. This would not be possible with “live” control.

 

[mejsvideo mp4=”http://ben.akrin.com/videos/nosy_monster.mp4″ ogg=”http://ben.akrin.com/videos/nosy_monster.mp4.ogv” webm=”http://ben.akrin.com/videos/nosy_monster.mp4.webm” poster=”http://ben.akrin.com/videos/nosy_monster.mp4.jpg” width=”640″ height=”360″]