Cirrus Logic audio card for the Raspberry Pi revisited

There is more green space and trees around me where I am now, with many more garden birds, though no sparrows1, and occasionally some tawny owls in the night.

Tawny owls, recorded ME66 handheld

So thoughts turn to a garden recording gizmo again. I have enough power, and a network connection to a shed, a oddly wind-sheltered location and many trees nearby. For short term recordings in the field I am still in favour of the timed field recorder approach, but for the garden where I have power and data the Pi still scores. You don’t have to fiddle with it, it’s entirely remote controlled. Many years ago I had a PC in the garage which was the music server, I used a piece of software called loop recorder on that. This cat fight is one of my favourite urban recordings from that time.

although I was really trying to record a hedge full of sparrows. A loop recorder lets you go back and catch things like that, and the microphone would be much closer to the area where the owls are.

So I thought I’d revisit this Cirrus Logic audio card, particularly as a case for a Pi with this mounted was being sold off cheap for £5

The Cirrus is the only audio card for the Raspberry Pi that lets you record sound with it, as opposed to the legion of DAC cards for the Pi. You can, of course, use a USB sound card instead, though that precludes using a Model A if you want to use wifi and have the lowest power.

The good news is that a hero hacker, Matthias Reichl, has sorted out the drivers, it’s now a RPI-update rather than patching kernels and esoteric crap.

The bad news is that the manufacturer discontinued the card 🙁 Having said that, it still seems to be available for about £60 if you work hard enough, GIYF. That’s dear – a Behringer UCA202 is a good Pi compatible USB sound card for about £24, line level input. The Cirrus Logic card offers a bit more sensitivity and on board mic bias. Continue reading “Cirrus Logic audio card for the Raspberry Pi revisited”

Solar Powered 12V lighting system

This project is about resilience more than energy saving, though it can also be used to save energy. Total costs should be in the order of £100, but there are ways to reduce that by getting some items from Ebay. The idea for the project came from the Transition Ipswich Energy group in 2011. It had to be targeted at a competent DIYer, and is for small scale lighting. This was originally published on TI’s website, which is no more.

This project lets you run lighting off of solar power, effectively storing sunlight for later use. It can be used at home to keep lighting during power cuts, but the same principle can be used to provide power to sheds on allotments, outbuildings or island sites without mains power. Although I have used lighting as an application, such a system can run an electric fence for much of the year if suitable solar panels and battery are used.

The system as described lets you run one or two 12V 1.8W LED lights through the year – my system was able to run mine through the winter and the shortest day where the light would be on from about 6pm to 11pm. In the summer you can also run a laptop computer power supply independently of the main for a couple of hours (these run typically 40W). That is because in the summer you get far more solar energy and you’ll probably use the lighting less.

If you want to primarily save energy or reduce your carbon footprint using solar power, this is not the solution. For that it is best to get a grid-connected solar power installation which will allow you to save energy and get renewable feed-in tariff payments. That sort of thing is on a different scale from this project, and capital costs are usually in the order of several thousand pounds, but the energy savings are much, much greater. A grid-connected solar PV system does not give you resilience against power cuts, because the anti-islanding systems in the grid tie inverter shut the system down if the main power fails, so that a PV system does not send power back into the grid when it may harm power workers trying to repair faults.



Continue reading “Solar Powered 12V lighting system”

Raspberry Pi camera after several years outside

It doesn’t pay to put a Raspberry Pi camera out directly facing the great British outdoors for more than a season even if you can keep the water out of it. I had a RPi Model B and camera doing just that and groused about the lens crazing problem where there seems to be some sort of microbial attack on the lens after a season outdoors.

damaged Raspberry Pi lens
you can just about see the grungy effect on this damaged Raspberry Pi lens which was outdoors for a season. The mechanical marks around the outside is because you have to break the glue to get the lens out. I did not mechanically damage the lens.

That didn’t respond to pretty aggressive scrubbing with isopropyl alcohol (IPA), and the Pi lenses are proprietary.

the lens on its own
the lens on its own

The back side of the lens not facing the elements looks fine

Sensor side of the lens
Sensor side of the lens

They are not standard M12 CCTV lenses1, so I got to buy another camera board, and used Sugru and a cut down glass microscope slide to try and keep it intact. I can buy aftermarket RPi compatible cameras using M12 CCTV lenses now, but then it wouldn’t fit in the PICE case.

Pi camera behind glass
The Pi camera is still bright-eyed after three years in the outside, behind a glass microscope slide

I left this camera out in the open on the farm for a while, and then watching my sparrows on the feeder. It looks like the glass slide technique has been a win, it’s been around three full years and the camera lens is still OK. The slide can be cleaned with IPA and comes good as new. Angling it down slightly reduces reflections and flare, but yes, it is uncoated so flare will happen. I built the Sugru up a but round the top to make a lens hood to minimse the amount of open sky that falls on the glass. Maybe the original Pi camera lens is plastic and gets eaten, although I know to my cost that optical coatings on glass can get hit by fungus too in damp conditions 🙁 Continue reading “Raspberry Pi camera after several years outside”

Wolf Supermoon

The first day of the New Year features a full wolf supermoon, 1 when the Moon is closest to the earth so brighter and bigger. The Moon was lovely so I figured I’d try for a shot. the Independent tells you why it’s a Wolf moon.

The Moon disc itself is as bright as the beach on a summer’s day when you are taking a picture of it, because it’s in full sunlight, no clouds and about the same distance from the sun as the Earth. Should be a doddle – I got the Canon EF 100-400 lens that I cleaned up, put it on a monopod and aimed at the Moon. f/8 1/400 ISO200 go.

Turns out not to be as easy as that. I needed a tripod, switched off IS and even then not every shot was equally sharp, must find the remote cable for the Canon, maybe it’s mirror slap. Took the best, that’s the top picture. I then tried my Micro Four Thirds camera with a 100-300 lens – the MFT sensor is probably smaller than the APS-C sensor on my EOD450D so the 300 end is probably comparable with the 400 on the Canon Continue reading “Wolf Supermoon”

Experiences with the Vilistus EEG interface

I went to an open day in October run by the mind people, makers of the Vilistus EEG interface. It was an opportunity to see this in action and ask questions – the day was £85 which wasn’t too bad, there were about five other people there. It was run in some anonymous hotel near a football ground in Birmingham just off the M6, and led by Stephen Clark who knew the product well.

It was an interesting day, the Vilistus 4 box is a digitising interface but analogue signal conditioning is done in the sensor boxes, which add some cost to the overall system. Their default software looks fine even for Mind Mirror since it seems to have the filter bank in it, the extra costs for the Mind mirror package probably involves extra training. You seem to get the vilistus pro software with the box. I haven’t seen any of the units come up on Ebay.

I learned that the interface between the Vilistus interface and the computer is OpenEEG P3, which was good to know, and Stephen did warn that a lot of the older OpenEEG code from the OpenEEG project made the assumption that there were only 6 active slots rather than following the protocol specification which allowed the source to say whether there are 6 or 8 slots of data. Vilistus use 8 slots, so code assuming 6 would barf.

He did say the existing API would allow the Vilistus Pro software to continually dump the values of the filter slots to a text file that could be read by a program to display the output on LEDs, obviously I would get to build the interface and write the program 😉

The Vilistus Pro software did show correlations well – most clearly on a display where they showed heart rate against a trigger for breathing in and out. The heart rate slows a teeny bit on breathing out relative to breathing in, although this effect fades with age – it was clear on the 25 year old student and not really visible on a 50-something lady on the course. EEG was tough to get going in the course, although it was demonstrated using disposable electrodes on the forehead. This isn’t the optimal placement for Mind mirror but you can’t use disposable electrodes on areas of the scalp covered by hair.

The trouble is this rig would be about £1200 all in, and I’m not yet sure I am £1200 interested in the Mind Mirror. I did get a much better feel for using this in the field, and I’m aware that while I have been able to solve the digitising side of things using the PIC, I still need to solve the EEG diff amp, and solve the electrode problem.

Vilistus seem to have solved a lot of that, but even the electrode set is ~£200, so the bundle would be the way to go. One to mull over really, to work out whether I want the functionality or the engineering challenge. I could probably knock off £500 going DIY if the development went OK, but experience shows only one to two PCB fails or wrong turns can wipe out the savings on a one-off project where there’s a COTS solution.

One to think about. The Olimex EEG-SMT and 4 electrodes is about Euro100 – okay so it has the iffy antialiasing filter but a £1100 saving has its attractions 😉

 

Making compost tea

We are using 160901 to make compost tea. Although the temperature has fallen to ambient, it’s still a bit early.  This is only seven weeks old, and it’s apparent that while all the green material and plant material has gone and isn’t recognisable for what it is, the woodchip takes longer to break down. As such it will be mainly bacterial, the fungi take longer to develop. Fungi are better at decomposing woody material. But sometimes it is not worth letting the perfect be the enemy of the good.

compost 160901 after seven weeks
compost 160901 after seven weeks

Looking back at the success we had with the beans there is some latency of a few months between putting the compost organisms out, compared with the more modest results after only a couple of months, so we want to get this out now to do its work over the winter. Continue reading “Making compost tea”

Oscilloscope options – standalone or PC based?

I started redecorating the lab, so the EEG project is now relegated to an Autumn/winter project 😉 Which is a shame as I’d got close to replicating the Mind Mirror system in Open EEG and getting a hardware gizmo set up using a PIC. The best laid plans of mice and men…

Just before I cleared it down I tested a device I’d been given by Jason Wildlife Gadgetman when he was clearing his lab out getting ready to move. The DrDAQ is a bare-board device made by Pico Technology. which shows a lot of promise for the openEEG testing.

DR Daq from Pico Technology

It’s basically a single channel digital oscilloscope, but it works with Picotech’s Picoscope software, which has all sorts of features that are new to me, like software RS232 decoding, click to set trigger levels, and long persistence simulation.

I have a decent Tek 2245A analogue scope, which computes frequency and voltage levels from cursors on the traces,

This is now very old , from 1989. It does most of what I want/need, and most of my design career I worked with analogue ‘scopes, with the logic analyser as a separate piece of gear. However, despite its measly 100kHz bandwidth the Pico did show me some of the attraction of a more modern approach. Every so often I’ve toyed with the idea of getting a Chinese scope, something like Rigol 2000 series or similar. So far I haven’t cracked. There’s a lot to be said for a standalone scope, but I wonder if the combination of my regular analogue bench scope together with a Pico will be even better.

EEVblog did take the piss out of the cheap Chinese DSOQuad FPGA scope, and I’d agree with him. I got one of these DSO Quads  to be able to print out slow captures like the one in this project, and it works well enough at that

but it would be a terrible thing to do to give this to a beginner. I could only make this thing trigger properly because I’ve used analogue scopes for years and had some feel for what should happen – all too often on the FPGA scope if the vertical trigger wasn’t in range you simply don’t get to see anything useful at all, so you can’t see which way to shift the trigger point. And the user interface is revolting. Too much clickety-click of two separate left-centre-push-right buttons for my liking.

Picoscope is far better thought out although it still suffers from the problems of not enough control of input sensitivity and offset as a regular bench scope. But it, and the associated DC coupled arbitrary waveform generator will be a great tool for testing the OpenEEG filters at sub-audio frequencies. And unlike the typical fly-by-night USB scopes, the software supports legacy models back to when Pico started, because that is of course always the problem with any hardware that depends on a piece of software running on some other device – it easily becomes orphaned before its service life is over. See pretty much any hardware made by Apple that is more than three or four years old 😉

The DrDAQ does pretty much all that I want for the EEG work, but the AWG doesn’t support frequency sweep mode which is a shame. I’d need to go for something like the 2206B at £250 to get that. In that case I’ll probably do it the old way and set up the AWG to output a single frequency and step through the frequency range. What isn’t clear is the frequency resolution of the AWG.