Ping Organe à l'aide d'un Arduino

I was trying to think of a quick toy I could build for my kids.  I came up with this idea of an ultrasonic range finder, an Arduino, and a speaker.  Basically the Arduino plays a tone out of the speaker based on the distance from the range finder.  The result works pretty well and can be built in minutes.  You can play this from anything from your entire body, to just your feet.

http://www.youtube.com/watch?v=6F4xoe1rQMs

Arduino Ping Organ

Step 1: Parts

1. Arduino
2. Range Sensor (I used a Parallax Ping))) that I picked up a Defcon a couple of years ago, anything like this would work as well http://www.sparkfun.com/products/639)
3. A small speaker (I pulled mine out of an toy moose that sang Blue Christmas)

Ultrasonic range finders basically work by sending out an ultrasonic signal and then they sense how long it takes to come back.  Think sonar for a submarine.

Step 2: Schematic

The Schematic is pretty simple.  Speaker to Arduino pin 11 and ground.  Ultrasonic range finder to power, ground, and Arduino pin 7

Schematic Arduino Ping Organ

Step 3: The Code

The code is pretty simple.  I just combined the Ping demo and the Tone demo that come with the Arduino UI.  I did it a couple of different ways.  You can either take the distance in inches or cm and multiply it by a number (i.e. inches * 10) to get a frequency that’s playable.  Then as you move around you’ll get different frequencies.  To make it more playable I got the frequencies of actual notes and told them to play that note when the distance was within a range (I used 20 cm for each note range).  Then you just have it play the note.  I’ve attached the sketch.
Major Components in Project
1. Arduino
2. Range Sensor
3. A small speaker

A Propos De L'Auteur

Ibrar Ayyub

Je suis expérimenté, rédacteur technique, titulaire d'une Maîtrise en informatique de BZU Multan, Pakistan à l'Université. Avec un arrière-plan couvrant diverses industries, notamment en matière de domotique et de l'ingénierie, j'ai perfectionné mes compétences dans la rédaction claire et concise du contenu. Compétent en tirant parti de l'infographie et des diagrammes, je m'efforce de simplifier des concepts complexes pour les lecteurs. Ma force réside dans une recherche approfondie et de présenter l'information de façon structurée et logique format.

Suivez-Nous:
LinkedinTwitter

Laisser un Commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

fr_FRFrench
Faire défiler vers le Haut