Instructables
Picture of Capacitive Sensing + Open Frameworks + SPACEBREW
2014-04-12 14.44.04-2.jpg
spacebrew.jpg

See our set up in action!!!!

Crystalline Highlands from Lucy Matchett on Vimeo.

This is a step-by-step on how to connect Arduino to OpenFrameworks using Spacebrew.

More specifically our project focuses on the awesomeness of Capacitive Sensing to alter OF projections to create an awesome tactile experience!

What the process will involve:

Arduino -> Processing -> SpaceBrew -> OpenFrameworks

What you will need:

Software:

Arduino

Processing

OpenFrameworks

Capsense Library for Arduino

SpaceBrew Library for Processing

SpaceBrew Library for OF 1 2

Hardware:

Arduino

Anything conductive you want to detect capacitance with!

Resistors

 

 
Remove these adsRemove these ads by Signing Up

Step 1: Capsense with the arduino

Picture of Capsense with the arduino
Screen Shot 2014-04-15 at 10.04.56 PM.png
Screen Shot 2014-04-16 at 12.17.12 PM.png

First you will want to set up your Cap Sense circuit.
You can create as many inputs as there are digital pins (If you wish to have more you will have to implement a multiplexer TUTORIAL LINK ).

The Cap Sense library allows you to turn two of the Arduino's pins into a Capacitive Sensor i.e. Sensors that can detect the electrical capacitance of the human body!

This allows us to create interesting touch sensors to send input to the Arduino.

Setting up the circuit:

  1. The first diagram shows the general set up of circuit with one input. You will want to connect the resistor between two pins, here we have done it between 2 & 3.
  2. Then connect which ever conductive material you wish to be your sensor to the resistor on the pin 3 side.
  3. We are keeping pin 2 as our common send pin which will be used for all our sensors.
  4. Then set up all other sensors in the same way except all having one connection to pin two and then the next free digital pin (See diagram 2)

*** It can be good to just test if it is working by having an exposed wire as your sensor!

THE CODE

Download the CapSense library here
After you have downloaded the library copy the folder into your Arduino library folder.

You can download our code here
(ALL code is commented)




DomAmato5 months ago

This seems unnecessary, why not just use firmata and openframeworks? the processing and spacebrew seem like an extraneous step in the process. If your worried about being able to use the libraries then just send serial messages or if you need to communicate over a network there is already tcp inside openframeworks. I like the project though.

Snax_and_Macs (author)  DomAmato5 months ago

I can see why these steps may seem unnecessary, but there are a few reasons as to why we set this up the way we did.

Firstly firmata is a great library, however it does not allow the use of the Capsense library in conjunction with it, which is what a huge part of our project required! As you mentioned we could have just connected the Arduino to OF using the serial, you are correct!

However connecting this way can sometimes be problematic and unreliable and would require a lot of tinkering with the code etc... SpaceBrew provided us with ease of use, flexibility and ultimately gave us more time to spend on actual aesthetics rather than smaller technical details.

However this isn't the only component to this project, we have other sensors and web inputs that change other projections (Which are not included in this tutorial, look out for future instructables on that!), so for us it made sense to make multiple nodes that we could connect via SpaceBrew!

Ultimately SpaceBrew was implemented as it is easier/quicker to setup than your suggestions and provides a more flexible platform so we can easily remove/ change inputs and their values!

As for using Processing that is how we connected the arduino to SpaceBrew, ultimately it is easier to connect an Arduino to Processing in order to send our data (they are made for each other <3)

A video of it in action please?

Snax_and_Macs (author)  Antzy Carmasaic5 months ago

Video now up!

atosti335 months ago

yeah - I want a video. Prove it!