Introduction: Come Home! Connecting Distant Spaces EASILY Over Web
Third Prize in the
DIY University Contest
Visit blinkblinkstem.com for more projects like this!
Can you believe that we live in an age where you can touch an object (any object - if it has metal on it) and a light will turn on in your loved-one's space - even if they live in a different city, state, or country!? You could tell your loved ones or friends when you're missing them, or when dinner is ready. The world is yours!
We're going to show you how to connect spaces using an online websockets connector called Spacebrew. Spacebrew is easy to use and free!
In this Instructable you were going to learn how to connect distant spaces via Arduino, Processing, CapSense, and Spacebrew. If you've never heard of some of these programs/libraries, don't worry. We'll step you through it and we're providing commented code to help you along.
We're going to show you what we did, but you can feel free to make your own inputs and outputs based on your own needs.
You're going to need:
2 Arduino Unos
1 M Ohm Resistor
Conductive fabric, tape, or foil
Step 1: Setting Up the Arduino
You're going to want to configure your Arduino Uno first and download the Capsense Library.
You're going to want to connect an alligator clip to the wire connected to your resistor. Attach conductive tape, foil, or any other highly conductive material to the other end of the alligator clip. This will function as your versatile sensor. You can attach this to any object and with the Capsense library it will become your sensor.
Refer to the code as to which pins you should place your wires in.
I made a piece of paper that says "Come Home" and cut a hole in the paper to reveal my copper tape/capacitive sensor. When I touch the copper tape, the value "true" will be sent over Spacebrew to a receiving Processing sketch that will turn on the LED on the receiving computer's end.
Step 2: Make Arduino and Processing Talk
Currently, Spacebrew, (the toolkit needed to connect the distant spaces over the internet) does not take messages directly from Arduino. We're going to need the Capsense library to be running on the Arduino (which is why we can't use standard firmata) and sending the input from the Capacitive sensor so we're going to import processing.serial* library, and send our values from the Arduino, via serial communication, to Processing.
You'll also import the Spacebrew library for Processing. As the code is currently set up, when the capacitive sensor reads that you're touching the sensor, it will send "true". This processing sketch and the processing sketch on the other side (output side/ your loved one's side) will connect via spacebrew, and the output sketch will light up the LED when it received "true". Read through the sketch's comments to see how it is working.
Step 3: Arduino and Led on OUTPUT Side
You'll want to set up the receiving Arduino now. It's extremely simple. Just attach the ground (shorter leg of your LED) to ground using copper tape and alligator clips or wire, and the power (longer leg of your LED) to pin 13 on your Arduino. You're good to go.
Step 4: Receiving the Input
So now you'll be working on the Processing sketch that will receive the messages from the Capacitive Sensor on the other side - the output side. We chose to make a project that lights up an LED on a building when the the input capacitive sensor is touched and the "true" value is received via Spacebrew connection.
Step 5: Connect the Two Processing Sketch in Spacebrew
1. Run the Output processing sketch
2. Run the Input processing sketch
3. Connect the two notes on Spacebrew's public spacebrew session (LINK)
4. VOILA! Now when you touch your capacitive sensor on one end, the "true" value is sent over Spacebrew to the computer and by extension Arduino on the other end and your LED lights up!
Visit blinkblinkstem.com for more projects like this one!
We have a be nice policy.
Please be positive and constructive.