HackadayU
Interactive Art Using Light & Sensors
Course Info.
Link to these slides, source code, and more! >>
http://www.mirabellejones.com/hackaday-sensors/
What is a Microcontroller?
A microcontroller is an electronic device which is capable of doing one or more tasks. It is made for embedded systems and is often used in automatic control systems. It consists of memory, I/O ports and a processor. A microcontroller unit (MCU) usually comes with a breakout board which might extend its capabilities.
Popular Microcontroller Units
Arduino Uno
(Often just called “an Arduino”)
Teensy
Cheap n’ fast
Great community
Audio breakout
Touch sensing
ESP32
Integrated Wi-Fi & Bluetooth
Internet of Things
ProMicro
Circuit
Playground
Express
Circuit
Playground
Express
Getting
Set Up
Install Arduino
Download Arduino software at:
Arduino.cc
Install Driver
FOR WINDOWS USERS ONLY:
Install Circuit Playground Driver: https://learn.adafruit.com/adafruit-circuit-playground-express/adafruit2-windows-driver-installation
Install Library
In Arduino go to Tools >
Manage Libraries
In Library Manager type “Circuit Playground Express” into search bar >
Click “Install” on
“Adafruit Circuit
Playground Express”
Install Board
In Arduino go to Tools >
In Boards Manager type “Circuit Playground Express” OR “SAMD boards” into search bar >
Click “Install” on latest version
Plug in Circuit Playground.
In Arduino:
If you do not see this listed as an option, you have to install SAMD boards! Go back a few slides and try re-installing then re-starting Arduino.
Select Correct Port:
If you do not see this listed as an option, try restarting your Circuit Playground by pressing the reset button twice and / or unplugging / replugging in your USB cable
Our First Program
Github
Github.com/mirabellej/hackadayU_sensors
Understanding Loops, Functions, and Print Statements (Debugging)
Challenges
Hello Speaker
Capacitive Touch
Live Sound Interfaces: https://vimeo.com/305784071
Materials: conductive paint, wire, copper / foil tape
Interactive Painting 1: https://vimeo.com/251359867
Materials: Conductive paint, projection mapping
Interactive Painting 2: https://www.youtube.com/watch?v=HuybzYFrXmc
Music Wall: https://www.youtube.com/watch?v=RG5Fi-eCLbc
Lego Wall:
Capacitive Touch
The Circuit Playground has SEVEN built-in capacitive touch sensing pads. These are labeled A1 - A7 and correspond to the following digital pins (note: digital pins are not printed on the PCB - see pinout next slide):
-A1 (D6)
-A2 (D9)
-A3 (D10)
-A4 (D3)
-A5 (D2)
-A6 (D0)
-A7 (D1)
Capacitive Touch
Open up the sketch 2_CapTouch_Simple and upload this sketch to the Arduino IDE
Go to Tools > Serial Plotter
Now try touching the pad that says A1 on it. Stop touching. Notice the difference! What do you observe when you touch vs. when you hold?
Challenge:
Close plotter and open serial monitor.
Try the same experiment.
What do you notice?
Challenge:
Try putting a piece of paper over the electrode
And seeing how this changes the result!
What if you use fabric? Plastic?
Capacitive Touch
What if we want to design using capacitive touch to trigger output? We need to set a THRESHOLD in order to decide what VALUE means the pad has been touched.
Open 2_CapTouch_Threshold
Use Serial Monitor to note what the value is when you are touching the pad.
Set a new THRESHOLD based on this value vs the “untouched” value.
Re-upload the sketch and try touching then not touching the pad to see if it is working.
Challenge: have your Circuit Playground play a sound when it is being touched!
Challenge
Can you play a tone when the cap touch pin is touched?
Extending
We can use alligator clips, wire, thread, paint, and other conductive materials to EXTEND our capacitive touch and other circuits!
Capacitive touch or capacitive sensing allows us to detect and measure anything that is conductive!
Conductive materials include (but aren’t limited to):
Challenge: grab something(s) in your house you think might be conductive!
(Examples: spoons, knives, scissors, tin foil, fruit, veggies, tin cans)
Conductive Paint
Live Sound Performance (Full Body): Electric paint - wired circuits on walls
Conductive Thread
Conductive Fabric
Capacitive Touch
Challenge: try attaching an alligator clip to the pad and then attaching your conductive object (foil, knife, scissors, fruit, etc). Re-upload the sketch then open serial monitor. What happens when you touch your object?
Note: If you are getting a “false positive” (meaning the monitor keeps saying “touched” when the pad is not being touched), try raising the threshold to 1015 then re-uploading your sketch.
If you are still getting false positives, try unplugging / resetting your controller. You may have to do this a few times.
Instrument
We can use all 7 of the capacitive touch pads on the Circuit Playground at once to trigger different interactions for each pad!
Open the sketch: 2_CapTouch_Instrument
Try touching each of the cap touch pads to trigger different sounds.
Challenge: try changing the tones to make your own reactive instrument!
Challenge 2: try attaching alligator clips and conductive objects to make your own instrument! You can also try making a sculpture using foil, wire, or other materials.