Replicate "Touch Board" Product Functionality

Original “Touch Board” Product:
“Touch Board” Functionality in Action: [Desired functionality starts at 01:12]

Basically what I am looking to do is have the spark core somehow detect that a person is exiting or entering a doorway. In the above video, they do this using the “Touch Board” and a few very simple circuits painted with electronic ink.

I would guess that they are sensing micro-volt currents induced into the painted circuit through the electromagnetic field of a person walking past the circuit.

I have no idea if my assumption is accurate, and even if it is, I have no idea how to implement it with a Spark Core. I would use the “Touch Board” product except that it does not have the WiFi capability of the Spark Core which is paramount to my potential project.

I would greatly appreciate any help anyone can provide me with.

Thank you,

It looks like they use the MPR121 Capacitive Touch Sensor. I would suggest purchasing a breakout board (Sparkfun for example has one and going from there!

What a cool product by the way! Let us know when you get something similar working with the core!

1 Like

That MPR121 breakout works nicely. With a 5x5cm piece of aluminum foil I was able to detect my hand through ~5cm of wood. Depending on how big you make your sensor, I guess you could detect a person. Also, you can connect those twelve sensors to create one ‘big’ sensor, which should be more suited for this project I think.

Thank you for your quick response! Spark support is fantastic as always :smile: I will definitely post back here when I have a working prototype to show off.


It sounds like you have some experience with this MPR121 breakout board. Do you have any code you can share for implementation of this board with a Spark Core? And could you elaborate a bit more on how you would “connect those twelve sensors to create one ‘big’ sensor”?

I haven’t really done anything other than trying it through my table to test if the range would suffice. I just followed this tutorial with the code, which worked out fine. This might be helpful as well for the ‘big’ sensor. I personally haven’t tried that yet, but it’s supposed to work.
My grand master plan is to eventually mount 12 pieces of aluminum foil behind my wall paper, allowing me to create invisible buttons all over my room :innocent:


Matt from Bare Conductive here. We do use the MPR121, it’s a pretty amazing piece of kit. SparkFun’s breakout boards are great. Check out our library as we’ve worked hard to make some of the MPR121’s more advanced features easily accessible (like setting individual electrode thresholds). Find the library here.

Also, not sure if it’s useful, but we’ve got a processing sketch and a bit of code (designed to run on the Touch Board) that gives you the data straight from each electrode in real time. It’s useful for understand the behavior of a sensor. Find that here.

1 Like

I downloaded the software for the MPR121 and tried to compile it. I am getting wire.h no such file or directory. I created the wire.h file from arduino but it’s still now working. Can you help me with this? Sorry for the noob question but I am new to all this :smiley:

I’m using Spark Dev for windows to compile the code

I could be mistaken, but I believe the Wire.h library is already included, and therefor doesn’t need to be mentioned anymore. (Could you confim this @harrisonhjones?)

under the Firmware folder there are 2 folder
Arduino Sketch
C code

under Arduino Sketch there are 2 files

Under the C code there are 7 files

I opened the Arduino Sketch folder under Spark Dev and compiled getting the wire.h no such file or directory. I am missing something or not compiling it correctly?

Thanks for your help

I just used the SparkDev to compile a empty project (except for main and setup):

#include "wire.h"

/* This function is called once at start up ----------------------------------*/
void setup()


/* This function loops forever --------------------------------------------*/
void loop()
    //This will run in a loop

And it compiled so it looks like wire.h is available. Would you mind posting your entire code in perhaps a zip @mrabie?

I am using the SparkFun code. It’s not allowing me to attach a zip file only images. Here’s the link to the code I downloaded

Thanks for your help

@harrisonhjones I tried your code and still got the same error.
I created a new file called it test.ino
copied and pasted your code
got the same error

You copied and pasted just what I wrote in a new Spark dev project and compiled it using the cloud and got an error?

If so, that’s very strange indeed!

What happens if you try to use the WebIDE?

exact same thing.

Please see attached screenshot

Folks, the Core firmware already has the Wire library built in so you don’t need (or should have) the include. Remove it! :smile:

Thanks the clarification @peekay123! Why does it work for me but not @mrabie tho? Any ideas?

@peekay123 It worked great thanks. But it would be interesting to know why is it working for @harrisonhjones and not for me. Maybe a bug or different library versions

@harrisonhjones thanks for your help :smile:

1 Like

@harrisonhjones, @mrabie, the most likely reason is the pre-compilation that the cloud IDE does that the Spark DEV likely does not do. :stuck_out_tongue: