Hacklet 56 – Brain Hacks

The brain is the most powerful – and least understood computer known to man. For these very reasons, working with the mind has long been an attraction for hackers, makers, and engineers. Everything from EEG to magnetic stimulus to actual implants have found their way into projects. This week’s Hacklet is about some of the best brain hacks on Hackaday.io!

teensy-bio[Paul Stoffregen], father of the Teensy, is hard at work on Biopotential Signal Library, his entry in the 2015 Hackaday Prize. [Paul] isn’t just hacking his own mind, he’s creating a library and reference design using the Teensy 3.1. This library will allow anyone to read electroencephalogram (EEG) signals without having to worry about line noise filtering, signal processing, and all the other details that make recording EEG signals hard. [Paul] is making this happen by having the Teensy’s cortex M4 processor perform interrupt driven acquisition and filtering in the background. This leaves the user’s Arduino sketch free to actually work with the data, rather than acquiring it. The initial hardware design will collect data from TI ADS129x chips, which are 24 bit ADCs with 4 or 8 simultaneous channels. [Paul] plans to add more chips to the library in the future.

 

bioxNext up is [Jae Choi] with Lucid Dream Communication Link. [Jae] hopes to create a link between the dream world and the real world. To do this, they are utilizing BioEXG, a device [Jae] designed to collect several types of biological signals. Data enters the system through several active probes. These probes use common pogo pins to make contact with the wearer’s skin. [Jae] says the active probes were able to read EEG signals even through their thick hair! Communication between dreams and the real world will be accomplished with eye movements. We haven’t heard from [Jae] in awhile – so we hope they aren’t caught in limbo!

bioloop[Qquuiinn] is working from a different angle to build bioloop, their entry in the 2015 Hackaday Prize. Rather than using EEG signals, [Qquuiinn] is going with Galvanic Skin Response (GSR). GSR is easy to measure compared to EEG signals. [Qquuiinn] is using an Arduino Pro Mini to perform all their signal acquisition and processing. This biofeedback signal has been used for decades by devices like polygraph “lie detector” machines. GSR values change as the sweat glands become active. It provides a window into a person’s psychological or physiological stress levels. [Qquuiinn] hopes bioloop will be useful both to individuals and to mental health professionals.

biomonitorFinally we have [Marcin Byczuk] with Biomonitor. Biomonitor can read both EEG and electrocardiogram (EKG) signals. Unlike the other projects on today’s Hacklet, Biomonitor is wireless. It uses a Bluetooth radio to transmit data to a nearby PC or smartphone. The main processor in Biomonitor is an 8 bit ATmega8L. Since the 8L isn’t up to a lot of signal processing, [Marcin] does much of his filtering the old fashioned way – in hardware. Carefully designed op-amp based active filters provide more than enough performance when measuring these types of signals. Biomonitor has already found it’s way into academia, being used in both the PalCom project, and brain-computer interface research.

If you want more brain hacking goodness, check out our brain hacking project list! Did I miss your project? Don’t be shy, just drop me a message on Hackaday.io. That’s it for this week’s Hacklet, As always, see you next week. Same hack time, same hack channel, bringing you the best of Hackaday.io!

Hackaday Prize Entry: Biopotential Signal Library

With prosthetics, EEG, and all the other builds focused on the body and medicine for this year’s Hackaday Prize, it might be a good idea to take a look at what it takes to measure the tiny electrical signals that come from the human body. Measuring brain waves or heartbeats indoors is hard; AC power frequencies easily couple to the high impedance inputs for these measurements, and the signals themselves are very, very weak. For his entry to The Hackaday Prize, [Paul Stoffregen] is building the tools to make EEG, ECG, and EMG measurements easy with cheap tools.

If the name [Stoffregen] sounds familiar, it’s because he’s the guy behind the Teensy family of microcontroller boards and several dozen extremely popular libraries for everything from displays to real time clocks. The biopotential signal library continues in [Paul]’s tradition of building very cool stuff with just code.

The hardware used in this project is TI’s ADS1294, a 24-bit ADC with either 4 or 8 channels. This chip is marketed as a medical analog front end with a little bit of ECG thrown in for good measure. [Paul] is only using the ADS1294 initially; more analog chips can be added later. It’s a great project in its own right, and when you include the potential applications of this library – everything from prosthetics to body sensors – it makes for an awesome Hackaday Prize entry.


The 2015 Hackaday Prize is sponsored by:

An Open Hardware Platform for ECG, EEG and Other Measurements

[Eric] tipped us about the OpenHarwareExG project which goal is to build a device that allows the creation of electrophysiological signal processing applications. By the latter they mean electrocardiography (ECG, activity of the heart), electroencephalography (EEG, signals on the scalp), electromyography (EMG, skeletal muscles activity), electronystagmography and electrooculography (ENG & EOG, eye movements) monitoring projects. As you can guess these signals are particularly hard to measure due to their small amplitude and therefore susceptibility to electrical noise.

The ADS1299 8-channel 24-bit analog front end used in this platform is actually electrically isolated from the rest of the circuit so the USB connection wouldn’t perturb measurements. An Arduino-compatible ATSAM3X microcontroller is used and all the board is “DIY compatible” as all parts can be sourced in small quantities and soldered by hand. Even the case is open source, being laser cut from acrylic.

Head to the project’s website to download all the source files and see a quick video of the system in action.

Interested in measuring the body’s potential? Check out an ECG that’s nice enough to let you know you have died, or this Android based wireless setup.

 

Android Based Wireless ECG

ECG

The title of [Nuclearrambo’s] post says it all, “Android based wireless ECG monitoring (Temperature sensor and glucometer included).” Wow! What a project!

The project is built around the HC-06 bluetooth module and the Stellaris LaunchPad from TI, an inexpensive ARM developer kit. Building an ECG is a great way to learn about instrumentation amplifiers, a type of differential amplifier used for its extremely high common mode rejection ratio (CMRR). Please be sure to keep in mind that there are a myriad of safety issues and regulation concerns for medical device, and there is no doubt that an ECG is considered a medical device. Sadly, [Nuclearrambo’s] post does not include all of the code and design files you need to build the system, which is understandable considering this is a medical device. That being said, he provides a lot of information about building high-quality ECG instrumentation and the web interface.

It would be great if [Nuclearrambo] could post the Android application code and Stellaris LaunchPad code. Even with these omissions, this post is still worth reading. Designing medical devices requires a lot of know-how, but who knows, maybe your next project can save your life!

MobilECG goes open source

After a failed crowdfunding campaign, MobilECG has gone open source. MobilECG is a medical grade 12 lead electrocardiograph. A 12 lead system is quite a bit more complex than some of the ECG systems we have featured in the past.  [Péter], the founder and designer of the device attempted to fund it through an Indiegogo campaign. While MobilECG is relatively cheap, medical certifications are not. The campaign didn’t reach its goal of $230,000 USD. [Péter] tried again with a grass-roots donation round at his website. That round also fell short of [Péter’s] goal to keep working on the project. Rather than let his hard work go to waste, [Péter] has made the decision to release his hardware and software to the community. The hardware is licensed under CERN OHL v1.2. The software is released under the humorously named WTFPL.

While we’re not ECG experts, the basic hardware design appears to be sound. MobileECG is based around the Texas Instruments ADS1278 octal analog to digital converter. Two AVR microcontrollers are used, an ATTiny24, and an ATUC64. The analog design incorporates such niceties as lead off detection and defibrillator protection. It should be noted that there are some known bugs in the design, [Péter] mentions he can be contacted with questions. The software seems to be in an early state, and would require quite a bit of work to get it to a final design. While we do wish [Péter] had better luck with his campaign, we’re always glad to see designs released into the open source community.

Continue reading “MobilECG goes open source”

Arduino Powered ECG Informs Users of Their Death

Just when you thought you’d seen an Arduino do everything, [birdyberth] built an Arduino powered Electrocardiogram (ECG or EKG). Electrocardiography is a non invasive method of studying the heart. For many of us that means a 10 minute test during our yearly physical exam. Medical grade ECGs can use up to 10 electrodes. To keep things simple [birdyberth] went the route of a few circuits we’ve seen before, and reduced it to two electrodes and a ground reference. [birdyberth] makes note that the circuit is only safe if battery power is used.

The “heart” of any ECG is an instrumentation amplifier. Instrumentation amplifiers can be thought of as super differential amplifiers. They have buffered inputs, low DC offset, low drift, low noise, high open loop gain, and high impedance among other favorable characteristics. The downside is cost. A typical op amp might cost 0.50 USD in single piece quantities. Instrumentation amplifiers, like [birdyberth’s] INA128 can cost $8.30 or (much) more each. The extra cost is understandable when one thinks about the signals being measured. The ECG is “picking up” the heart’s electrical signals from the outside on skin. On commonly used ECG graph paper, a 1mm square translates to about .1 mV. High gain and clean signals are really needed to get any meaningful data here.

Electrodes are another important part of an ECG. Medical grade ECG units typically use disposable adhesive electrodes that make a strong electrical connection to the skin, and hurt like heck when they’re ripped off by the nurse. [birdyberth] was able to make electrodes using nothing more than tin foil and paper clips. We think the real trick is in the shower gel he used to make an electrical connection to his skin. While messy, the gel provides a low resistance path for the tiny currents to flow.

The actual processing in [birdyberth’s] circuit is easy to follow. The signal from the instrumentation amplifier is sent through a low pass filter, through a 741 op amp, and then on to the Arduino. The Arduino uses a 16×2 LCD to display heart rate in beats per minute, along with a friendly message informing you if you are alive or dead. The circuit even provides audible feedback for heart beats, and the classic “flatline tone” when the users either disconnects the electrodes or expires. [birdyberth] has also plugged in his pocket oscilloscope just after the low pass filter. As his video shows, the familiar ECG waveform is clearly visible. We’d love to see a more complex version of this hack combined with [Addie’s] heart simulator, so we could know exactly which heart malady is killing us in real time!

Continue reading “Arduino Powered ECG Informs Users of Their Death”

A handful of parts used to form an Electrocardiogram

minimal-ecg

It’s difficult to image a more bare-bones approach to building an ECG. [Raul] used an Arduino nano to collect samples and push them to a computer for graphing.

An Electrocardiogram measures electrical activity around your heart. The white circles above are the sensors which he picked up in a box of fifty for 11 Euros (under $15). Stick them on your skin in just the right places and they’ll report back on what your heart is doing.

He used a AD8221 to amplify the signals. He mentions that this is an ins-amp, not an op-amp. We didn’t find a concise reference explaining what that is. It might be a good topic for the comments section. The signal from that chip feeds into an LM324 op-amp before being dumped into the Arduino.

Simplicity comes at a price. This measures very small electrical impulses and has very little in the way of shielding and filtering. Because of this you may need to do a rain dance, say a prayer, burn a candle, and stick needles into a doll to get a reliable signal on the other end.

Here’s another version that doesn’t require special sensors.