Testing the Wolfson Audio Board and Raspberry Pi

The trouble with birds is they get up earlier than I do, so a time-delay start recorder lets me scout locations without loads of early starts.Autonomous recorders are sometimes known as frogloggers in the nature recording community. Commercial variants and great, reliable, but dear. I want something I’m prepared to take the risk of losing to some inquisitive dog-walker, and preferably something I can make enough of to scout several locations.

A Raspberry Pi via Wifi is also a good remote startable recorder over WiFi . A bit like the Tascam DR-44WL but without the nice display. the trouble is the Raspberry Pi has no record facilty. If it had, you can start recording by logging in via SSH and issuing the arecord function. The audio can even be transferred off the Pi remotely via SFTP over WiFi. Enter the Wolfson Audio board – a piggyback audio card for the Pi, which takes over all the IO so you aren’t going to be running any other custom hardware on that Pi.

Installing the Wolfson

Physical installation is easy enough, the Wolfson board uses the bizarre approach of connecting to the GPIO using a standard header and the P5 header using a set of pogo pins.[ref]I did have trouble with these once – what happens is you issue the record for x seconds command and in simply sits there and never times out. Then you press the GPIO down again and it comes good… P5 carries the i2c bus  SCL0 and SDA0 pins which control the Wolfson, lose contact on one of those and you aren’t talking to it any more.[/ref] I’d have been easy with soldering an extra set of pins or a header myself and this is probably a reliability hazard, but I’ll run with it for now. Just as well I’m not going to use the badly aligned yellow and white SPDIF sockets, eh?

I started with a Model A running a stock Raspbian image, 2014-06-20-wheezy-raspbian.zip and ignored Wolfson’s recommendation to avoid a USB hub, because I needed that to see what I was doing to set up WiFi.

bizarre use of pogo pins, it's a wonder these make enough contact for the board to work at all!
bizarre use of pogo pins, it’s a wonder these make enough contact for the board to work at all!

No standard Raspberry Pi Drivers for the Wolfson

Unlike other bits of hardware, to run up the Wolfson card you can’t use the stock Raspbian and do an apt-get install some-sort-of-wolfson-driver. You’re in for a world of hurt here.

You either download the SD card image which is recommended by Wolfson. It’s 8Gb and it means 8Gb, and wouldn’t fit on my 8Gb card, because it requires a card with no dead sectors presumably.

Maybe time to compile the drivers myself following this? Nope – life is too short and I do not have the skillz to firefight what goes wrong. And what with the takeover of Wolfson by Cirrus it looks like the drivers are delayed still more. I like the Torygraph’s opener

Wolfson Microelectronics, the struggling Scottish microchip company, has been acquired by its American rival Cirrus Logic for £278m.[…]
Wolfson has become increasingly reliant on a few big customers including BlackBerry, which as seen sales of its smartphones collapse.
The company reported flat revenues of $179m and mounting losses of $13m last year.
Wolfson admitted it had been blindsided by the rate at which consumers were adopting 4G smartphones, which gave Qualcomm an advantage because it had developed an all-in-one 4G microchip that included an audio processor.

Damn. Those drivers aren’t going to happen any time soon, or maybe ever… I then used Ragnar Jensen’s zip described in this post, and the usage instructions here to install it. Which worked for me. I have no real idea how.

Don’t get the Wolfson card if you want playback until there are normal drivers available

My only interest in the card is to record – everyone else seems to want to take advantage of the whizzy playback options. To be honest there are alternatives if you want playback only, and it looks like the product is at risk of getting orphaned, since it is Pi Model A or B Rev 2 only, not B+, and is still driverless. You run the risk of getting stuck on an old version of Raspbian. That doesn’t bother me, as I will only use this for recording and not run anything else exotic on the Pi. If you want to run a media centre then you could start to hate being stuck on older versions of Raspbian.

How does it record, then?

I made the mistake of firing up ALSAmixer after installing, it certainly showed a lot of options and stuff going on which gave me a good feeling that the Wolfson card was present. But it is easier to adopt their installed ‘use cases’ that are installed in /home/pi

./Record_from_lineIn.sh

then issue

arecord -c 2 -f S16_LE -d 10 -r 44100 record_from_line_in.wav

to record a 10 second stereo track from Line in (that’s the -d 10 seconds, -d3600 would do you an hour, etc)

I experienced random buffer errors every 30s or so. Mindful of Wolfson’s warning about USB hubs I removed the keyboard (which has a hub) though I still used a hub to power the device, and because this was a Model A I had the wifi on the hub, and still took overruns

arecord -c 2 -f S16_LE -d 130 -r 44100 record_from_line_in1.wav
Recording WAVE 'record_from_line_in1.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
overrun!!! (at least 90.703 ms long)
overrun!!! (at least 50.601 ms long)
overrun!!! (at least 15.111 ms long)

Although it looks ghastly here is an MP3 of the original file that I played into the Pi –

and here is the file recorded with the overruns above, converted to MP3

Which doesn’t sound so terrible to me at all. I should still not be such a cheapskate and buy SD cards from ebay, if a Class 6 card is what’s needed for audio 😉

I still got overruns with FLAC but they were shorter, which points towards disk IO as being the problem, since FLAC ups CPU load a lot but reduces disk writing, because that’s its job

arecord -c 2 -f S16_LE -d 130 -r 44100 | flac -o test1.flac - --channels=2 --sample-rate=44100 -f

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
-: 23% complete, ratio=0.468overrun!!! (at least 20.023 ms long)
-: 69% complete, ratio=0.513overrun!!! (at least 0.553 ms long)
-: wrote 11620131 bytes, ratio=0.507

Using FLAC (free lossless audio compression)

you must apt-get install flac

to get the codec first

Pipe the output of the record chain into FLAC to reduce file sizes by about 40% on field recordings

 arecord -c 2 -f S16_LE -d 130 -r 44100 | flac -o test.flac - --channels=2 --sample-rate=44100 -f

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
-: wrote 11692886 bytes, ratio=0.510

with the flac command the single – means  process stdin and -f means overwrite existing file

FLAC used to be a resource hog so I thought I’d look at the CPU usage, which seems to run about 12-15% on a stock Raspbian (no overclocking etc)

top - 18:07:28 up  1:54,  2 users,  load average: 0.05, 0.04, 0.05
Tasks:  74 total,   1 running,  73 sleeping,   0 stopped,   0 zombie
%Cpu(s): 12.4 us,  2.3 sy,  0.0 ni, 84.9 id,  0.0 wa,  0.0 hi,  0.3 si,  0.0 st
KiB Mem:    187592 total,   145604 used,    41988 free,    14664 buffers
KiB Swap:   102396 total,        0 used,   102396 free,    98588 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 2713 pi        20   0  7488 1380  940 S  12.1  0.7   0:03.71 flac
 2710 pi        20   0  4672 1372 1036 R   1.0  0.7   0:00.50 top
 2676 root      20   0     0    0    0 S   0.7  0.0   0:03.14 kworker/u2:3
   13 root      20   0     0    0    0 S   0.3  0.0   0:00.96 kworker/0:1
 2683 root      20   0     0    0    0 S   0.3  0.0   0:01.61 kworker/u2:0
 2695 pi        20   0  9260 1584 1000 S   0.3  0.8   0:00.12 sshd
 2711 root      20   0     0    0    0 S   0.3  0.0   0:00.18 kworker/u2:1
 2712 pi        20   0  4944 1336 1128 S   0.3  0.7   0:00.19 arecord
    1 root      20   0  2148  720  616 S   0.0  0.4   0:04.29 init
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd
    3 root      20   0     0    0    0 S   0.0  0.0   0:00.46 ksoftirqd/0
    5 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker/0:0H
    7 root      20   0     0    0    0 S   0.0  0.0   0:00.75 rcu_preempt
    8 root      20   0     0    0    0 S   0.0  0.0   0:00.00 rcu_bh
    9 root      20   0     0    0    0 S   0.0  0.0   0:00.00 rcu_sched
   10 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 khelper
   11 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kdevtmpfs

Wolfson Card Analogue Line-up

So it’s time to line the card up and find out what analogue levels it takes. I’m going to need outboard audio processing anyway to bring mic level up to line level, and to be honest that’s probably better done off the board anyway away from all the digital power-supply sizzle. I can control levels in the analogue domain, so no need ot run alsamixer unless I want to do remote live recording.

I injected 1kHz tone from a Farnell Wien bridge oscillator ad found that the default gain setting is exactly right for a 1V rms input

1V rms exactly...
1V rms exactly…
on a scope, not the readout is 10x too low because I used a 10x probe
on a scope, not the readout is 10x too low because I used a 10x probe, so that’s 2.8V p-p or 1.4V peak

When I ftp the file to my PC and look at it with a WAV player I see it is as close to 0dBFS as you can get

You aren't going to get closer to 0dBFS than this without clipping
You aren’t going to get closer to 0dBFS than this without clipping

The audio doesn’t start recording instantly, there is an elegant fade in combined with an inelegant DC shift

Audio fades in softly over a short period
Audio fades in softly over a short period

It isn’t a big deal, but you probably want to start it .1s before the desired sound. That’s neither here nor there with a manual start but if auto-started from a sensor trigger that would be a bear.

Audio performance

I terminated both inputs with 150 ohms and used Audition to gather the stats on silence, starting 3s in, a reasonable way past the initial DC bump.

internal noise stats. I'm not going to complain about this
internal noise stats. I’m not going to complain about this

I then scanned the spectrum of the quiet recording to look for any frequency spurs etc, on a fairly narrow IF bandwidth (wide scanning window). I’m not going to argue with the results –

Can't really argue with that
Can’t really argue with that

For reference here is the 1kHz tone (if you analyse it all the distortion comes from my 1970s era Wien Bridge oscillator)

and here is the quiet recording

I didn’t run rightmark on it since I don’t have anything good enough to generate the test signal and don’t know how to play and record at the same time on the Pi.

Since I want this for recording I didn’t bother to test playback – here’s a description of replay.

Time delay recording

The way to use this as a time delay recorder is to set cron to start on boot:

shutdown -h -t 3700

and

arecord -c 2 -f S16_LE -d 3600 -r 44100 record_from_line_in.wav

Then power on the Pi and the microphone preamplifier about half an hour before dawn and pull the power after about an hour and a quarter – the Pi should have halted by then. I will use a PIC microcontroller for that job, because it draws a very low power in the rest state, but an Arduino would work too, though it’s typically 7mA drain is higher than it has to be.

Conclusion

The Wolfson audio card records well, with low noise. You need to use a fast SD card otherwise you will get overruns. But it is poorly supported and the devil’s own job to get going. However, it seems the only game in town for high-quality recording.

Since that’s what I want to go I have to put up with the poor support and idiosyncrasies, it works well enough.

 

a Raspberry Pi camera after a season outdoors in the British weather

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

best not let the IEE see that else they'll revoke C.Eng for disgraceful and outrageous bodgery of the first order ;)

and the innards looked like this

the Pi gets big fast when you hang enough onto it to make it useful
the Pi gets big fast when you hang enough onto it to make it useful

So from the outside it now looks like this

Raspberry Pi camera after a year in the open
Raspberry Pi camera after a season in the open. The messy carving of the rain-shield started out that way

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

1410_din_DSCN2527

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.

No evidence of water, no creepy-crawlies - great
No evidence of water, no creepy-crawlies – great

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

Flare on the camera lens after a year in the open
Flare on the camera lens after a season in the open

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”

Fixing a Maplin EAP450 Car amplifier

This amplifier is used for parties at The Oak Tree where we have no power on site – a 12V leisure battery is good for about 7 hours. I’d noticed one of the pots getting scratchy so one of the four channels was low. This is a four-channel amplifier, and I use it bridged 2×2 as my speakers are 8 ohm. The amp works but I’m losing power, experience tells me this sort of fault doesn’t fix itself.

The go-to site for car audio tech is Basic Car Audio Electronics so if you’ve blown your amplifier and are looking to fix it then that’s a good place to start. The tl;dr version is it’s probably not worth your while, get a new one. The trouble with blowing the amp is not only do you have to find and change the blown part, but also establish the rest of the parts are okay. I’m just fixing a passive part in an otherwise normally functioning amplifier. It’s probably still not worth my time but it’s criminal to junk the amp for the sake of £2 worth of parts.

I did get a meter on one section of the pot and established that it is intermittent and ratty. So I didn’t need the schematic. It’s nice to have, though, but knowing Maplin I figure it’s probably not worth calling them up and asking them to send a PDF or a dead-tree version through the post. I’m still sore about the way they washed their hands of a portable TV that failed after 15 months. On investigation it has clearly not worked right and been incompetently hand-repaired at the factory leading to the screen failure.

Inspection of the circuit board and a bit of Googling turns up some leads. I observe the circuit board is marked APA-450 Rev 2 and Googling APA-450 tells me that Clarion used to make one of these, and the control panel looks suspiciously similar. So now I know what a Maplin EAP450 is – presumably they bought the rights to rebadge this discontinued Clarion amp in a different housing. Or perhaps there’s some noname Chinese company in Shenzhen hawking their production line to whoever will pay 🙂

I got the service manual and schematic from those nice guys at Elektrotanya and established that the part numbers tally with the board.

plan A – changing the pot

Ebay was my friend in sourcing the pot, as it happens also from China. One of the great things about Ebay is the variety – it’s important to get the length of the splined shaft right so it doesn’t stick out too far and this is a slightly oddball length. A 6mm spline shaft is close enough.

Pots showing diferent pitch
Pots showing different pitch

 

I got that right, but I was caught out by the pitch of the pins being smaller than normal. I’d already dismantled the amp before I spotted that. D’oh.

Take a photo before you dismantle the amp

You can’t have too many decent photos of the gear before you take it apart . Once I had taken out the screws I got to see the PCB – it’s clearly not the finest reflow job I’ve ever seen

Maplin EAP-450 circuit board
Maplin EAP-450 circuit board

 

plan B – fix the original pot

Time for Plan B – dismantle the offending wafer of the pot.

 

Closeup of wafer
Closeup of wafer

By carefully bending the tabs I could get the wafer out and look for the problem – there’s a faint patch of shiny something not right at the top left of this, which I cleaned off with some isopropyl alcohol. Plan C was going to be replace this pot and the other one with two fixed resistors per wafer. There’s no real need for this sort of control on a power amp. Ideally I want to line the amp up for full-scale output at +4dBu – there’s far too much gain and it needs pulling well back. the line level input sensitivity is specified as 200mV to 6V

final test – success

 

output at full scale
output at full scale

This is the amplifier at just over 40V p-p showing the two bridge amplifier outputs which are out of phase (I am too cheap to get the probes to set the read out right, so it shows 1/10 of the real sensitivity)

clipping simultaneously
clipping simultaneously

 

and the final trace shows both bridged sides going into clipping at the same time.

Bird recording in the field with a GPS and audio recorder

After a long break, I looked at getting back to using Birdtrack. When I used it before, I used an audio recorder and a GPS, taking a waypoint with the GPS and identifying the bird and waypoint in the audio note. The advantage of this is I could automate taking in the position data, and just transcribe the bird and count.The obvious way to do that now is to use something like the Birdtrack app. Trouble is this wouldn’t run on my device. That wasn’t the main problem, to be honest, it’s easy enough to solve by chasing the upgrade cycle. There’s a deeper problem – it’s not what I want to get out into the field to do, to spend more time peering at an illuminated screen. Not only would Eckhart Tolle disapprove, but you also have to take your eye off the birds. Don’t get me wrong, the BTO have probably done a great job with the app, and if that’s how you want to list birds that’s great, each to their own. It’s just doesn’t do that much for me. But it’s a continuum – after all, what is the real point of recording what you see anyway, particularly as I’m not particularly good with ID so have to pass on a lot?easygpsSurveying an area repeatedly does mean I get to build up a spatial map of territories and get to know some of the birds by the foibles of their song. Now this is made easier I will see if a picture of territories does build up over time in the breeding season. GPS audio mapping isn’t a new idea, I came across it from the OpenMap community, who had largely solved this problem with audio mapping. They simply leave the recorder on capturing a stream of consciousness, because they want to capture data about the whole environment, that’s what a map is. It makes the synchornisation problem easier, as they set a datum at the start of the run, doing the same job as the clapperboard in shooting a movie. The GPS track is a log of where you go, with the sections individually timestamped, which I hadn’t realised. So start the recording at a datum point, and you know that the audio runs in sychronism with the GPS. Modern digital field recorders are crystal controlled to about 100ppm – about 4 seconds off in 10 hours.Now I don’t really want to spend as much time writing up a trip as doing it, so I took a leaf from their book and used a Perl script to parse the GPX data tracklog, find the nearest section to the audio clip timestamp and create a waypoint there, with a link to the audio file in the same directory. Rather than making one massive recording, I can simply make short audio notes when I see the bird, and the Perl script will tally the record time and sort out where I am. It’s easier to find a record and there is much less audio data to process.

Due to the vagaries of real-life devices you have to be able to put in an offset to take out summertime and any slight differences, but an error of 1 minute at walking speed isn’t so bad for bird logging. At a steady 3mph it’s about 80m uncertainty, but in practice you tend to slow down when observing birds, improving the accuracy. File timestamps do go down to the second, but keeping the clocks within a minute is a big ask. The GPS timestamp is always very accurate because it is set to an atomic clock, so it’s down to setting the recorder properly. Or identifying the skew properly at the combining stage.

As an added bonus, this can work on my field recordings too, I can just save the GPX file and I know where they were made too. Using something like GPS Visualiser I can see where everything is on a Google map.

For bird logs, I need to open the audio and edit the waypoint names to the BTO two letter short codes of the sightings, comma separated if there are several at one point. A second run through another script expands these into the long names and creates an Excel file suitable for uploading to Birdtrack.

Raspberry Pi Soundcard From Logitech Headset

The Raspberry Pi has no audio input, and I had a pair of Logitech USB headphones that had gone faulty – the earth on the headset was a dis. The USB part seemed to work, but headphones live on borrowed time, connectors and wiring tend to go, and everything is sealed, So I wondered if I could reuse the circuit board as a Pi soundcard. Stereo output but mono on record, of course, but still useful. It’s all part of experimenting to make a low-cost audio field recorder that can start by itself. Nothing is designed to be repairable here, so the plastic USB module case was pinged apart with a flat-bladed screwdriver. Initially I wondered if the black stuff was a blown capacitor, but it was on both sides of the board so I figured it was probably glue from the connector, which was confirmed when I unsoldered the connectors, it came off like a gluey film.

Logitech A-0365A USB headphones control board
Logitech A-0365A USB headphones control board

Headphone cable uses fine strands of individually enamel insulated wires wrapped around a synthetic fibre core. The good thing about this is your headphone cable breaks later than if you used normal multi-strand audio cable, given all the flexing it has to take. The bad thing about it is it’s the devil’s own job to solder, because as you heat the strand the synthetic coating melts, robbing you of heat and re-insulating the enamel you’ve burned off. So I unsoldered the existing cable and threw it out, and soldered a stereo jack plug for the headphones and a phono line socket for the microphone. I then extracted the original microphone capsule from the headset and soldered it to a phono socket just to test this out in the original circuit conditions. Continue reading “Raspberry Pi Soundcard From Logitech Headset”

Flat Screen UIs make Fumbling Fools of us all

Did the music for a wedding using my PA today. The bride and groom were lovely, friends of ours and at was a great day. A wedding is an odd PA/DJ sort of job, It’s not the same as a party, or even running a mixtape for a party. Most of it can be scheduled up front – to the extent that there are firms that hire out a no-DJ wedding system

The job was made easier for me as the bride had made her selection of classical music, with a section for the getting seated bit and a long stretch for the after the event part. So far so good. The venue was the lovely Christchurch Mansion in the main park in Ipswich, and the weather smiled on the happy couple for the event and afterwards

So all I have to do is run the playlist. Because this is classical music the sequences are long, and you don’t have to do the DJ crossfading thing between tracks. Easy-Peasy, right?

Wrong

Some parts of a wedding are a stage show. Stuff needs to happen in time. Usually there’s the entrance of the Bride, and the signing of the register. Both of these are a performance, and timing is crucial. Whatever you do as the music operator you do not want to screw this up the entrance of of bride, in short you need to know that your music is gonna start on time, every time, and you are going to fade it out at the right point. The bride selected Pachelbel for this

The registrar also has to say various things at various points, and they don’t want the music to be running while they’re talking. With classical, pulling the music is easy as a fade down – it’s a bit more of a drag if you have to fade a pop song just as they are getting into the main part, you probably have to rehearse timings, but this wasn’t a problem I had.

Making the right thing happen, on time, on cue is not easy with an i-anythingwithatouchscreen.. It might be easier with a Nano or something with an old-skool gonzo keypad and LCD, but a touchscreen is a vile UI for this job. Not only is there a little bit too much latency between the press on the screen and something happening, but it’s far too easy to screw up and then you have to pad your way through a series of menu choices to say no that isn’t what you want, you want this to happen instead. Continue reading “Flat Screen UIs make Fumbling Fools of us all”

Adapting A Makita Universal Charger For Other Nimh Batteries

We standardised on 18V Makita NiMH cordless drills at the farm. NiMH is older tech and heavier than LiIon, but the price/performance seemed to be about right there. We’re not hauling these up ladders or carrying them for miles. The trouble with cordless drills, well the NiMH ones, is that you have to stop using the drill as the battery runs down – when you hear the change in note as the power fades, switch the battery. If it’s you who will be paying for the replacement battery you will do that, but if it’s something used by many people that doesn’t happen, because it’s hassle to go get another battery.

Under the harsh load of a drill, that means as the voltage of a cell falls to 0, soon current gets forced backwards through the weakest cell and it dies. So you get a pack with a few duff cells in them, and have to junk the whole thing. The moral of the story is change the battery as soon as the sound changes and the power drops…

battery pack
battery pack

Continue reading “Adapting A Makita Universal Charger For Other Nimh Batteries”

PICE case and WiFi upgrade for the remote farm camera

The issues with the Raspberry Pi farm camera were of waterproofing and of iffy Wi-Fi range. Both of these are addressed in the new version. The PICE waterproof case from the guys at EdVenture marshals this motley collection of bits

Pre-PICE prototype
Pre-PICE prototype

into something a bit more organised. There’s no getting away from it, the PICE is quite expensive at about the same as the Pi itself, but it does solve a lot of the mechanical problems of trying to run a Pi outside with a camera. The landscape version is the one i needed, since the case is only water-resistant with the top horizontal – the Pi is mounted on that and even if water does get in it falls to the bottom away from the Pi. The previous version of the PICE took the picture in portrait mode with the case oriented for best water resistance, which isn’t so useful for our aims.

This is a good interim solution – it gets the cameras into a tighter configuration, and should let me pull back the main MiFi box back to a more central location to serve the rest of the cameras. As a result each camera will draw less power which is good. The Edimax EW7711 USB WiFi unit has a better performance than the USB nano-dongle – the reason is obvious when you look at the size of the aerial of the nano

size really does matter in some applications, and and aerial much less than 1/4 wavelength is going to struggle to get the signal out
size really does matter in some applications, and and aerial much less than 1/4 wavelength is going to struggle to get the signal out

although it’s 2.4GHz the wavelength is still 13cm; you still need to get enough metal in the sky to get the 300m path length to work, unless you can mesh. Continue reading “PICE case and WiFi upgrade for the remote farm camera”

Remanufacturing a 12V power tool battery

Cordless power tools often die not because they’re worn out but because the battery fails, or only holds a charge for a short time. Every tool’s battery pack seems to be different, either from the sheer cussedness of consumerism making you buy a new tool, or because nobody has standardised battery packs, You can fight back, because though the battery packs are all sorts of sizes, the parts inside are usually drawn from standard sized parts, they’re merely packed in different ways.

I had a cordless strimmer, once advertised years ago in the Guardian, from a no-name supplier with two battery packs. Both of which are now duff – a strimmer is a fairly hard life for the battery packs with about 50-100W. Here’s how I remanufactured the battery packs. These are NiCd battery packs – the key issue to to replace like with like. You can replace NiCd with NiMh but don’t cross any other chemistries.

A possible source of raw materials
A possible source of raw materials

Continue reading “Remanufacturing a 12V power tool battery”