1 of 34

HackadayU

Interactive Art Using Light & Sensors

2 of 34

Course Info.

Link to these slides, source code, and more! >>

http://www.mirabellejones.com/hackaday-sensors/

3 of 34

What is a Microcontroller?

4 of 34

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.

5 of 34

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

6 of 34

Circuit

Playground

Express

7 of 34

Circuit

Playground

Express

8 of 34

Getting

Set Up

9 of 34

Install Arduino

Download Arduino software at:

Arduino.cc

10 of 34

Install Driver

11 of 34

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”

12 of 34

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

13 of 34

Plug in Circuit Playground.

In Arduino:

  • Go to Tools > Board > Select Circuit Playground Express

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.

14 of 34

Select Correct Port:

  • Go to Tools > Board > Port > select the one that has (Circuit Playground) or (Mac) dev.cu.usbmodem### or (Windows) COM#

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

15 of 34

Our First Program

16 of 34

Github

Github.com/mirabellej/hackadayU_sensors

  1. Go to CODE (green button) >>

  • Select “Download As Zip”

  • Unzip!

  • Open “1_HelloWorld.ino”

17 of 34

Understanding Loops, Functions, and Print Statements (Debugging)

18 of 34

Challenges

  1. Change the output to say “Hello [your name]”

  • Add a second print statement so it prints two things repeatedly

  • Change the number in delay from 250 to another value to make the print statements shorter or faster

  • Advanced users: write pseudocode or real code for a program that blinks an LED on / off each loop or plays a tone.

19 of 34

Hello Speaker

  • Making Sounds!
  • Challenge: Play around with the values to change the tone and the duration
  • Challenge: Make a song / jingle using different tones, durations, and delays!
  • Challenge: Advanced users combine the Hello_Speaker and Hello_Neopixel sketches to include both sound and light!
  • Advanced challenge: create different sound / lighting loops!

20 of 34

Capacitive Touch

21 of 34

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:

https://www.youtube.com/watch?v=BqMHyD-hNNA

22 of 34

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)

23 of 34

Link to

Bigger

Version

What Pin Is This?

This Pinout map will show you what each pin does!

24 of 34

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?

25 of 34

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!

26 of 34

Challenge

Can you play a tone when the cap touch pin is touched?

27 of 34

Extending

We can use alligator clips, wire, thread, paint, and other conductive materials to EXTEND our capacitive touch and other circuits!

28 of 34

Capacitive touch or capacitive sensing allows us to detect and measure anything that is conductive!

Conductive materials include (but aren’t limited to):

  • Conductive thread
  • Conductive fabric
  • Conductive paint
  • Copper, silver, aluminum, steel, tin, graphite, and other metals
  • Electrical wires
  • Conductive silicones
  • Conductive sprays
  • Biological structures (fruits, veggies, plants, us!)

Challenge: grab something(s) in your house you think might be conductive!

(Examples: spoons, knives, scissors, tin foil, fruit, veggies, tin cans)

29 of 34

Conductive Paint

  • Made using conductive pigment: usually containing silver, copper, nickel, carbon
  • Tutorial here!
  • Available as paints, paint pens, pens, or raw pigments
  • Can be used to create conductive artworks like paintings or sketches
  • Prone to breaking / cracking if bent!
  • Bare Conductive Touch Board Kit

30 of 34

Live Sound Performance (Full Body): Electric paint - wired circuits on walls

31 of 34

Conductive Thread

  • Is usually made of stainless steel
  • Comes in 2-ply or 3-ply (think strength n’ stretch!)
  • Is a bit trickier to work with than normal cotton or polyester thread (frays, tangles)
  • Can be sewn by hand or sewing machine
  • Hoops work great!
  • Can be sealed (and finished) with clear nail polish, PLA, or hot glue.

32 of 34

Conductive Fabric

  • Woven textiles which integrate conductive materials (threads or finishes)
  • Available in ripstop nylon, stretch (jersey), and as patterns
  • Some fabrics with metallic threads are conductive but it depends!
  • Often sold as RFID / EM (electro magnetic) shielding!

33 of 34

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.

34 of 34

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.