GPS serial receiver for Kenwood TH-D7

press the pos button while GPS data is running at it will show you the locator,and lat/long, the degree and decimal points flash on reception. With an unlocked GPS it is lat/long of 0
press the pos button while GPS data is running at it will show you the locator,and lat/long, the degree and decimal points flash on reception. With an unlocked GPS it is lat/long of 0

This project is to make something that used to be common – a GPS receiver with serial data output. Modern APRS handhelds like the THD72 have GPS on board, but my Kenwood TH-D7 is from the turn of the century and doesn’t have onboard GPS. I used to pipe the output of a handheld GPS into the serial port. That worked fine, but in the field it’s a drag to use a handheld GPS tethered to a rig. Every time you want to put something down or set the rucksack down you end up with a knitting session on the cables. This is why they invented Bluetooth, and one option I considered was running a little Bluetooth receiver to a Copilot BT GPS. Trouble with the Copilot is how do you recharge it in the field, and I need to pick off power from somewhere to run the Bluetooth receiver. So I still get cables to the rig and another battery to manage 🙁

Most handheld GPS receivers like my Garmin Vista HCx have moved on to USB serial interfaces now, whereas the 1990s vintage Kenwood TH-D7e uses 4800-n-8-1 RS232, which is what GPS units chucked out in those days. Early THD7s had a problem reading the serial stream since NMEA 0183.3 superseded 0183.2 for the reasons described in the Potator article. I assumed my unit was one of these, so I constructed the Potator, but while the rig worked through it, it also worked without it, so I was lucky and dispensed with that 🙂

Continue reading “GPS serial receiver for Kenwood TH-D7”

A Ravpower USB iSmart battery doesn’t like low loads

I have one of these Ravpower iSmart USB batteries, and it works a treat when used as the manufacturer intended  – to power a mobile phone or an iPod (4th gen touch in my case). No complaints whatsoever.

I constructed a remote GPS module with MAX232 RS232 chip, and all this wants to run off 5V  – the MAX232 is specced at 4.5V to 5.5V, the GPS is probably more tolerant. So the obvious thing to do is to cut off a USB cable, use the USB A plug and wire the power to my device from this. No need for a regulator, job done, and indeed the GPS fires up. Dandy. No need for 5V regulators, no need to mess about with undervolt cutoff, 5V power straight out of the box, what’s not to like?

An intelligently managed battery

The USB battery gives me a USB chargeable device and integrated power management, you can’t overcharge these or run them flat, and as someone who has just trashed a LiPo battery by leaving it connected overnight and flattening it, I appreciate that thought. Until I find out that

iSmart is too darn smart

and decides my device isn’t drawing enough power and pulls the plug after a couple of minutes. Damn. My GPS draws a hefty 50-60mA, depending on whether the unbelievably bright LED the Chinese makers decided to fit is on or not.

Continue reading “A Ravpower USB iSmart battery doesn’t like low loads”

Revisiting Amateur Radio

I took my Radio Amateur’s Exam (RAE) in 1978 – I’d been interested in electronics as a child but I was never going to be able to afford any gear, I thought a technical interest would add a little bit of colour to my application to do Physics at Imperial College. My grandfather had been a radio amateur and he gave me an old homebrew crystalled 2m AM rig. But when I fired it up and my Physics teacher who was a radio ham looked for the signal at his home about 500 yards away there was nothing there, and I didn’t have the skill or gear to know what to do. I had a multimeter but no ‘scope. I could do the RAE, with a general electronics background and revising the licensing terms on the train up from southeast London to City and Guilds which was taken in what the University College London building in Malet Street. Imposing joint, I think it looked like this.

Somewhat doctored form of my old RAE ;)
Somewhat doctored form of my old RAE 😉

I got into Imperial. Didn’t do anything with the pass for over ten years until I came to Suffolk, and there were a few radio amateurs in the group I joined, and I got my amateur licence in 1991 – next year I will be eligible for the QCWA 😉 Initially I used a modified Tait PMR rig on 2m, but getting crystals cut got old quickly because it was dear. I then bought a secondhand FT290. However, I was living only 15m above sea level in the town, and I never got my head round all this propagation malarkey, and not having Morse meant I had to stay 6m and up ISTR. I stuck with 2m and I was never going to be doing this working the world thing without HF[ref]I’ve simplified things a lot – I had technical and engineering skills but no talent for operating[/ref], and was always a second class licensee ‘cuz only Real Men used HF.

The Internet and Amateur radio

Packet radio and the early TCP-IP over KISS modems was interesting and how I learned some of how routeing went. Then the Internet happened and basically ate amateur radio’s lunch, well, what was left of it after GSM mobile and SMS became widespread. It’s difficult for anybody born after 1990 to realise just how poor communications were, but in the end when you want to just get in touch then a modern mobile phone has solved most of the problems amateur radio had uniquely addressed, if we leave out the self training and experimentation lark. Amateur radio had been doing okay with data communications and packet AX-25, but then that Berners-Lee chap invented the Web, and broadband showed up. It looked like game over, and, well, as for so many people, life and work kinda gets in the way.

A different era, and different applications

Recently I had a use for APRS, and I take another look and I like what a new generation have done with amateur radio, they’ve grabbed it by the short and curlies and dragged it into the 21st century, working with modern networking and tech rather than harking back to the golden days of Morse and tubes. I have nothing against Morse or tubes and indeed now that I don’t have to pass Morse to get on HF I am messing about with it.

I read James M0ACQ’s blog about how he went from a standing start to Full Licence in a year. Not only is he doing good stuff with it and indeed some things I may take a fancy to, but there seem to be others doing more with it.

Continue reading “Revisiting Amateur Radio”

Growlight experiments using LEDs

We are going to do some experiments trying to lengthen the day light-wise on salad leaves, getting them jump started to harvest earlier. Britain is a funny place to grow things, the maritime microclimate means it is relatively warm for the latitude. The growing season can be limited by temperature and/or light. Because we are warmer than typical for the latitude there might be some mileage in tackling light. Britain is basically warm and dark from a plant POV. You tackle temperature using a greenhouse, or in our case a polytunnel.

the mounts let us set the lights higher as the seedlings grow
the mounts let us set the lights higher as the seedlings grow
plant-level view
plant-level view

Trouble is we have no power on site, so this is an LEDs and leisure batteries job. It’s easy enough to turn off the lights once real light is bright enough[ref]I went off this after reading the Philips material and some other web research in favour of a straight time switch[/ref], but a leisure battery gets trashed if I just let it run down too  much, ideally I want to pull the load once it’s down to 11.5 V or so. This gets complicated when you have something charging the battery too, but the whole point I am trying this is because we are around the Winter Solstice so there’s not much light about. So the only way that battery is going to get charged is for it to be recovered, changed out, charged and reinstalled. So once the battery gets lower than 11.5V it’s time to pull the load and keep it pulled until the battery power is reset. Even if the battery level creeps up above 11.5V off load that load should still stay off.

the batetery, timer and low-voltage cutoff
the battery, timer and low-voltage cutoff

What LED colours?

LEDs give the opportunity to favour certain wavelengths – leaves are green because plants don’t use much green, which gets reflected back for us to see.

Red and a little blue seem to be the principal colours used in this Yorkshire facility
Red and a little blue seem to be the principal colours used in this industrial Yorkshire LED4CROPS facility

Red and blue seem to be the light colours wanted, with more blue in the initial stages, red for the flowering stages. This seems to be starting to be big business, though I do somewhat wonder at the approach taken. Many of the woes of industrial agriculture stem from its arrogance in separating variables and hitting one particular aspect for all its worth – chemical farming addressing nutrients but destroying soil micro-organisms that have cycled nutrients for millennia resulting in veg that increasing lacks trace elements (the McChance and Widdowson The Composition of Foods longitudinal research)  and tastes of bugger all being one example. There’s a difference between trying to push things a bit but still working with natural light and growing stuff in windowless warehouses and hubristic statements like

We are beginning to understand that growing crops in this way can improve their quality in many different ways, from their shape and colour to their flavour and nutritional value. We could, for example, increase plants’ vitamin C content.

Hmm. Maybe if we could answer why the mineral content of industrially grown foods has been falling and often tastes bland compared to 30 years ago or more I’d have more confidence in that statement. Can’t argue that yield has gone up due to industrial farming, but quality?

Back to the LEDs – we will always be short of power, though at least we are growing plants that can grow okay in the UK – salad leaves, just trying to advance them. Many people who use grow lights are trying to grow five-pointed leaf plants that aren’t typical UK horticulture. We should be having an easier job 😉 We are dealing with seedlings, which also makes life easier – we can get the LEDs much closer to the plants, a few centimetres. The RHS publication Science and the Garden: The Scientific Basis of Horticultural Practice seems to support this on page 211 which is just as well given our power limitations

1512_rhsOther sources on the web

LEDgrowlights seems to have to good stuff on what to look for in a grow light. Philips have got into this field, their 18W LED grow-lamps seem to be targeted at the flowering stage and it’s clear that red, deep red and blue seem to be where the action is, and NASA also seems to favour red and blue, indeed they seem to have had grief with just red in their early test.

Constructing a battery monitor/power manager

This is easy enough because I am looking for the battery voltage to drop below 11.5V after which I will shut off the lights. By putting this on our RF network I get the status reported back, and by using the Ciseco RFu I get an almost-free arduino chip so I can throw in a temperature monitor, as well as manage down the shocking 7mA quiescent current of the Arduino by sleeping it most of the time[ref]the ATMega 328 does have a watchdog timer but it’s a slight git to use with the Arduino[/ref].

Measuring the battery voltage depends on the reference voltage which is supplied by a KY5033 linear regulator (Texas LP2950 fixed 3.3V) There are actually pretty good, within 2% across -40 to 100C, which is better than the 5% tolerance of my resistor divider, which I want to arrange so the output is 3.3V/2 when I apply 10.24V, which can be done with a 115kΩ top resistor into a 22kΩ lower resistor. The total string draws 12/137 mA which is about 100uA, and the source resistance is about 18k, above the 10k recommended in the datasheet but I am only looking for about 8 bits of resolution. I could put a capacitor across the ADC input to improve that, but I can live with the error.

Jeelabs shows I could take this a lot further, but it’s good enough. I will be powering a string of LEDs drawing about half an amp for half a day or more, so as long as someone gets to the battery in about a week after it shuts down I will only have drawn another 0.02Ah from this cause, plus a bit more from the temperature and RF reporting for a few seconds every 15 minutes.

system overview
system overview

Results – failed

because we couldn’t keep the power up long enough, it just needed too many changes of batteries. We were also fighting the fact that the lighting blocks some of the daylight, so it was probably overall a reduction of light.

I have had success using three 11W CFL lamps about 60cm above some seedlings at home where power is available, so the idea of manipulating light is sound. But it’s not low-power, unfortunately, even with LEDs.

Infrared camera trigger experiments

Wouldn’t it be nice if I could take a picture of a bird as it passed through an invisible beam of light? The idea’s not original, these things exist, but they are quite dear, so I am experimenting with making these.

The most obvious way is a light source and a photocell, and indeed many years ago at secondary school I developed an analogue circuit[ref]people normally consider monostables as digital but mine was built using discrete transistors and resistors, and the time delay was infinitely variable, as it would be with a CMOS 4538, so I consider it analogue[/ref] using OC71 transistors scavenged off postwar computer boards to make up monostable multivibrators for the delay elements  and one with the black scraped away from the housing to act as a phototransistor.

Not bad for a school project from 1976. It looks better as an animation than a sequence of stills.

This gonzo technology of 40 years ago triggered the flash for the source negatives used in the animation – you set a very slow drip, and as the drop passes the photocell it triggers the delay. By increasing the delay between the drop passing and the flash going off you get the progressive animation, assuming each drop makes a similar pattern.

1508_OC71
OC 71

This was done with a manual camera, a new Canon AE1 ISTR that one of the other kids had. But the trick is to do all this in the dark, click the camera on Bulb and use the trigger to trip the electronic flash, which responds within milliseconds and has a short duration of about a millisecond if you reflect some of the flash back into the photocell of the flash (to turn it off as early as possible).

So there’s nothing incredibly hard about doing this, in controlled conditions, in a darkened room. If I were doing it again, I’d do it in the same basic way, using a phototransistor and a CD4538 CMOS dual monostable rather than a discrete monostable – one half to give the delay controllable with a pot and the other to make a pulse off the falling edge to go into a NPN transistor to trip the flash. There’s no need to muck about with PIC microcontrollers or Arduinos though you could do it that way if you really have to for a higher cost plus the aggravation of writing code, plus the jitter of the Arduino sampling the sensor/responding to the interrupt. In high-speed photography sub-milliseconds matter.

Everything gets harder outdoors

Outdoors you have massive and variable amounts of light from the sun, distances are longer, there’s just a whole lot more hurt all round.

Continue reading “Infrared camera trigger experiments”

Measuring paramagnetism 3 – a portable instrument

In Part 2 I described a flat coil sensor which changes inductance according to the magnetic susceptibility of what is in front of it. To make this useful in the field I need something to display the change.

the field instrument
the field instrument. The black button stores the calibration frequency with no sample, the red button takes the reading and displays the result after 4 seconds

I was going to count the high-frequency microcontroller clock over, say 500 periods of the low-frequency sensor signal. That turns out to be a terrible way to do this. I don’t have the gear to measure it, but I suspect the jitter from slicing the 1.5kHz sensor signal is too high. The result is that the third significant digit twitters a lot. By counting changes in the sliced sensor signal (thus doubling the frequency) over a fixed period I get the twitter down to one part in >12000 counts1 over a four-second signal acquisition time. Continue reading “Measuring paramagnetism 3 – a portable instrument”

Wildlife camera with Raspberry Pi, Motion, and temperature sensing

I’m toying with the idea of going along to the Ipswich Raspberry Jam on Saturday 8th Aug and figure it’s be nice to have something to show. There’s of course our farm Raspberry Pi cameras which are in service and this one is riffing a bit off an idea Wildlife Gadget Man is playing with. He’s the guy with the wildlife – I only have sparrows[ref]I like my sparrows but they aren’t going to pose long enough for the camera, and presumably they have their heads under their wings in a hedge somewhere now, a hedgehog in a hog box is the sort of target that would work well here[/ref] so I have to make do with a stuffed toy stoat 🙂

stoatpi

temp

There’s nothing earth-shatteringly new in here, but the ability to make a box which gives you video, snapshots and a temperature plot taken from one of those Chinese waterproof DB18B20 probes is good for mammals.

Continue reading “Wildlife camera with Raspberry Pi, Motion, and temperature sensing”

Using near IR to look for photosynthesis and plant health with NDVI

The NoIR Raspberry Pi camera comes with a blue filter to do near infrared photography – the blue filter ices the visible red but passes near IR which records as red, apparently.

NDVI image of something in the polytunnels
NDVI image of something in the polytunnels. Should have made a not of what this plant is 😉 Anyway, more red and going to magenta white overload=more photosynthesis

NDVI (Normalized Difference Vegetation Index) is the near IR plus red divided by near IR minus red. Take a look at this image for the meaning of the colours – red, magenta and white is more photosynthesis, cool colours and black are less. Chlorophyll uses red but doesn’t use near IR which it reflects, hence the difference carries useful information.Lots more at Public Lab. Continue reading “Using near IR to look for photosynthesis and plant health with NDVI”

Measuring paramagnetism 2 – a new sensor

Part 1

Since I will be taking the sensor to the rock I’m going to temporarily give up on getting an absolute measurement, and take a leaf out of Bartington’s book from last time and use a flat coil. I will never be able to contain the sample in the magnetic field1 as I might be able to in a solenoid, to the effective susceptibility will always be lower than 1. One day I may be able to calibrate this and find a fixing factor, but for now I will look for relative differences.

Continue reading “Measuring paramagnetism 2 – a new sensor”

Measuring paramagnetism

There are two approaches to measuring paramagnetism that seem to be common. One is to use a balance to measure the slight attraction to a magnet – put sample in a balance, apply magnetic field, look for difference in weight of sample using a Gouy balance or use a torsion balance to observe the attraction in a horizontal plane which takes out the static weight of the sample.

The trouble with these two is the attraction due to paramagnetism is weak compared to the weight of the sample – these are lab bench instruments and the electromagnet consumes a lot of power. Although taking samples of soil is easy enough to bring back to the lab, one really shouldn’t be taking a hammer and chisel to ancient monuments to get a sample for a Gouy balance 😉

It's not really right to go chiselling a lump off this to insert into a Gouy balance...
It’s not really right to go chiselling a lump off megaliths that have survived thousands of years to insert into a Gouy balance…

The other way of measuring volume magnetic susceptibility is to stick the sample into a coil and measure the inductance – with a different configuration  of the coil as a search coil it can be used to measure susceptibility at the rockface.

Continue reading “Measuring paramagnetism”