Sonar ranger for the visually impaired

This project was for someone I know who is blind. If you can’t see your surrounds then coming into contact with things is always a surprise, she is elderly so it’s not easy to use a cane, which is the low-tech surprisingly effective way of orientating yourself if you can’t see.

the fisihed ranger - the glue stick on the side is to give a softwer contact and avoid damaging the ultrasonic sensors

the fisihed ranger – the glue stick on the side is to give a softwer contact and avoid damaging the ultrasonic sensors

Initially I thought the idea was original, but a little Googling shows it certainly isn’t and more sophisticated versions are available commercially, like the minigude and K sonar. But for the low cost ~ £15 of a PIC and a few bits it’s worth a go to see if the basic principle works, assistive tech seems very variable in effectiveness depending on the user.

Bats use ultrasonic pulses to locate things by emitting a pulse of high frequency sound and listening for the echo. More recently ultrasonic ranging has become a big thing in the robotics field. These modules turn the analogue interfacing into a microcontroller-friendly length of pulse digital signal. I bought a SR04 from ebay for less than £3, which does much of the hard work.

SR04 ultrasonic ranger module

SR04 ultrasonic ranger module

You apply 5V, pulse the trig for 10μs and get a pulse of varying duration from Echo. It’s surprising easy to turn that into a tone rising in frequency as you get closer. Start a timer on the leading edge of the echo return, and when the training edge comes, copy the count into the duration control of another timer (copy into the PICs CCP module which controls the period of TMR1) Then toggle a pin when the CCP module resets TMR1.

You have to do a little error checking to catch timeouts or when the distance is too large, the signal gets more reliable as you get closer to an object, which is good. I was able to find doors and follow a wall using it. It works better when the ultrasonic sensors are vertical, the beam spread is narrower. It does not help you find things on the floor.

I was surprised how little it takes to make one of these now – all you need is the HC04, a 16f628 and a piezo speaker, and it runs 5mA off a 9V battery regulated down to 5V.



PIC code on Github


This works better in real-world application held vertically, not horizontally. but I didn’t know that when I made the video.


Olympus LS10 and LS14 DIY wired remote control

tl;dr – the schematic

Olympus LS10 (and LS14) wired remote schematic

Olympus LS10 (and LS14) wired remote schematic

A new approach to a timed recorder

For the last year or so I’ve been trying to make an timed start recorder using a Raspberry Pi and the Wolfson/Cirrus audio card. I was able to make it work, but never eliminate some rattiness in terms of overruns on record – I confess I couldn’t hear them, but it didn’t give me a good feeling. Then I added up the costs –

£25 – Cirrus Audio card
£27 – Raspberry Pi B+£10 – case and odds and sods to make it work
£20 – PCB, time and bits to make a preamp to get from mic to line level

so I’m looking at £80 to get off the ground, and that gives me a seriously power-hungry SD audio recorder, although I can use a timer to save the power drain for active service.

Alternatively, if I could crack the remote control for them I could go on ebay and get a secondhand Olympus LS10, or one of the similar models (LS-5, LS-11, LS-12, LS-14) and use my own LS10 to start with. I can feed a mic straight into the LS10, no extra preamp required and the audio spec is good.

Reverse engineering the Olympus remote control protocol

This cost me £90 on ebay, and it turned out I didn’t need it. You get the info for free, but then I got a natty nearly new LS-14 with an RS30 remote control, so I’m not too unhappy. Unfortunately the RS30 doesn’t work with my Olympus LS10, don’t know why. I’d have been hacked off if I’d just got the RS30 1. Works a treat with the LS14 it came with, on their own  a RS30 seems to go for £50, so I got an okay deal.

my Olympus recorders

my Olympus recorders

Google first – I owe dashanna of the naturerecordists’ list for inspiration, I vaguely recall seeing that post go through on the list. Their solution is this


The connector is an evil little 2.5mm four-pole jack, and these are a bear to solder

nasty connectors to solder, though easier when you realise you only need t wire to two parts. You can pick up 3.3V on the tip, which may be of use...

nasty connectors to solder, though easier when you realise you only need to wire two parts. You can pick up 3.3V on the tip, which may be of use…

I can’t help wondering if life would be easier using a three-pole jack, since only sleeve and ring are needed. Now I didn’t like that battery in dashanna’s version – I mean who the heck would make a wired remote for a machine offering you a 3.3V supply on the tip of the plug and demand you go fit a battery in your remote? It’s just not a clean engineering solution at all. But apparently it works.

So I rigged the cable in series with the RS30 and sniffed the signals. Of the TRRS the tip had 3.3V, the second ring seemed open circuit, the first ring had the wanted signal and the sleeve was ground. Presumably the IR receiver and LED driver are powered off the 3.3V on tip. The signal on the first ring rests high at 3.3V.

Record is this funny little signal

Record is this funny little signal, 100ms at about 1.5V followed by a low

Stop is this signal, pull to ground for 100ms

Stop is this signal, pull to ground for 100ms

In practice you can ignore the second pulse. For all I know it could be an ack back to the receiver to light the LED. I tried using a couple of diodes to pull the signal down to 1.2V but that didn’t initialise record. I then figured this is one of those analogue resistor chain remotes, so I look for what resistor would give me ~1.5V. Turns out if you replace the 1.5V battery in dashanna’s schematic with 100k you get about 1.5V and the recorder starts recording. You don’t need the second pulse at all, and the debouncing seems to be done in the recorder, it takes a little while, up to about half a second to start recording. I guess that means inside the recorder there’s a 100k resistor to the 3.3V rail in series with the first ring.

That works with both the LS 10 and the new LS14, although the RS30 only works with the LS14. So now all I need do is mod the timer to pull down a couple of pins, one through 100k. If I make the stop command the open-drain pin to ring and the rec command a normal pin resting High via 100k to ring, and pull the relevant pin down for 100ms I should be good to go.




  1. I’ve just got onto the Olympus RS30 website and if you scroll through the models that is compatible with it includes the LS-3, LS-5, LS-11, LS-12, LS14, LS-20M, LS100 so perhaps my LS10 was never compatible with it and Olympus have changed their mind since writing the LS10 manual which says on p65 “Exclusive remote control RS30W (scheduled for Spring 2008)”

Compost research moved to

I’ve moved the study into Elaine Ingham’s techniques of soil restoration using microorganisms and compost over to where it’s made more readable and set in it’s horticultural context by Joanne.

a compost heap tracked all the way from start to thermal equilibrium. The sensr for the green trace was reallocated to ambient about 1/4 way through

a compost heap tracked all the way from start to thermal equilibrium. The sensr for the green trace was reallocated to ambient about 1/4 way through

I recently tracked a compost heap from start to reaching thermal equilibrium. Partway through we started another one, and one of the sensors was allocated to tracking ambient. While a single data point isn’t conclusive, it was interesting to see the week 37 (12-18 Sept 2016) second breath of this heap after the second turn coincided with a week of particularly warm weather. This points to a potential ambient sensitivity and it being worth tracking ambient in future and perhaps insulating the heap more in the later stages.

I will keep the technology of remote temperature sensing here, because I’d imagine horticulturalists aren’t that into electronics 😉

How to use an external GPS with a smartphone

The best GPS for a Brit searching for prehistoric stones is a GPS which has OS maps built in.

GPS with OS maps

GPS with OS maps

The trouble with these is the sticker shock, you’re looking at about £300-400, which is still a bit stiff. If you start with nothing, it’s probably still the best way, and you will undoubtedly get a better moving map experience, particularly with a GPS including an electronic compass, which will orient the map correctly for you.

I had a smartphone and Viewranger. I’d bought the Landranger 1:50k set of OS maps on viewranger for about £70 – once you buy digital mapping you’re locked into that provider unless you want to pay up again.

Smartphone GPS is awful and power-hungry

The big problem with a smartphone is that GPS performance is dreadful. Quite how dreadful I hadn’t realised until I got out on Dartmoor and tried to use Viewranger, which made no attempt made to track current position.Well, pretty much until I was on my way back to the start point. I had a paper map anyway, although the smartphone version was easier to control in the wind!

A-GPS doesn't help you here

A-GPS doesn’t help you here

The problem with a smartphone GPS is that by design it will fail you when you need it most, on a featureless moor with no signal. It is new-born each time you start it up. Rather than maintaining the ephemeris (knowing where to look for the satellites) when the phone is off, smartphones use A-GPS – getting the rough location from the network connection and using this to simulate the ephemeris.

Which is OK in towns, and no good to man nor beast in rural areas, because there’s no network connection. So you get to do a cold start of the GPS which can take over half an hour. No fun at all when you are out on Dartmoor. Even in towns the performance of smartphone GPS is dire, compared to a handheld GPS, as I found out looking for birds. Plus it’s power-hungry – running about 43mA @ 5V with continuous GPS on, compared to 25mA with a BT GPS.

Go for a separate Bluetooth GPS

A secondhand CoPilot GPS3 The default Bluettoh code for one of these is 0183 (from NMEA 0183 protocol, I guess)

A secondhand CoPilot BTGPS3, 2003 vintage
The default Bluetooth code for one of these is 0183 (from NMEA 0183 protocol, I guess)

and use an app to get the location signal into the phone, something like Bluetooth GPS to set this as a mock location provider. Then shut off the internal GPS to save power. Start the hardware, then start the app before starting Viewranger, and everything will work better than before. The CoPilot battery is good for six hours, ebay has many more modern equivalents which probably have better battery life. You can save more smartphone power in the sticks by putting the phone into flight mode and specifically re-enabling Bluetooth, this shuts down the power-hungry wifi and phone data systems. Plus it stops Google knowing where you are in real time 😉

I still hanker after a Garmin GPSMAP64 because while this sorts out the poor GPS performance, it is hard to see the smartphone display outdoors, even under a wide overcast sky, and impossible with sunlight falling on it. Nevertheless, the smartphone app is a lot more practical now.

False colour NDVI image

NDVI investigations of compost-enhanced crops

I made a couple of NDVI images of the beans which had been greatly improved using compost compared to those grown without. The principles of NDVI as based on that

Generally, healthy vegetation will absorb most of the visible light that falls on it, and
reflects a large portion of the near-infrared light. Unhealthy or sparse vegetation reflects
more visible light and less near-infrared light. 1

Knowing that, it’s possible to see in the NDVI image that the compost-grown beans do seem to be reflecting more IR relative to visble light, I find this easier to qualify from the greyscale image Continue reading


  1. Understanding the NDVI PDF
Beans showing effects of compost extract

Remarkable win on beans with compost extract

Last year we made compost and compost extract for use in the polytunnels. The extract was also looked at with the microscope. Most of the compost after making extract was used in polytunnel which has tomatoes in it. These look healthy and were praised by another local gardener, but there’s no control. However, we did have a control on the extract applied to the beans in another polytunnel.

If you look at the picture at the head of this post, on the RHS of the picture is the control. This is what we would have grown normally.

in the middle on the top you can just see a blue ribbon which is where application of the compost extract stopped. On the left are the plants where compost extract was applied to the ground, it ran out at the blue ribbon point. Same plants, same time planted, and the same set of seeds. The difference in vigour, height of growth and yield is remarkable and clearly to be seen. Continue reading

The Sainsonic AP510 APRS tracker can work well

As long as you recognise that the stock antenna is truly dire. And you’re prepared to fiddle a lot to get the AP510 and software going. This is not something that works out of the box. As supplied from Ebay in April 2016 the firmware of this didn’t match the software, in fact the firmware was too old. Cue much frustration and turning off and on to try and get it to talk. No dice.

Sainsonic AP510 description

Do what this guy says he has a treasure trove of the files in the links to the youtube post. It worked for me. I had to flash the firmware before my box would talk to the Sainsonic config software, and without doing that this device is no use at all.

Now if you can get an integrated GPS, APRS tracker, 2m rig for £78 it’s a great deal, if you can’t configure it it’s a rotten deal. But it worked for me in the end. There’s much to like, it’s small, it has its own battery, the price is right etc. There are things not to like – the male SMA on the board. SMAs are fragile, that pin is gonna break after about 500 cycles, which is why it’s nice to have the plug on the cable or the rubber duck aerial so you get to change that rather than the rig. Oh and the USB connector is a 3.3V RS232 connector, not a USB connector, though it can use a mini USB connector to a normal USB outlet to charge.

Sainsmart AP510

Sainsmart AP510

So I configured it and fired it up and it sort of works, well, out to about 200m for a J-pole vertical in my loft. Now I admit a J-pole with its somewhat live coax even after a CM coax choke doesn’t belong in the cluttered environment of the loft and I’ll change it for a Diamond X-30 or the like outside at some point, but I have a receive igate on it and it serves other mobile APRS stations okay enough, and serves me up to about 500m in the town with a Kenwood THD7. Continue reading