The DIY electronics transforming research
A research subject watches a brush slowly stroking a rubber hand on a table in front of her, while her own hand — hidden from view — experiences the same stimulation. Eventually, the subject starts to think that rubber hand is her own.
This rubber-hand illusion is a trick of the mind. But it is also a trick of design. Normally, the illusion is created by people who have carefully practised using brushes to stroke the real and rubber hands simultaneously. But Isa Rao, a psychology PhD student at the University of Glasgow, UK, who uses this set-up to gain insight into how people relate to their own bodies, has built an automated rig that delivers the stimuli without a trained assistant. At its heart is an Arduino microcontroller.
Arduinos are one of a growing number of low-cost, stripped-down, and highly configurable computing devices that have transformed the field of homebrew and do-it-yourself electronics. Increasingly, they are transforming the research community too (see ‘March of the mini-computers’). Available for as little as £4 (US$5) for the basic circuit board, or about £50 for a kit including power supply, case and cables, these systems have little in the way of bells and whistles, and the learning curve can be steep. Yet Arduinos and similar devices, such as the Raspberry Pi, pack considerable power on their diminutive boards, providing tremendous opportunities for automation, networking and data collection and analysis.
For researchers, those features can translate into benefits both economic and practical. Users can shoehorn the systems into tiny spaces, deploy them without monitors or keyboards, buy them in bulk, and pack them into autonomous devices that need to be taken to (and transmit data from) remote field locations. All it takes is a little ingenuity.
No experience necessary
Although researchers have been customizing computers and integrating them into their experiments for decades, the market for small, cheap, ‘single-board computers’ has boomed in recent years. The Raspberry Pi — a fully fledged computer that can run the Linux operating system — appeared in 2012; by September 2016, 10 million had been sold. Arduinos — technically, programmable microcontrollers rather than computers — have been similarly popular since their launch in 2005. Off-the-shelf accessories for these devices include cameras, motion sensors, thermometers and Bluetooth adaptors. There’s even an all-in-one system developed for an outreach project on the International Space Station; the system combines a gyroscope, an accelerometer, a magnetometer and sensors to measure temperature, barometric pressure and humidity.
Here on Earth, Raspberry Pis, Arduinos and similar devices have been used to build underwater sound recorders for marine research, robots for assembling gene-editing tools and systems that can rapidly identify drug-resistant pathogens from human samples.
Hakho Lee, who researches medical diagnostic systems at Harvard University in Cambridge, Massachusetts, and who has developed a system to diagnose antibiotic-resistant bacterial infections, says he initially tried to build that system using smartphones as the central computers, but the phones were hard to break apart and reconfigure. By contrast, systems such as the Arduino and the Pi cry out for customization, making them ideal for integration into scientific sensors.
“The Arduino system in this case is perfect,” he says. “They already have so many different flavours and they’re modular. Which means if I want to add Bluetooth, all I have to do is purchase that module and plug that into the motherboard.”
Although Lee has a long history with gadgetry and electronics, such a background isn’t necessary; the plug-and-play nature of the devices has attracted researchers with no previous experience in electronics or programming. Turning the Raspberry Pi board into a functioning computer is as simple as slotting in an SD card preloaded with a Pi operating system, and plugging in a monitor, keyboard, mouse and power supply. Programming the device takes a bit more work, but detailed descriptions online should provide more than enough help for most people.
Indeed, the Raspberry Pi was originally designed to teach children in British schools about programming. Pis and Arduinos speak languages based on C++, so a background in that programming language is useful, but not essential to getting started, says Takeo Katsuki, a researcher at the Kavli Institute for Brain and Mind, part of the University of California, San Diego. “Pick a project and start tinkering with it.” (One possibility is a variant on the ‘Hello, world!’ exercise familiar to programmers. Usually, the goal is to display that message on the screen; here, the idea is to direct the board’s built-in LED to blink on and off.)
Katsuki placed an Arduino at the heart of a system he developed called Flyception, which allows researchers to monitor brain activity in untethered Drosophila fruit flies in response to stimuli. The processor controls camera-triggering and other functions. “The ability to synchronize myriad mechanical and electronic devices with our imaging and behaviour recordings, in an easy-to-use package, makes [the Arduino] an attractive option,” he says.
Before researchers can start building, they must decide what to buy — in what has become a bewilderingly crowded marketplace. Three generations of the standard Raspberry Pi are now available, plus a basic $5 ‘Pi Zero’ version and a low-power version. Arduinos come in even more flavours. Then there are the Galileo and Edison boards from Intel, the open-source Banana Pi, the Odroid (based on the Android operating system) and more.
Choosing a device involves thinking carefully about three variables, says Paulo De Souza, who works on microsensing technology and systems at Australia’s Commonwealth Scientific and Industrial Research Organisation, a governmental research agency based in Canberra. These variables are cost, capability and size, he says. “Generally, you need to pick two of the three; it is difficult to get low cost, small size and high levels of capability in a single device.”
For example, De Souza has worked on autonomous machines, including submarines and rovers, that need to be power-efficient and able to process complex sensor data. His team picked the Odroid XU3 (now superseded by the $60 XU4), which is more expensive than a Pi, but much more powerful. But for a project studying bees, he used an Intel Edison, which has lower power requirements and can even run on solar energy.
Scientists also need to consider how their computer will talk to other elements in their experiment. Raspberry Pis connect to standard monitors, USB keyboards and mice. But as microprocessors, Arduinos must be linked to a computer using cables so that they can be programmed.
Not all devices have the same capabilities. Most take micro-USB inputs, for instance, but some also have Bluetooth and Wi-Fi capabilities. These can become important if you want to build an experimental set-up that can transmit its data to another computer for analysis, for example, or that integrates with a camera or external sensor for more complicated studies. In De Souza’s bee study, the bees were fitted with tiny radio-frequency-identification chips that trigger a scanner as the animals pass by. The Edison computer, located inside the hive, processes the resulting data and uploads them for analysis.
“Consider the options available and perhaps review the requirements to see what you might be able get away without,” says De Souza. And be prepared to update your equipment as systems evolve. For his bee-monitoring project, for instance, De Souza has migrated from another single-board computer, made by a company called Ledato, to a Raspberry Pi; from there to a Galileo; and finally to an Edison.
Follow the beaten path
For those starting out, there are advantages to sticking to the most popular devices — namely the Raspberry Pi and Arduinos.
User forums for both systems are extremely popular, with millions of posts and hundreds of thousands of members, providing a useful resource for novices. Researchers have turned to these forums for assistance with anything from using Arduinos to accurately calculate the girth of trees, to setting up temperature sensors. The foundation behind Raspberry Pi even has a series of videos and a list of common mistakes on its website, to help newcomers get up and running.
“What you really don’t want to do is be fixing technical problems that people have already solved,” says David White, a computer scientist at University College London who has worked extensively with Raspberry Pis. “It would save you a lot of time if you go with standard solutions. You can just harness the popularity of these devices — there’s so much out there.”
Assistance does not have to come from the Internet, however. “Sit down with someone else who has worked with these beforehand,” says White. Or, says De Souza, bring in postgraduate students with backgrounds in information technology. “IT students are passionate about their area and are always up-to-date with the latest solutions,” he says.
Some researchers eventually find that their experiments demand too much of Pi or Arduino components. Katsuki switched to the myRIO controller from National Instruments when he found that the software clock in his Arduinos was not accurate enough for the Flyception system. Lee plans to upgrade to another device — the Jetson, from California-based firm NVIDIA — to gain greater processing power for future projects.
But for many others, the humble, small and cheap Pi and Arduino devices are all they need. Certainly, that was Rao’s experience. “The Arduino was really sent from heaven,” she says.