Proyectos Arduino

Páginas: 9 (2095 palabras) Publicado: 18 de julio de 2011
Spooky Projects Introduction to Microcontrollers with Arduino
Class 4 28 Oct 2006 - machineproject - Tod E. Kurt
• • • • • •
What’s For Today
Switches without Resistors All about piezos Building a melody player Using piezos as pressure & knock sensors Using Processing with Arduino Stand-alone Arduino
Recap: Programming
Edit Compile
Reset Upload
Like always, just make sure. Make“led_blink” come alive again. Do it. Trust me.
Switches w/o Resistors
AVR chip has internal “pull-up” resistors
Instead of this: You can just do this:
+5V 10k
to input
to input
But how do you turn on these internal pull-ups?
This is sort of an aside, but it saves a lot of wiring.
Switches w/o Resistors
Answer: use digitalWrite(pin,HIGH) on the input
C
Seems a little counter-intuitive, think of it assetting the default value of the input
Arduino board
gnd
pin 7
pin 6 pin 5
B
A
but note, it doesn’t work the other way: you can’t set it to LOW then wire the switch to +5V.
Switches w/o Resistors
Can make a button box easily if no resistors are needed
Plugs right into Arduino board =
ABC
• • • • •
Piezoelectrics
Big word – piezein is greek for “squeeze” Some crystals, when squeezed,make a spark Turns out the process goes the other way too Spark a quartz crystal, and it flexes
Piezo buzzers use this to make sound (flex something back and forth, it moves air)
Piezo buzzers don’t have quartz crystals, but instead a kind of ceramic that also exhibits piezoelectric properties. I pronounce it “pie-zoh”. Or sometimes “pee-ay-zoh”.
• • •
Piezo Buzzers
Two wires, red & black.Polarity matters: black=ground
Apply an oscillating voltage to make a noise
The buzzer case supports the piezo element and has resonant cavity for sound
Oscillating voltage alternately squeezes and releases the piezo element. Must apply flucuating voltage, a steady HIGH or LOW won’t work.
diagrams from: http://www.maxim-ic.com/appnotes.cfm/appnote_number/988
What’s in a Piezo Buzzer?
You canget at the piezo element pretty easily.
Be careful not to crack the white disc that is the actual piezo
Only take it out of its case to use it as a sensor
another $1.99 I won’t be getting back from Radio Shack
Of course, you usually destroy the enclosure to get at the element. And it’s the enclosure that has the proper support and resonant cavity to make a loud sound
Piezo Buzzer
piezobuzzer
+ –
Arduino board
gnd
pin 7
Piezo leads are very thin. The breadboard holes grab them better than the header sockets, which is why the jumper leads are used.
Play a Melody
“sound_serial”
Play the piezo beeper with the Serial Monitor
Type multiple letters from “cdefgabC” to make melodies
This sketch is in the handout, and is based on “Examples/pwm_sound/keyboard_serial” Notice theproblem with this sketch? Different notes play for different amounts of time. 50 cycles of low C isn’t the same amount of time as 50 cycles of high B
Making it Quieter Easiest way: add a resistor
Arduino board
gnd
pin 7
10k
(brown, black, orange)
+ – buzzer
piezo
Like most things in electronics, if you want less of something, add a resistor. A better value would probably be 1k, but we don’thave that on hand. This may not seem important now, but wait for the next project.
Play a Stored Melody
“play_melody”
Plays a melody stored in the Arduino
This is in the handout, but is also in “Examples/pwm_sound/play_melody” (pin changed) Melody definition is sort of like the old cell ringtone style Melody playing logic is hard to follow.
Make a Theremin
“ooo-weee-ooooo”
The original spookysound machine
Works by measuring your body’s electric field
No touching needed! We’ll use light in lieu of RF
Leon Theremin
As heard on Star Trek, Beach Boys, horror movies, Mars Attacks!, and bad New Age songs. Works sorta like those touch switches, but no touching here. That is, your body becomes a variable capacitor.
Make a Theremin
Take photocell circuit from before, bolt it on...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • proyecto de arduino
  • ARDUINO Proyect
  • Proyecto Lector De Resistencia Arduino
  • proyecto de arduino hexapodo
  • proyecto ascensor en arduino
  • proyecto arduino
  • Proyectos Arduino
  • Proyecto 1

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS