loading

Hejo! Today, I will show you how to make a capacitive touch morse code thingamajigger! Its pretty cool and fun for a basic arduino project. Its fairly easy and the learning about capacitive touch switches is a road that takes you to many places. Enjoy!

Step 1: Note: Operation

For those of you who don't know how to use a captive touch switch, here are some instructions for operation.

  1. Turn on your Arduino
  2. Upload the Code(step 4)
  3. It should be working, so if you touch the aluminum foil, you should hear a little beep from the speaker.
  4. Combine the beeps to make awesome morse code messages!

Step 2: Parts

For this instructable, you will need:

  1. Arduino Uno(1)
  2. Arduino IDE
  3. Breadboard(1)
  4. piezo speaker/element(1)
  5. jumper wires(several)
  6. aluminum foil square(1)
  7. Resistor(doesn't really matter which one, just sort of low)(1)
  8. A Great mind!!(2)

Step 3: Assembly

So the assembly is pretty simple. The awesome sauce file is a fritzing file so it may be easier to look at it than read and follow my instructions. OK, so the circuit assembly instructions go as follows:

  1. Connect one of the "ground" ports of the UNO to one of the power buses on the breadboard.
  2. Connect pin Digital pin 12 to one of the wire busses on your breadboard.
  3. Connect the positive wire of the speaker/piezo buzzer/element to pin 12's wire bus on the breadboard.
  4. Connect the negative lead of the speaker/piezo buzzer/element to the same power bus that you negatively charged back in step one.
  5. Now connect digital pin 2 to some wire bus on the breadboard.
  6. Connect digital pin 4 to a wire bus close to the one you connected digital pin 2 to.
  7. Bridge the two wires with a resistor, which means place one lead in the same bus as digital pin 2 is in and connect the other lead of the resistor to the same bus that digital pin 4 is in.
  8. Now connect one lead of one of the jumpers to the same bus that digital pin 2 is in and connect the other lead to a piece of metal foil.

Now you have finished the written instructions I put some pictures to aid in the process because I am not sure how clear the directions. Now comes programming, which is in the next step.

Step 4: Programming

So, programming is pretty simple. You have to access the capacitive touch library ad then use some functions and then blah blah Boom! You have a capacitive touch morse code thingymahoozit! The code is below.

#include

capSensor = CapacitiveSensor(4,2);

int threshold=1000;

const int ledPin=12;

void setup() {

Serial.begin(9600);

pinMode(ledPin, OUTPUT); }

void loop() {

long sensorValue = capSensor.capacitiveSensor(30);

Serial.println(sensorValue);

if(sensorValue > threshold) {

digitalWrite(ledPin, HIGH); }

else { digitalWrite(ledPin, LOW); }

delay(10); }



The program can be found easily in examples under starter kit and #13. It is meant for an LED, but it works for a speaker too. Now for mods!

Note: The image does not show the code!!!!!

Step 5: Mods Galore!

This creation is very moddable! You can use a variety of speaker elements and piezo elements. You could add a potentiometer to adjust volume or add LEDs to create a light show. You can modify the code and add certain notes for the speaker to play if you include the note library. You can modify it easily and create a whole range of cool creations. If you build something really cool, post a pic in the comment spot below. Have fun!-DerpyCyclops

About This Instructable

1,174views

14favorites

Bio: Peace
More by DerpyCyclops:How to Make a Crossbow Gauntlet How to Make a Crossbow How to Make Cheap Armor 
Add instructable to: