Silicon Chef is an annual hackathon run by Hackbright Academy, and is described as an “Iron Chef for hardware hackers”. As soon as I found out about it, I knew I had to grab some friends and go. With Joan having a background in Electrical Engineering, me in Computer Engineering, and Yayoi in Computer Science Engineering, we had a pretty good spread in hardware/software knowledge. We met Tawny, Jessica, and Elly, the rest of the team, there.
Our mentor for the event provided us with all sorts of great hardware to choose from. After throwing around a number of ideas, we decided that we couldn’t pass up on the incredible opportunity to play with Emotiv’s EPOC. Not only did Emotiv lend us the hardware and software, they sent a neuroscientist to help us troubleshoot the device and related software all weekend.
Design
For better or worse, we had brainstormed up all sorts of ideas, from systems for rewarding positive behaviour, increasing awareness of suboptimal mental states, or improving mood, to ideas for art pieces. We eventually reduced scope to produce a system that would:
1) dispense snacks to reward positive behaviour(e.g. extended concentration)
2) text funny cat photos to cheer up frustrated users and give them a much-needed break.
Hardware
Sponsors had also provided an Arduino kit and an Electric Imp dev kit, so we tried to integrate all three pieces of hardware. Arduinos don’t have wifi built in and Electric Imps lacked the software libraries we needed to connect to the EPOC. Luckily, enough of us have a background in EE that making the Arduino and Electric Imp talk to each other was one of the easier tasks. The wiring was pretty simple, and we didn’t need to solder anything other than the headers on the Electric Imp. Here’s all the hardware, makeshift containers and all:
Software
Getting data from the EPOC to the Arduino was surprisingly time consuming. We found a diagram on mindmeister.com by Joshua Madara describing the software stack he used. Thanks to the available libraries, we were able to focus on fewer components. We ultimately needed these layers:
- Emotiv EPOC Control Panel – Retrieves data from headset
- Mind Your OSCs – converts EPOC data to Open Sound Control messages
- Processing – provides a bridge via libraries
- oscP5 Library for reading OSC messages from Mind Your OSCs
- Arduino library
- Arduino
- StandardFirmata sketch (allows Arduino to connect to software on a host computer)
- Electric Imp – connects hardware through wifi to server
- Local server on VM with python script
- Twilio API– sends text and images to phones
Our code was written in the Processing(to run on Arduino), Squirrel(Electric Imp) and Python languages. The Processing code looked for signals indicating sufficient focus or frustration, and set corresponding pins high or low, as well as a color-coded LED for “moodlighting”. The Squirrel code checked those pins connected to the Arduino, and controlled the dispensation of the snacks and triggering of the cat photo SMS’s. The portion of it that I have is on github.
Results
We got it working in time for the demos and here we are, waiting for our turn to present our project. My hair is soaked in the saline solution necessary for the contacts to work.
Our dispenser cranked out rewards for the focus, but the unfortunate thing about tying the other half of a demo to a feeling like frustration is that you’re not frustrated when giving a demo. You’re excited (or nervous). And so, that portion of our demo failed until we were ushered off stage and real frustration kicked in, triggering the silly cat photo SMS. Well, at least we know it worked and the lesson to take from this is perhaps to have a video of projects working just in case live demos fail. There are also a number of improvements and simplifications that can be made, and while I’m happy that our proof of concept works, I would definitely do it differently next time.
We didn’t win the hackathon but got to keep the Arduino kit, Electric Imp kit, learned some new things, and made some new friends. That’s kind of like winning. :)