Inspiring Kids to Learn About Neuroscience: How I Made a DIY Brain-Reading Headband!
by Facio Ergo Sum in Circuits > Wearables
113 Views, 3 Favorites, 0 Comments
Inspiring Kids to Learn About Neuroscience: How I Made a DIY Brain-Reading Headband!
.png)

.jpg)
If you're an Electrical Engineering student like me, you'll know every senior is required to design a "capstone" project. This means you spend the entire year designing, prototyping, building, and hacking together something cool. You know- to prove you earned your degree. I'm a senior now, which means it's my turn to tackle capstone, and it has taken the last four years to finally decide what project I should build.
Since I'm a maker at heart, and an entrepreneur by trade, I thought I'd come up with my own invention - Project OpenHEG: DIY Neuroscience! It's always been important to me that I help clear a path through the brush for those who come after me, so I hope this project will achieve at least that. This Instructable will explain a bit about what I made, how it works, and how you can build your very own with the help of the open-source files I provided.
Supplies


Tools:
- Soldering Iron & Lead-free Solder
- Hot Glue Gun
- Wire Strippers
- Allen Key or Screwdriver Set (2.5mm)
- Optional: 3D Printer (If you want to print the Kit yourself, I used a Bambu X1 Carbon)
Parts:
- 2x - M3 Nuts
- 2x - M3x12mm Machine Screws
- 1x - tinyCore V2.0 Microcontroller
- 1x - OpenHEG BrainOx Sensor (Files provided below)
- 2x - 100mm STEMMA Connector Wires
- 1x - 3D Printed Headband Kit (Files provided below)
Start With Why

Before we make the headset, I want to talk about why I chose this project. Why neuroscience? Well, I've always been fascinated by the brain. (I'm a computer nerd, and the brain is the coolest computer that's ever existed!) So while researching ways to explore the brain, I hit a wall that got in the way of me learning more: The cost of the electronics required to measure your brain is hundreds, even thousands of dollars! (And I don't think being broke should mean you can't learn about your own brain.)
My first thought was, "Why can’t we make this ourselves? There HAS to be an open-source alternative!" After a quick search, I discovered one that already exists- or rather DID exist. It was called HEGduino; a cost effective IR-light-based headset that could take readings of brain biometrics. Unfortunately, the project seems to have died sometime during the pandemic, and I haven't been able to find any of the headsets online anywhere! And although some of its design is open-source, it isn't easily replicable, so I figured I would just have to build my own. (With some much-needed hardware upgrades of course).
I decided to make sure my new headset would be easy to 3D Print, since custom silicon is a tiny bit more difficult for people to get access to at home. Also, since the whole original project was open-source, anyone who wants to add improvements to the design is 100% welcome to do so! (If you can't tell, I’m a bit obsessed with open-source.)
Now, for less than $100, (assuming you can borrow the tools you're going to need), you can build your very own brain-monitoring headset, and learn about how your brain works! Thanks for listening. Now, back to the tutorial!
Okay Now We Can Start Building















Finally, the "Instruct" part of the Instructable!
Assuming that you've got tools in hand, iron hot, and glue gun ready, files 3D printed, and butt in seat, let's get to building!
Prepping the 3D Print:
First, we need to perform a process called "heat-inserting". this will allow us to connect the 3D Printed parts with a connection much stronger than trying to screw into a 3D Print. Take one nut, and one plastic side, and place it like the picture. Then, set your soldering iron as low as possible. Using the tip of the iron (careful not to touch/melt the plastic), press gently into the nut, and watch as the plastic melts and the nut begins to sink into the plastic. Be quick about this process, as we don't want to ruin the 3D Print, and only press the nut in until it's flush with the surface. Repeat for both sides.
Putting The Band Back Together:
Like the Jonas Brothers, it's time to get this band assembled. Align the base of the band with the holes in the side bands, and line up the tinyCore as well. Carefully, hand thread the M3 screw through this hole, holding the tinyCore, base, and band in place. Repeat with the other side, ensuring they are both straight and aligned. Then, make sure to add 4-5 TPU rings, which will help hold our wires in place.
(It's my favorite..) Hot Glue Gun TIme!
The only person who loves hot glue more than me is (possibly) Ben Heck. You'll want to place a bit of hot glue in each of the hinge pieces, and press them into the ends of the bands.
With this done, we have our core assembly finished! Next up, Electronics.
Wiring the Electronics









To start, we need to prep the sensor and run the STEMMA wires.
To do this, a few things need to happen: First, we're going to place the flexible PCB sensor into the 3D Printed Backing. Lightly bend the plastic so it fits to your forehead. Now, apply a small amount of hot glue to the back of the FlexPCB, so it stays in place.
Then, you'll need to plug in the two stemma cables, and hot glue the flexible PCB Shroud to the top, ensuring the LEDs and Photodetectors line up with their respective holes.
Once this is done, you can clip the PCB to the hinge part we glued earlier. You should feel a click.
Then, you'll run the STEMMA wires through their rubber rings, and back to the tinyCore. At this point, we will plug in the I2C Wire (top) to the STEMMA connector on the tinyCore, and then we will need to strip the other wire (for signals) and solder them to the tinyCore. I recommend using a tinyProto for this, or you can just wire directly to the board. Headers would also work. The pinouts are:
- I2C -> I2C
- 9 -> Yellow (STEMMA)
- 10 -> Blue (STEMMA)
- 13 -> Red (STEMMA)
- GND -> Yellow (STEMMA)
With this complete, our entire headset should be wired (ignoring battery).
Then to finish it up, we will add a cap to cover the PCB, and optionally, you can add a spring to increase tension against your forehead.
Programming and Testing the Headset


.jpg)
.jpg)
Nice job building the headset! We should be ready to flash it with firmware and start measuring our brain!
To do this, we will need to Install the Arduino IDE, and setup our tinyCore board. Here's how:
Once you have the IDE and the custom board library installed, you can download the INO file linked below and open it up.
Editing the Code:
This code requires your WiFi information/password, so that you can login. Update these lines in the code and then you'll be ready.
Be sure you have the tinyCore plugged in via USB-C, and select the board and port in the IDE, then you can compile and flash the code!
If all goes well, the red LED should be visible from the OpenHEG sensor, and the Serial Monitor should be recording data.
If you like Python, we've provided a MatplotLib interface below called "WebDataCollector". Alternatively, you can download and run our Electron UI from our GitHub, compile it using npm install / npm start, and if all is working, then you should see your brain data being mapped on the screen! You should see your heart-rate graphed across the top of the chart, and after around 10-30 seconds of data, your coherence scores and HRV should update as well!
It's a rough prototype at the moment, which could use more development, but this is where Open Source comes in!
So How Does It Work?



So.. I built the thing and I'm seeing my heart rate, but what is it actually doing? How are we using light to measure our brain??
Project OpenHEG uses a niche light-based technique for brain imaging, called “fNIRS”, (pronounced Eff-Neers). This technology is extremely old and is based on the same technology as pulse oximetry. (You know, that little thing they clip to your finger at the doctors office that reads your heart beat).
fNIRS, meaning “Functional Near-Infrared Spectroscopy”, uses near-infrared light to penetrate your tissue and measure the presence of blood. Now you may be wondering how this could possibly pass through your skull to measure the brain, but that’s the fantastic thing about infrared light: bone is invisible in the infrared spectrum, meaning the light passes right through it like glass!
The light goes into your noggin, bounces around and gets absorbed by the blood in the brain, and comes back out where we can measure it.
As this adsorption and diffraction happens, it causes the light level to go down. The amount It goes down is directly correlated to the level of oxygen in the blood. This is called oximetry.
Now there is an important phenomenon that occurs in our brains which allows this to happen, and it’s called Neurovascular coupling (NVC, I know more silly acronyms). This phenomenon says that there is a direct correlation between relative blood flow in the brain and brain activity!
When a neuron fires, it needs oxygen, and the only way for our bodies to give it the oxygen it needs is by sending over some blood.
This means that brain activity creates an increase of oxygenated blood in the brain. If we measure the presence of oxygenated blood, we are actually measuring the relative level of brain activity in that region.
How Do I Contribute?
.jpg)


.JPG)







[Photos of me presenting the project to other students and aspiring engineers at my Senior Expo!]
This entire project was designed *from scratch* by Yours Truly. The electronics, 3D Models, etc., were all done by me, so if you'd like to support more projects like this, keep reading!
All of the files available here on this Instructable are also available through my OpenHEG GitHub repository, including code, hardware, software, etc. Contributions are encouraged, and if enough interest is generated on this project, I may list the sensors on Tindie.
You can pickup your very own tinyCore from the MR. INDUSTRIES website. (Although I'm biased because I made it) I think it's a great tool for learning ESP32 and electronics through project-based learning like this Instructable! It's an exciting time to be involved, since we're still actively developing it, so join our Discord for questions, and follow our progress!
The biggest needs for future development of this particular Instructables project are:
- Better Headset (adjustable, and flexible, potentially incorporating a rubber shroud)
- Upgraded sensor to V3, offload ADC sampling to a dedicated IC
- Upgraded User Interface application and off-board signal-processing.