Posts tagged with electronics

0 comments

No homemade cables

One of Josh Trachtenberg’s rules that I have adopted is “No Homemade Cables”. It’s so natural to think that this is the best solution to hook two things up: “Wire and bare connectors are so cheap, let’s just make our own cables.” However, homemade cables, even when made with great care, are usually of poor quality compared to commercial cables. As a result, you’re just giving yourself something else to repair in the future.

Option 1

Adapter boxes, aka breakout boxes, are more reliable than homemade cables. If you take this route, put it in a transparent, easy to open box so that you can quickly see (a) how things are wired up, and (b) whether there are any loose connections.

Option 2

Another option is to have custom cables made. I started doing this in London for a rig where I needed two fairly long 48-conductor cables. Custom cables are actually not that expensive and are of very high quality. It’s practical because you don’t have to buy an entire spool of 48-conductor wire (or whatever the job requires); nor do you have to source obscure connectors, strain reliefs, jackets, and whatnot. Not to mention time saved soldering.

Here are a couple of places that you can get quotes from if you’re interested. Any of them will do one-off jobs, you don’t have to bring them volume jobs.
Circuit Assembly
Technical Cable Concepts
Custom Cable Assemblies

Fritzing is PCB design software (EDA) in the spirit of Arduino and Processing. It’s open source, cross-platform, streamlined, and simple to use. It doesn’t do simulations, but you can lay out your circuit in a GUI that looks like a prototyping board, then move to circuit layout, and finally PCB design. Check out the video above to get an idea of the workflow of Fritzing.

PCB manufacturing is something that I haven’t covered in Labrigger before. Partially because I didn’t think there were good free software tools to use. I’ve used proprietary stuff in the past (Tanner EDA, due to my background in MEMS), and the free (as in beer, not speech) version of EAGLE is popular. But most of the GNU-licensed PCB design software was not quite ready for primetime in my opinion. Fritzing is the first thing I’ve seen that is really well done and has the potential for wide adoption.

Anyways, now that Fritzing is here, it’s worth mentioning how affordable it is to have a custom board house make your custom PCB. It’s so cheap, I really don’t recommend making PCBs at home or in the lab, although there are plenty of ways to do so. This isn’t anything new, cheap custom PCBs have been available for decades, but not a lot of people who make their own gadgets in biomedical research know how easy it is.

Fritzing has their own fabrication, named Fritzing Fab. They’re based in Germany. But Fritzing will output files that you can send to other board houses. A Google search for “custom PCB” will return a hot mess of hits. I recommend you look for one in your geographical area. If you’re in the US, this list is a good start. I’ve used Advanced Circuits before, but any of these firms are probably solid.

Should I make a PCB?

If you’ve got more than 20 interconnects to do, then it’s probably worth making a PCB. However, if you’re really unsure of your design and might need to make several changes, then maybe the threshold should be closer to 30 interconnects. Because although PCBs can be minimally modified (cutting traces, making jumpers), they’re harder to change.

Turn around time is another consideration. Custom PCB houses are built for short turn around, but they’re still 1-5 days, typically. So if you need it right now, you’re better off wiring it yourself. Especially if there is a low number of interconnects.

BTW, Fritzing is selling some nice Arduino kits as well (link).

More materials…
A video where Fritzing is used for a slightly larger circuit design
Labrigger posts on Arduino

In many rigs, multiple computers are used, and they need to talk to each other. For example, one computer handles the imaging, another the electrophysiology, and yet another handles the sensory stimulation; and they all need to be synchronized. There are several ways to handle this.

Digital I/O via DAQs

This is typically the most straightforward solution, but requires that there is some sort of DAQ for each computer. You can use something very simple, like a parallel port interface. Parallel ports are very old fashioned, but they’re still standard issue on most full-sized motherboards (see image above). Wire up the each data pins to a separate BNC and you have an extremely inexpensive digital I/O (the pinout is on Wikipedia and elsewhere on the net). The logic is a TTL-like 0-5v, however, beware that motherboards will vary quite a bit in their logic-high voltage level, and they typically can only source a small amount of current, 10-20 mA. So don’t try to split the signal to a bunch of different devices. (more info).

Alternatively, you can buy an inexpensive USB DAQ. For example, Measurement Computing‘s boxes are supported by MATLAB’s DAQ Toolbox. On that topic, let me briefly mention Dennis Pelli’s excellent MATLAB toolbox for controlling Measurement Computing’s USB-1208FS. It’s one of the simplest ways to do data acquisition in OSX using MATLAB. And be sure to read his explanation about why he programmed it up. It has more to do with the Second Amendment than you might expect. (link)

Ethernet connections

This approach has the advantage of using something that most computers have built in: an ethernet port. There are several protocols that ride on IP networks. You’re probably most familiar with TCP, but only slightly less well known is this: UDP. This is the protocol used for DNS queries. This is a leaner, faster way to send short messages to synchronize computers in an experimental setup. It’s not as tight as using a direct pulse to a DAQ, but it’s fast enough for most applications. The big advantage is that it’s pretty simple to send configuration data in addition to a simple trigger pulse via UDP. Several scientific software packages directly support UDP (e.g., here’s MATLAB’s UDP function).

Single computer solution

Getting programs to talk to each other
Even when a single computer is used, there may be multiple programs that need to talk to each other. In the first intrinsic imaging rig I built, I wrote my own OpenGL-based visual stimulation program which ran on the same computer as the imaging software (pdf). Both programs were written in C++ using Visual Studio. In order to get the two computers to talk to each other, I used custom Windows messages. Most modern operating systems have a messaging system where individual processes can send and receive messages. I was able to use this to pass messages between the two programs. If you want to do the same thing, and are already comfortable dealing with Windows messages in C++, this link can get you started.

0 comments

Project enclosures

Here are some ideas for project enclosures. The stock enclosures from Mouser, Digikey, and others are generally serviceable, but are rarely the perfect size. In addition, making the required cutouts can be inconvenient. Here are a couple of alternatives.

Laser cut an enclosure out of plastic

I’ve done this for several projects. It’s cheap, the cutouts are perfect, and there are many different materials that can be used. The downside is that you get 2D panels that you must fasten together. I often use superglue to put the parts together. I’ve also used magnetic strips for panels that need to be removed often. When the material was thick enough, I used screws. Another option is mounting screws and nuts in slots, pictured blow and briefly detailed here.

Here’s an online tutorial example from Rich Decibels (via).

This method offers a way to use screws even when the material is thin. I’m not a big fan of it though, because there are a lot of screws that can easily get loose. Superglue or properly tapped screws are more heavy duty.

Protocase for small run, custom cases

Protocase will make completely custom, sheet metal enclosures with cutouts, painting, and silkscreening. It’s a lot more expensive than laser cutting plastic pieces, but there’s less assembly to be done and they’re more durable. They can make all sorts of shapes, including very nice rackmount chassis.

DrawSCH lets you draw schematics online, in a browser window, and then get JPGs or PNGs emailed to you. (link)

PDF export is in the works, but the SVG export works fine, if you want a vector file. Handy.

(via)

1 comments

iPad Oscilloscope

To revisit an earlier post on mini-oscilloscopes, how about an iPad oscilloscope?

It’s not available just yet, but Oscium will soon start selling the iMSO-104, a peripheral add-on for the iPad, iPhone, and iPod touch devices. Together with their custom app, it makes for a nice little oscilloscope for cheap. Bandwidth is just 5 MHz, but that’s fast enough for many applications. You can already download the app and get a feel for what it can do. Price: a hair under $300.

0 comments

Wireless

I recently returned from my private island in the Maldives. Like most of the inhabited islands, it has no physical links to other islands at all. It is only about 250 meters in diameter, so there isn’t much room for infrastructure. The island has its own desalination plant for water, an incinerator for waste disposal, a diesel generator for power, and daily boat shipments for food and supplies, including barrels of fuel for the generator. All telephone and internet connections are via satellite and radio, courtesy of a small tower in the center of the island. The tower needn’t be very tall, because there aren’t many structures over 10 meters in the middle of the Indian Ocean, as we are, and the next cell tower isn’t typically more than 20-30 miles away.

So the topic of this post is getting rid of physical links in rigs: wireless technology. Here are some quick ways to decrease the number of cables on your rig, including some custom solutions.

Wireless keyboard and mouse

An obvious place to start, there are many options. I prefer ones with batteries for two reasons: (1) charging cradles often fail to reliably make good electrical contact with the battery connectors, and (2) there is no emergency solution when the battery goes down to zero. By the way, for cases where I don’t need to do much typing at a computer– just enter a few commands once in a while– I like the small, Bluetooth Logitech DiNovo Mini keyboards for reducing clutter around the rig.

Monitor connection

WiDi isn’t quite prime time yet. But it’s available in some laptops. Hopefully there will be solutions for desktop computers soon. Wireless HDMI is another option to look at as well.

Network connection

If there isn’t a need to move large amounts of data to and from the net, then just put a wireless card in the computer and get rid of that cable.

Custom electronics

It’s never been easier to make your own wireless connections for your custom electronics. Here are some platforms to consider:

ZigBee/XBee

SparkFun, Adafruit, and other companies sell inexpensive kits and Arduino shields for the ZigBee specification. This is an RF-based (2.4 GHz), open protocol. Since it’s a mesh architecture, it’s perfect for implementations with several units, for example, a whole room full of behavior boxes.

Bluetooth

Bluetooth is the more widely known, and perhaps slightly more expensive, PAN. Again, many companies sell kits for it (e.g., SparkFun). Again, it is a 2.4 GHz RF-based protocol. It can be useful because many laptops, and even some desktop computer, already have Bluetooth modems installed, thus simplifying the implementation.

Nordic

The strength of Nordic’s system is ultra low power usage. It’s less popular for custom electronics than the two other RF-based solutions I mentioned above, but there are still kits available (e.g., SparkFun).

Infrared

For applications which might be sensitive to RF radiation, infrared wireless communication is a nice option. It’s basically line of sight, of course, so it’s more limited than RF, but it won’t interfere with most instrumentation. Even most imaging rigs should be fine around it. IRDA specifications are the most standard ones. However, if you don’t have a lot of data to transmit, and just want to send some simple commands, you can roll your own code pretty easily. This can be dirt cheap too, if you’re building off of some simple microcontrollers such as the Arduino. All you need are IR detectors (e.g., RadioShack) and IR LEDs (e.g., RadioShack), both of which are cheap. For example, to turn on a circuit could be a 700 ms pulse of IR, and to turn off a circuit could be a 250 ms pulse, and all the slave with the IR detector needs to do is to measure the pulse length.

Seeed Studio repurposed parts for cheap MP3 players and made a production miniature oscilloscope, the DSO nano. I like this small tool and bought one of the first iterations (see image above). It’s been so popular, it even has it’s own cheap knock-offs (e.g.).

They followed up with the handsome DSO nano v2.

Most recently, they have a beta run of the DSO Quad.

Also an option is the even smaller XMEGA Xprotolab.

Check out how small it is.

Most of these devices are quite slow, 2 MHz or less, but for many signals, that’s fine. Since they’re based on CPUs like the ARM Cortex M3, they have a lot of nice features, like storage, built-in test signals, and a configurable spectrum analyzer mode. Interestingly, they’re also open source, so you can modify the user interface as you see fit.

Hat tip to CW.

Arduino is a popular, cheap (around 25 USD), and open source microcontroller platform. We use them all over the lab. Students can learn to program them very quickly, they’re versatile, and there is a large user base with tutorials that make implementations easy. The programming environment is quite simple and is almost identical to Processing. In fact, there’s an Arduino plug-in for Processing. There are certainly more powerful options available, but in order to get things done without much learning or development time, these simple tools are great. For example, I have one of these cards wired up to 8 configurable BNC jacks, and it acts a general purpose logic box and timer. Sometime I have it delivering trains of stimuli at the onset of a trigger pulse, other times it manages behavioral rigs. The USB connector is exposed in the back, and I just upload a new program whenever I need to change settings.

Here’s what the programming interface (IDE) looks like:

As you can see, the syntax is pretty C-like and simple. The program above simply reads the input from a push button switch and lights an LED while the switch is pressed. It can be interfaced with many different programming languages/environments (e.g., MATLAB, Python, C++, etc.), usually using the serial port to exchange data.

The hardware comes in a variety of official versions, with different form factors, wireless capabilities, and so forth. Other manufacturers have released their own compatible variations referred to as “Freeduinos”, or other “-duino”-suffixed words to distinguish them from the official versions of Arduino hardware. There are also a large number of plug-in shields for ethernet connectivity, driving motors, and other applications. There are many, many tutorials to get new people started interfacing with other hardware, including sensors, motors, displays, and flash memory.

The best place to get started is on Arduino’s own website. Toolduino is a fun app for a beginner to start with. It’s handy for setting up circuits, prior to programming.

This is just a quick list of manufacturers/vendors of multielectrode recording hardware, and their roots. Unsurprisingly, they were almost all started by neurophysiologists. It’s interesting how diverse they are, they each seem to have a niche. Some features available from various systems:
- Programmable online DSP processing
- Wireless multichannel recording
- Integrated animal tracking for place cells and/or behavior
- Specialized microdrives

Tucker-Davis Technologies (TDT) – Started by an auditory physiologist, Tim Tucker, from David M. Green’s lab.

Blackrock – Started in 2008 by Richard A. Normann, who also made the famous Utah array.

Plexon – One of the oldest on this list, it was started in 1983 by Harvey Wiggins, who got his start building devices for an auditory electrophysiology lab at the University of Texas.

Neuralynx – Started in 1993 by Casey Stengel.

Multichannel Systems – A German company, founded in 1996 by Andreas Moller and Karl-Heinz Boven.

RP Metrix – Started by Dima Rinberg, who is now at Janelia Farm. He works on olfaction.

Biosignal Group – Founded by Andre Fenton, who is now at NYU.

Axona – Started by Jim Donnett from the O’Keefe lab.

Neuronexus – The company that was spun out of the University of Michigan Ann Arbor’s famous electrode engineering program.

Triangle Biosystems
Alpha Omega Engineering
DataWave Technologies

My personal favorite is TDT: high quality electronics with powerful DSPs, mature software, and some of the best tech support I’ve encountered.

(Hat tip to MH)