Monthly Archives: May 2012

Raspberry Pi First Run

I checked the UPS tracking number periodically today. My Raspberry Pi was marked as delivered at about 2:30 today.

When I got home, I found the package. I still needed to prepare the SD card, so I brought up the RasPi Wiki instructions for SD card setup and went with the Debian Squeeze distribution to start with. While “dd” was doing its thing, I was preparing other things.

The LCD monitor I want to use needed to have its built-in stand removed. There wasn’t room to attach the HDMI cable to the HDMI to DVI adapter and fit that to the while the stand was on.

I located a USB keyboard and trackball. I also found a USB trackpad.

Back to the Ubuntu box and the SD card. I went through the steps to resize the SD card partition with parted. I got some weird messages from the two steps following parted, but apparently one other step was needed: remove the SD card and reader, then plug it back in. With that done, the SD card looked to be in good shape.

I unpacked the USB hub and plugged in power. I hooked up the USB Y cable to the USB to Micro B cable and the hub. I plugged the keyboard and trackball into the hub.

Then I opened up the RasPi package. The package held a packing list (one RasPi, of course), a “Getting Started” single sheet document, and a plain cardboard box. The RasPi was in an antistatic sleeve in the box. It came out, and I started hooking things up.

The SD card holder gave me pause. There’s a gold-plated bar that the card meets, and it took me a moment with a magnifying glass to make sure that it was intended to move when the card was inserted. It looks to be a switch arrangement to indicate the presence of a card.

Then the HDMI cable went in. The monitor changed from its “no signal” display to a blank black screen.

I hooked up a USB data cable between the RasPi and the USB hub.

Then I plugged in the power. There was about a three-count before the monitor started displaying the initial boot-up screen. Things proceeded nicely from there.

RasPi_board

The RasPi all hooked up.

RasPi_accessories

Here’s the USB hub and a couple of USB peripherals of interest, an audio interface and a GPS.

RasPi_system

And here is the RasPi system hooked up and driving the monitor, showing the default X Windows desktop.

The RasPi doesn’t like my Logitech USB trackball, but it works fine with a trackpad. I’m having some trouble with the keyboard, but I expect that it is the keyboard’s fault. These accessories are pretty ancient by computer standards.

It’s a bit disappointing that the USB WiFi adapter that I have on hand doesn’t seem to be working with the system. I’ll give it another try before moving on to other stuff. That means I’ll need to put the RasPi setup where I can run a physical Ethernet cable.

Looking at dmesg, both the GPS and the audio interface appear to be recognized OK. That’s about as far as I’ve gotten on that.

The word is that the platform I’d like to deploy on won’t go out for two to four weeks, so I have a little time to organize and develop a RasPi-based data collection system. The first step went nicely enough that I’m hopeful about the rest.

<> 40693 10472 >

Official Interference in Biology

We’ve heard tales of officialdom greasing the way for people to profit over the consideration of species and ecosystems. Now we’ve got a home-grown Florida tale along those lines.

Craig Pittman wrote an article appearing in the Tampa Bay Times that goes into the details. Department of Environmental Protection employee Connie Bersok has been suspended from her position by her supervisor, Jeff Littlejohn, for failing to approve an application giving a lot of wetlands restoration “credits” to developer Marc El Hassan’s mitigation bank. According to the article, Littlejohn’s basis for doing so is material given to him by the mitigation bank’s lawyer and its consultant. If your blood pressure is trending a bit low, please go read the article and you’ll likely find it heading right back up again.

<> 19614 5041 >

Raspberry Pi On Its Way

I got email from Newark today saying that they had shipped my Raspberry Pi. I should get it this week.

They also sent an invoice, having charged my credit card. The item itself is $35.00, shipping is $5.00, and tax is $2.28, for a total of $42.28. Way back in early March, I called Newark to place my order since someone noted that the huge shipping charge they were quoting at the time could be avoided with a phone order rather than an online order. Hopefully they’ve fixed the online ordering since then.

Otherwise, I think that I have enough RasPi accessories to get started with when it arrives. I picked up a used Tektronix oscilloscope and an LCD monitor with DVI interface from Mario DeSario at Audio Workshop in Bradenton, Florida. I have a HDMI to DVI adapter and an HDMI cable. I have a 2.5 amp powered USB hub to supply the RasPi and allow me to plugin more accessories. I’ve got a USB GPS and a USB sound interface. I’m looking forward to diving in on this.

I also saw on the RasPi forums that by installing Mono, a RasPi can run executable files produced in managed .NET code from Visual Studio. That is a cool capability. I might try doing the monitoring system software in C# and .NET.

I still need to do some work on the hydrophone side of the system. I want to do a bit of home-brewing there. Years ago, I heard Cornell’s Chris Clark talk about fabricating in the field what he called a “schlong-o-phone”, which was basically a microphone capsule potted in epoxy in a convenient flexible cylindrical latex mold, otherwise known as a condom. Some of the more convenient materials for filling a mold don’t actually work well for salt-water and electronics. For example, most RTV (silicone) formulations are waterproof in themselves, but do not bond well to cable insulation. Additionally, the relatively high viscosity means that best results require applying a vacuum to de-gas an RTV mold, and that’s outside my current state of gear. I’m going to experiment with a piezo disk and Plasti-Dip. I’ve priced urethane for molds, and it is indeed expensive, but it is also low viscosity (no bubbles in the mold) and should bond nicely to cable insulation. If the Plasti-Dip results are bad, I’ll likely give the urethane a try.

Checking stuff out will require at least a couple of the home-brew hydrophones, our trusty frequency generator, and the oscilloscope. I have a variety of pre-amp and amplifier DC-powered circuits to pair up with the hydrophones.

Something I’ve wanted to try out for years now is doing a reciprocity calibration, but I’m not quite there yet, either. Reciprocity calibration uses three transducers (whose characteristics may all be unknown) and yields an absolute calibration of a receiving transducer. If a transducer can serve for both receive and projection on short time scales, a self-reciprocity calibration can be done. In either method, precision measurement of the current going to the projector in the system is necessary. That’s the part that is most challenging. There are plenty of other challenges, though. For hydrophones, the distance between all the transducers needs to be enough to be in the far field, where spreading loss is predictable. At least a meter to 1.5 meters is what would serve as a minimum. Then, one needs to be far enough away from either the water surface or any other obstacles so that the calibration signals aren’t bouncing off other things and giving reverberent noise that would compromise the received energy levels. 1.5 meters distance from other surfaces would give about a millisecond’s worth of unblemished sound. So we’re talking a quiet body of water at least 4.5 meters wide by at least 3 meters deep just to get a millisecond of calibration data at a time. I think I’ll have to defer home-brew reciprocity calibration for a later date.

<> 15636 4597 >

Personal Research and the Budget

Diane and I are working on a personal project to put together an acoustic sampling system that could yield information about the activity levels of snapping shrimp. Whitlow Au and his group have done this sort of thing out in the Pacific. Of course, they’ve gotten research funding to do it. We’re looking to do this out of our pockets, at least for the first proof-of-concept.

Snapping shrimp are small crustaceans. They stun their prey using an oversized claw. Well, that’s just half the story. Any crustacean with a claw might grab or bonk a prey item using a claw. Snapping shrimp create a cavitation event with a snap of their claw. The resulting burst of acoustic energy is a natural disruptor beam (obligatory SF reference can be checked off now). There’s some cool high-speed video of snapping shrimp doing their thing that got published some years back.

Those cavitation events are loud. Until human shipping noise is added to the picture, the single biggest item in the tropical to semi-tropical littoral marine acoustic environment is energy from snapping shrimp snaps. Part of the challenge for my dissertation work on dolphins clicks was coding a recognizer that would include dolphin clicks but exclude snapping shrimp snaps.

Because their method of prey capture produces a signal that travels significant distances, their activity can be tracked for a particular location just using acoustic recording. Because snapping shrimp are so widely distributed and so abundant anywhere there is structure in the (relatively shallow) marine environment, this can be done just about anywhere of interest: seagrass beds, reefs, mangrove swamps, etc.

We’re thinking of snapping shrimp as an indicator species. The various factors of their life history and acoustic features makes them well-suited for this role. A drop in snapping shrimp activity that doesn’t fit the usual diurnal and seasonal patterns would be taken as an indicator of declining ecosystem health.

But to get there, we have to be able to sample those acoustics. This is a job that we’re hoping to accomplish with an instrument we’ve budgeted $200 for parts. This is pretty much penny-pinching taken to an extreme. Here’s the basic gist of where we’re going.

We’re hoping to base the instrument on the new Raspberry Pi platform. This ARM-based Linux system comes with an SD-card interface plus USB. It doesn’t come with a clock. For places with a network connection, NTP can handle setting the time. For other places, we’re hopeful that a cheap USB GPS dongle will serve to provide both time and location. The RasPi also has no sound input, so a USB sound interface is needed. The RasPi needs a power supply, as do whatever USB devices we want to use, so a powered USB hub seems the best solution. We’ll need a hydrophone. That’s something we can make out of a piezo disk, cabling, and some waterproofing method (epoxy, urethane, or perhaps even Plasti-Dip). And that will need a preamplifier. This is where we might bust our budget.

The RasPi is $35. The GPS with USB is $28. The sound interface is $29. The powered USB hub is $27. A piezo disk is about $0.50, and the Plasti-Dip for it might cost a buck.

Some time back, Diane worked with engineers at the University of Texas at Austin’s Applied Research Lab on a dolphin biosonar project. They set out to make a preamp that would provide flat response from a few kilohertz up to two megahertz. The result was a circuit they called the Universal Dolphin Preamplifier. Depending on the discrete components on the circuit, it could be configured for 0, 20, or 40 dB of gain. Even though our first pass at an instrument would be strictly human audio range, I had hoped to be able to construct one of these preamplifiers for use in the project. That was before I started pricing the integrated circuits used in it. There are three of them, and the prices are $37, $16, and $13. All told, I’m estimating about $86 for the cost of parts for one preamplifier circuit. Instead, I’ll be looking to use a more common — and cheap — audio-range preamplifier for our first instrument to deploy.

There are some other things that would be useful to add that may not make it, like some sort of LCD panel to indicate system status. We may just go with some LEDs.

There are consequences of being cheap. The peak frequency of the broadband transient that is a snapping shrimp click is upwards of 50kHz. There’s energy at frequencies within the human audio range, so recording at that range will allow detection of snapping shrimp clicks, but not any sort of spectral analysis that would mean anything. That means just getting measures of activity, like number of detectable clicks. Recording a single point likewise doesn’t tell us much about spatial distribution of snapping shrimp being recorded. We might group clicks by relative received amplitude as a proxy for distance from the hydrophone. And because we’ll deploy an uncalibrated hydrophone, we won’t be getting absolute amplitudes out of the samples, everything will simply be relative.

Doing this for the maximum amount of information would thus imply use of calibrated hydrophones, multiple hydrophones to allow for acoustic localization, and sampling rates high enough to capture the full frequency range of snapping shrimp clicks. A calibrated hydrophone from a vendor could easily run over $1000 each. A system for recording four simultaneous channels of acoustic data at up to 500 kilosamples per second could be done for about $1000 using the Tern Micro GR4 ADC units and a microcontroller. That complete system could easily run between $6000 and $10000 all told. So for the moment we’ll stick with the limitations of doing science on a shoestring budget.

<> 16663 5591 >