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”

Remote Farm camera – experimenting with WiFi

Clive from the Raspberry Pi Foundation very kindly let us have a Pi Model A and camera, so it’s time to take this project forward a stage. At the moment the alpha test version is in service keeping an eye on our new piglets. Although the original purpose was to keep an eye on our newly arrived cattle pigs are more enterprising, so it’s good to know where they are

Our camera on the pigs
Our camera on the pigs

Development was stalled however since it’s not easy to work on a piece of kit in service.  Ideally one MiFi box could serve a number of cameras. This would reduce the camera power drain and consolidate.

The trouble is that the site is on the edge of town, a couple of hundred metres from the nearest houses, and I want to use BT Wi-Fi

Yagi wifi antenna
Yagi wifi antenna

I acquired one of these from ebay I didn’t have much hope for the integrity of the device, and to gain height I needed to go 250m further way from any likely source of WiFi. But it worked a treat, as a WISP client, I’m amazed. I was able to see 18 access points, five of which were BT WiFi , 3 of which were 5dB or above. The TP-Link gives a decent link at more than 5 and nothing at 2. I streamed a video to confirm the stability of the link.

TP Link signal strength with yagi
TP Link signal strength with yagi

I use it with a TP-Link TL-WA5110G which has the advantage of having a sma antenna socket and a native power supply of 12V. Although the adaptor is specced at 1A I measured the power drain at about 210 mA (~2.5W @12V). Which isn’t great but not terrible

A WISP client is not a  repeater

The trouble with using the tP link as a WISP client is the signal is presented as Ethernet, and I’d then want to re-radiate the signal on a different Wi-Fi network.  I could set it as a repeater, but then every Raspberry Pi would have the hurt of logging into BT WiFi. Whereas if I use a Raspberry Pi connected via ethernet to the TP-link and a WiPi dongle to connect to the farm I can collect pictures from the cameras on the farm network and perhaps power-manage the TP Link to only update every so often.

So an unexpected win, and I can look at using a Model B as a concentrator

Remote Farm camera using Raspberry Pi – alpha test version

At The Oak Tree we have acquired two bullocks/steers, and it would be good to be able to monitor these guys to check they are okay.

cattle
cattle

The obvious way is a GSM trail camera, which has got some merit. However, these are typically tripped by movement, and you get a lot of that outside. It might work to use a trail camera with a 15 minute trigger lockout – it’d be tripped all the time but wouldn’t spam you senseless with the 15 min delay. But it’s going to be dear to run as they tend to use MMS – giffgaff charge 16p per MMS for instance, whereas their data rates are 20p per 20Mb . CCTV solutions have the same problem – they are event triggered, whereas we want to be able to see a picture taken sometime in the last 15 minutes. Well, obviously we’d really like realtime streaming video by a pic at most 15 minutes old is a decent second best 🙂

What we ideally want is a camera you can send a message to to take a picture.

I used to have a Youthnet V900 which you could send an SMS to take a picture, but it was the most maddening hunk of junk I have ever purchased. Configuring the settings was done by SMS, and I only ever got it to work with Virgin mobile once. Then Virgin must have changed something and I never got this to work again, either with Virgin or with Giffgaff. In the end I put a hammer through it so it wouldn’t waste any more of my time and money. The satisfaction of doing that was the most value I got out of it.

I took a look at this trail cam and recognised the same commands as the Youthnet . I’m just not going to go there again if it uses the same software. Plus there’s the fact that it doesn’t really suit what I want it to do.

The Pi’s USB subsystem isn’t good enough to run a 3g dongle

So it’s time to break out the Raspberry Pi. Unfortunately the USB subsystem of the Pi means I couldn’t use Gammu directly with a Huawei E156G USB 3G dongle. It would work for a while and then conk out, and only come good again when the Pi was power cycled, not even a restart would fix it. That’s a real shame – this would save me a lot of power drain. Maybe it’s specific to this dongle, but there is always a world of hurt when it comes to the Pi and USB because of the power problem, and a 3G dongle has a high power usage when connected. Even running the E156G off an approved USB separately powered hub and the Pi off an approved PSU didn’t make it any better.

Go MiFi

Obviously if your site has WiFi you don’t need to wrangle with 3G, but there is a lively market in boxes to put a WiFi hotspot using 3G, called MiFi devices. You need to configure these to make use of your 3G dongle (and make sure they are compatible), the type I used is a TP-Link MR-3220

1501_TL-MR3020-V1-03

So I used a MICRONEXT  MN-WD552B WiFi dongle in the A’s single USB port, which seems reliable. Of course I now eat the power drain of the Pi, WiFi is never low power and the TP-Link 3020 MiFi device gives me another power hit. But it works, and I needed results fast rather than good, so it’ll do for now.

The Raspberry Pi Camera module is really rather excellent

The camera module that the Pi foundation sell for of the Pi is rather good – the larger version of the pic above is already scaled down by half in the camera to reduce the file size. And I compressed it a fair bit. You can control the camera in Python too, using Picamera. Python seems to be the default language for the RPi.

Although the Raspberry Pi is credit card sized, it’s remarkable how big it gets if you want to do anything with it. I used a box I already had – if I decide this works well enough for a permanent version then I will use a PICE waterproof case, but for the prototype a temporary rig is fine.

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

At the moment both are powered up all the time, and a cron job takes a picture and SFTPs it up every 15 minutes during the day. The Pi and the TP3020 are powered via one of those dual-output 12V car to USB converters, the power drain at 12V is 250mA which is horrible, meaning using 40Ah of a 80Ah leisure battery will take 40*4=160 hours, nearly a week. Which is nasty, but livable with. There is massive opportunity to cut the power drain by bringing up the TP-Link 30210 and the Pi only once every 15 minutes when it’s light – they can be up and do their stuff in 5 minutes so I’d get a 3x drop in power drain from that, and not running in the night would save me another third.

The installation is bush-league, but this is going to need a bit of optimisation anyway

the camera is at the top left of this IBC
the camera is at the top left of this IBC

and a close-up shows just how bad it is – waterproofing by electrical tape is living on borrowed time. But that’s where those nice people at PICE come in, so there’s no point in putting any real work in that.

best not let the IEE see that else they'll revoke C.Eng for disgraceful and outrageous bodgery of the first order ;)
disgraceful and outrageous bodgery of the first order 😉 The PICE case has solved most of the mechanical challenges kludged together here.

This shows one of the hazards of this location, in that the crows sit on the bar surveying their domain and crap on the IBC. There’s no crap on the bars though, so I might get away with it. Some anti-bird spikes might be in order.

 #!/usr/bin/python
#$Id: takepic.py 53 2014-06-26 16:30:17Z richard $
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='/home/pi/mine/'
imagename='cam01.jpg'
remotename='mysite.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.start_preview()
        time.sleep(2)
        camera.capture(DIR+imagename, resize=(800,600), format='jpeg', quality=15)
except picamera.PiCameraError,e :
    print e
    camerafail=True
finally :
        camera.close()
time.sleep(10) # hopefully nw is up by now   

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")
    
    # Ideally, this gets called by cron once every quarter of an hour. 

     
    #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, '/my/remote/path/'+imagename)
            sftp.close()
            print "closed SFTP"
        except paramiko.AuthenticationException,e :
            print e
        except socket.error,e :
            print e

The cron job

This is then called by a cron job on the Raspberry Pi. You must to this with root privileges because you are accessing the hardware, so use

sudo crontab -e

and mine looks like

*/15 4-22 * * * /home/pi/takepic.py > /home/pi/log.txt

which means every 15 minutes between 4am and 10pm run takepic.py and save the error messages etc to log.txt. Before running this as a cron job you want to make sure that if you manually run

sudo /home/pi/takepic.py

you get a picture uploaded to where you want it 🙂