Posts tagged with processing

The Open Hardware wave keeps rolling: MySpectral recently announced the Spectrino – an Arduino based spectrometer. It’s as barebones as spectrometers go, with the small enclosure containing a diffraction grating, CCD light sensor and an Arduino. Hooked up to a computer (PC, Mac, Linux) via a USB cable it is controlled and readout by a Processing based simple spectroscopy application. Given the open design, users will be able to adapt this or build their own applications for read out and analysis tailored exactly to their needs.

Obviously the Spectrino won’t be able to compete with OceanOptics or Oriel USB spectrometers in terms of speed or resolution (we’re talking 2 to 4 nm at 8-bit pixel depth here). But given at least my standard applications (Which LED was this? Which filter was that?), it’s an ideal addition to the lab bench. Especially given the expected significantly lower price tag.

Information is still a bit scarce and at the moment they only have a pre-order program running, but the idea is straight forward and they are already preparing to send a Spectrino into orbit, so we have good reasons to assume this is beyond vaporware.

Post by Christian Wilms.

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

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.

1 comments

Processing

Processing is a programming language geared towards visual artists, but it comes in handy for a lot of other purposes as well. Here are some of its finer points:

  • Open source
  • Integrated IDE (see below)
  • Lots of demos and tutorials online
  • Several useful libraries available (e.g., OpenGL, video, network)
  • Cross platform (it’s Java-based)

Most of all, it’s very quick to program something graphical up. So I’ve used it to make little image/movie widgets, programmatically generate complex PostScript files that I then edit with Illustrator, and test visual stimuli. Processing