The successful compost is ready – it has now fallen to roughly ambient temperature.
unfortunately the temperature logger failed when I was on holiday so I don’t know what the profile was as it cooled down. And yes, it didn’t spend three times three days above 55C – more like three days and two days. There’s still more to learn here.
Time to look at this and see what sort of microbial stuff is in it. I shook this up with about 20 times the amount of water and put a drop on a slide
According to Elaine Ingham’s rules of thumb this is probably a good sort of soil fungus, because if the little round cocci are 1µm in diameter the fungal hypha is about 4µm. I could see that this one was slightly tan coloured, but the incandescent lamp of the microscope plays havoc with the white balance of the camera, making everything bright yellow.
This next one is narrow and clear, so not good in the morphology rule of thumb that fungi < 3µm in diameter and clear are undesirable soil fungi.
I saw no protozoa or micro-arthropods. That’s either because there aren’t any or because I didn’t recognise them. The dilution is high, – it appears that Ingham starts at 5:1 so I’m four times less likely to see these at 20:1.
The high-nitrogen activator should typically be about 10% of the composting materials. These are typically animal wastes – I have used real chicken crap, pelletised chicken crap, and clover. With the chicken manure each time I have scored a fail, whereas the clover was a success.
I suspect the trouble is that it’s hard to mix a concentrated activator properly. For starters it’s not pleasant to do, which discourages it being turned in right. The pelletised stuff is easy to distribute evenly, but even then it seems to lead to localised action.
The pellets seem to go white, like dog crap used to go white when left on the footpath in the 1970s. This leads to a fast and furious burn on the composting front, but with no staying power
The clover was more evenly spread – somehow I need to find a way of spreading the others more evenly. Or maybe go for the urine, preferably from carnivorous humans (there is more N in protein). In Ben Easey’s Practical Organic Gardening (Faber, 1955) he says dilute this with water 1:20 which should make for a better distribution. So I’m going to steer clear of using crap, because I am a wuss and don’t like dealing with it and it’s too concentrated anyway. Clover or urine will be my activators of choice 😉
Joanne’s note Oct 2016:We subsequently (in later heaps) used pelleted chicken manure mixed with water and stirred into a slurry. It took a lot of water to do this! Poor old Richard has a very sensitive sense of small (tough on a small farm with animals!) so he had to leave the rest of the team to finish up building the heap when we started to add the slurry…
If at first you don’t succeed, try again 🙂 The requirements of Elaine Ingham’s thermal composting are quite demanding, keeping the heap at over 55C for more than three days to kill weed seeds and pathogens. The previous attempt got really close then seemed to dry out, this appears to be a issue with using a lot of woodchip which is a difficult material to wet. This time I used less of it.
I used a higher proportion of green material, and more of the high nitrogen clover too. I filled the wheelbarrows with woodchip and then added water until it overflowed, then left it to soak overnight
After it had been over 55C for three days I turned this heap, wetting the material as it was turned over. I should be able to turn this again on Monday, assuming it holds above 55C
Time to put some of the learning from the last time into practice, with thanks to Polly for help with wrangling the materials –
The clover which it the high-nitrogen component because it fixes N from the air is on the black plastic. Loads of wood chip is in the bin and the wheelbarrow. First we put sticks in the bottom to improve airflow because the whole point of thermal compost is to keep things aerobic
We needed to wet the material. In the video tutorials Ingham recommends standing the material in water overnight. We wetted is using a fine spray on the hose
We have a lot of clover, which as Cotswold Seeds describe, are plants that fix nitrogen from the air in combination with Rhizobium bacteria living in root nodules. Since I’m going to use this for the high Nitrogen component instead of chicken crap I wanted to see if there were any active root nodules – after all if there were no bacteria or we had used nitrogen fertiliser there would be no nodules.
The good news is there are root nodules – so the clover is ready to fix nitrogen. The first sample nodules have no red in them, even when dissected, which seems to mean they weren’t actually fixing nitrogen. This only starts when the soil temperature is above 8C. However, taking a second sample from the same patch showed better results.
Looks like with these you have to open the nodules to see the red colour of leghemoglobin , they’re not particularly pink from the outside. Leghemoglobin transports the nitrogen to the plant from the nitrogen fixing bacteria.
Getting ready to have another go at composting the Elaine Ingham way after the first couple of attempts at thermal compost didn’t go right, I dissected the old material to find out why.
On the plus side, the material reduced in volume to 25% of the original volume. That in itself might be telling me something, in that perhaps i hadn’t packed down the original pile enough – the composting bugs are small, and they need to be in contact with the compost to munch it, there is such a thing as too much air gap 😉
Only the very middle was wet, and did not smell, so it looks like this pile largely dried out from the outside, it probably didn’t go anaerobic, and indeed was active enough to nut the smell of the chicken crap used as the high N part.
In the UK air temperature is normally measured in a passively cooled Stevenson screen. The louvred design of the screen allows air to flow around the thermometer. The trouble with a polytunnel is there is no wind at all, as a result the sun heats the sensor up and without airflow you don’t know by how much.
By running a computer fan driven off a solar panel I can move enough air past the sensor to exchange the heated air from the sun shining on the sensor. For the sensor I use the standard Chinese supplied DS18B20 encapsulated in a stainless steel tube
The sensor is housed in a 6cm piece of white plastic waste pipe
The fan is mounted at the top of the pipe, designed to pull in air from below; this way the sensor is not heated by air passing the fan motor, and the airflow works with the natural tendency of warm air to rise. I’ve tried to keep the airflow as unimpeded as possible.
Looking at the results there is a difference of a few degrees
between the aspirated sensor and another sensor mounted on the outside of the plastic tube. They track at low temperatures but not when the sun is shining – the difference here is about 6 degrees, even in March, before the vernal equinox. It is remarkable just how much the air temperature swings – 27 degrees on a couple of days which still have hazy sun.
Weatherproofing the sensor is easier in a polytunnel because as well as the wind not blowing, it also doesn’t rain. I can use a cheaper indoor solar panel, the one I used is a 12V 1.5W unit, Maplin L58BF bought on sale for about £6, not the £20 they seem to be charging for it. even £6 is a little dear! I extracted the flashing blue LED and series diode to maximise the power available to the motor. This also charges the battery of the temperature sensor dual unit, which reports back to the collecting station using Ciseco’s XRF every 10 minutes.
The computer fan was a 12V brushless unit but I run it at about 7V, we’re not after blowing a gale through the tube. It will start at 5V. The Zener is there to limit overcharging of the 4.8V NiMH battery pack in the electronics to about 4mA. It only reports every 10mins so this is enough. The 1N4148 diode stops the battery discharging back through the fan and solar panel in the night. I should really measure what the leakage current of that Zener is 😉
I used a PIC 16F628A driving a Ciseco XRF to send the temperature data from two sensors back. Nowadays I would use the Ciseco RFu which includes an Arduino and low-power standby mods to make this cheaper.
Other implementations
This is a nice weatherproof design – I can’t work out if I missed a trick with using just one plastic tube rather than a coaxial design. Lots more ideas here.
Postscript (July 20 2015)
This rig works reasonably well; if power were available I’d run the fan all the time in daylight for a more rigorous result on summer cloudy days. The biggest problem in a polytunnel is that they are shockingly dusty places, and you have to sponge the dust of off the solar panel every month or so.
This is a description of how to make a remote farm camera. Smallholders don’t always live on site, or you may have an island site somewhere without power. The simplest solution to get pictures from a remote site without power is to use a 3G trail camera and these work very well for tracking wildlife.
The trouble with this solution on a farm is that animals are meant to be on a farm all the time, Trail cameras look for warm-blooded critters so mammals and birds will set it off all the time, making this an expensive operation in MMS messages, which seems to be the preferred method. Even if you get a MMS bundle, trawling through the false alarms will bore you.
What we wanted of a remote farm camera
was to be able to check on how things were going, and whether something has been damaged by stormy weather. A CCTV camera on the farm would be fine, but the problem with this is the power drain, and getting the pictures back. If we had mains power this would be a lot easier, we could use a 3G CCTV DVR with remote access capability. You can easily get 12V CCTV gear, but the power drain of a typical DVR and camera is quite harsh – typically 1A or more. A typical leisure battery is 80Ah, but you should only use half of the capacity of a lead-acid battery that to avoid reducing the service life of the battery, and you must never fully discharge it. This gives you a battery life of less than two days.
Our remote farm camera uses a Raspberry Pi Model A and associated camera to take a picture every 15 minutes in the daytime and upload it to a website
Is covering a 12-acre farm with WiFi a reasonable idea? If so, I could run multiple cameras, say have one on the cows and one on the pigs, all connected to a central location, On the upside, the farm is roughly square and with a mild slope to the ridge at the top. Everything is pretty much line of sight. On the downside, there’s no good central location, which would be the obvious way to service the farm with 2.4GHz WiFi. Distances are long – the field is about 250m wide/long, and I could easily pick up a 300m path length feeding from the edge.
Earlier experiments showed that I could in theory use native WiFi, using a router to receive BTFon from a broadband connection in the town over a high-gain antenna and redistributing it from a WiFi AP. The trouble is I am desperately short of power – every extra piece of kit means more frequent battery changing. In the end I went with a more powerful MiFi access point – one that supported an external WiFi aerial. I used a 9dB TP-Link patch antenna
This feed the farm from one edge, as it happens the antenna is furthest away from the most likely camera sites but slightly higher than the target sites. The signal pattern fans out quite well, serving the likely points of interest. I was chuffed with the performance of the aerial – it gives the right balance of directionality, as I don’t need to bother to serve the field behind me, but it gives very useful gain in the wanted direction – I can just about get a wifi connection with the internal antenna of my iPod touch from the opposite corner of the field. As the forest garden and some of the windbreak trees grow I may experience problems, but that is for another day. By then perhaps we have a site with mains power 🙂
For the MiFi unit I used a TP-Link MR3220 – it’s surprisingly hard to find a MiFi box with an external WiFi aerial socket, because not unreasonably they anticipate you using this sort of thing as a personal cloud. I had to live with the 9V powering and used a Chinese Ebay 12V to 9V converter switchmode converter to efficiently turn the 12V battery power to 9VDC
The other part of improving range is to upgrade the camera end with a WiFi card with an external rather than internal antenna; since the Pice case has been withdrawn I need another solution for that. The PICE case also still exposes the Raspberry Pi camera lens to the elements which is Not a Good Thing leading to the lens haziness problem.
It doesn’t really matter how big the camera is, so I took the opportunity of using a much larger box – a Hammond case 1599 to fit it all in.
If you’re going to put something outside then the fewer holes you can drill the better, hence the use of sticky pads and cable ties as mounts, and the single 2.1mm power socket on the base, so water could drain out that way if necessary, and could be standing 0.5cm without affecting the electronics.
The case has several mounting lugs in the lid, but in the end I will have to drill a hole for the camera. I placed an O ring on the case and a microscope slide pressed down by foam and the camera to make a watertight seal but keep the elements out of the lens; that way hopefully I get to either clean or replace the microscope slide after a season is out rather than the camera.
The 12V to 5V converter is mounted in the case; that way any cable losses aren’t too bad and the current in the supply cable is reduced, it is about 200mA max.
Setting it up in the field
The paving slab is there because the first version of the tripod ended up flat on its back in the morning. At least the construction can survive a fall of 2m. Perhaps the neoprene sunshade and the extra area at the top of the pole presents too much wind loading.
Controlling the Pi
I postulated all sorts of complex feedback when first considering this, letting the Pi tell the microcontroller to turn the Pi off with a GPIO pin, but it’s been massively simplified. A microcontroller powers up the Pi, and pulls the power after 5 minutes. Then it waits 10 minutes and does it again, provided that the 12V supply is enough (>11.5V) and it is daylight.
I use similar Python code to the first cut, but this time I start running the takepic.py camera code on startup. I look for a switch closed on the GPIO, and if so, abort uploading the picture because the Pi is in service mode1. This switch is a reed switch mounted on the inside of the case and activated by sticking a magnet to it, this saves a hole. It lets me get onto the Pi and configure it. Normally the switch is open, in which case the Pi tells the system to do a shutdown in 4 minutes, which is enough to connect, get Wifi network DHCP and SFTP the picture to the website. 5 minutes after powerup, the microcontroller managing power pulls the power from the Pi.
The shutdown command on the Pi minimizes the chance of corrupting the SD card, and the picture is written to the /run/shm/ ramdisk prior to uploading, since there is no point using up SD card write cycles with ephemeral data like that.
#!/usr/bin/python
#$Id: takepic.py 58 2014-11-06 20:54:02Z ermine $
import time
import picamera
import paramiko
import os
import socket
import datetime
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD) # USE Pi BOARD pins, not the BCM ver
GPIO.setup(7, GPIO.IN, pull_up_down=GPIO.PUD_UP) # 7 is next to gnd on pin 9, so set pull up
# defs
camerafail=False;
DIR='/run/shm/'
imagename=socket.gethostname()+'.jpg'
remotename='WEBSITE.COM' # assuming this is reachable by ssh and www
try :
with picamera.PiCamera() as camera:
#camera.resolution = (2592, 1944)
# The following is equivalent
#camera.resolution = camera.MAX_IMAGE_RESOLUTION
# run half res to test out connectivity etc and save money
#camera.led = False
camera.resolution = camera.MAX_IMAGE_RESOLUTION
#camera.resolution = (1296, 972) # do half real to eliminate Bayer softness and save TX bandwidth
camera.exposure_mode='night'
camera.meter_mode='matrix'
camera.start_preview()
time.sleep(2)
camera.capture(DIR+imagename, resize=(1296,972), format='jpeg', quality=20)
except picamera.PiCameraError,e :
print e
camerafail=True
finally :
camera.close()
time.sleep(10) # hopefully nw is up by now
if(GPIO.input(7) ==1):
#print "will shutdown"
os.system("/usr/bin/sudo /sbin/shutdown -h +4 &")
if not(camerafail) :
timedout=False
connected=False
counter=0
while (not timedout) and not connected :
try :
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect((remotename,80))
print(s.getsockname()[0])
connected=True
except socket.error,e :
counter += 1
print counter
finally:
s.close()
time.sleep(5)
if counter >= 5:
timedout=True
print 'Failed to connect to ',remotename,' ',datetime.datetime.now().strftime("%y/%m/%d %H:%M")
#upload
if not timedout:
print 'ftp image starting ',datetime.datetime.now().strftime("%y/%m/%d %H:%M")
try :
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(remotename, port=2222, username='USERNAME', password='PASSWORD')
sftp = ssh.open_sftp();
sftp.put(DIR+imagename, '/home/DIR/'+imagename)
sftp.close()
print "closed SFTP"
except paramiko.AuthenticationException,e :
print e
except socket.error,e :
print e
else :
print "manually aborted by jumper 7 to 9"
Power savings
This has massively reduced the power drain of the camera – it is < 200mA for a third of the time, with an outage during the night of about 1/3 of the time, so about 1/3 × 2/3 × 200mA average, ie ~50mA. The original power drain was about 300mA 24×7.This power drain is much less than an electric fence which is usually about 150mA, so it could be used from the fence battery, which would then let us monitor the fence battery voltage as a bonus.
It also suits solar panel charging well, as the power drain is proportional to day length. The WiFi node draws more (a sustained 200mA during the day) but at least it is just one place where the battery needs changing more often – about once every two weeks. That’s livable with, but if I’d used a WiFi long-distance connect and a WiFi high power AP that would be shortened too much, particularly as logging into BT Fon would require another Pi to keep the connection open. GiffGaff run about £7.50 per Gb PAYG which isn’t bad.
Got pigs
So far so good. The new pigcam
works all over the likely sites on the farm
concentrates the data through one GiffGaff SIM[ref]data service gets cheaper with volume, so this is much better than each camera having a SIM[/ref]
reduces power at camera sites to minimal
lets me add more than one camera to the system
which is a success compared to the single site version which had a very high power drain because it wasn’t being power-managed.
In service mode I get to ssh into the Pi to configure it, and issue the shutdown command manually – I bypass the microcontroller shutdown for that ↩
The old pig camera is due for a rebuild. I went with the Pice outdoor case for the new one, but it’s interesting to see how the old one stood up to the weather. It was still operating when I decommissioned it because I needed to scavenge some of the network parts for the new one. In particular I now use a central WiFi/Mobile node to cover the whole farm, and use Wifi to upload the pictures for each camera via that node.
The original one ran the Mifi node and the Pi all the time, which was hard on battery power. Hence the rebuild, but if the case held up over a season I may as well use it rather than splash out for a new Pice…. The original case was larger than it needed to be, but I can now use this space to put the light sensor and 12V to 5V DC-DC converter inside it.
So how did it stand up to the ravages of the elements. When it was new it looked like this
and the innards looked like this
So from the outside it now looks like this
Which isn’t bad. It vindicates one of the things i did, which was to use plastic screws for mounting. Unfortunately the camera needed M2 screws which were steel, and these rusted. The sun bleached the tape, but the box itself stood up to the light well.
The cheap Chinese DIN socket is starting to rust
I had fitted this on the underneath of the case. There are two philosophies when it comes to trying to run electronics outside. One is to go IP65 all the way and keep water out, which means waterproof enclosures, Dri-Plugs for power etc – you’re looking at about £20 to get the power through the case and maybe another £20 for the case itself. Farm hacks don’t really need that sort of ruggedness, which brings me ot the other philosophy
Accept water is going to get in. Mount all connectors on the bottom so it can drain out. I actually picked this up from the PICE guys – they mount the raspberry Pi on the lid of the case, so water could be standing on the bottom half and it would be okay.
As it was no water seems to have penetrated, no creepy-crawlies seem to have got in. The latter are a pain with electronics outside- they seem to be attracted to the heat, or maybe the power itself. It certainly helps to lift the device into the air, or simply put it on a stick a metre or so high, compared with ground mounting. But this looks clean, there’s a little bit of evidence ingress on the seam, and the PVC tape degraded in the UV so this may be worth some thought. I will re-use this box, mounting the microcontroller timer and the light sensor on a board set into the rails, so I don’t have to drill the box for mounting.
However, one thing has been impaired, and that is the lens of the camera, which gives a hazy effect – it was clear and not foggy when this picture was taken
Normally a CCTV camera is behind a piece of glass to keep the elements out and now i know why. Cleaning the lens with IPA didn’t help. I am tempted to glue a piece of microscope coverslide over the tiny lens in future this would have the optical quality and would be cleanable/replaceable. Continue reading “a Raspberry Pi camera after a season outdoors in the British weather”