====== Electronic Wind Bell ======
* Porteur du projet : xiaohan guo [[:user:|]]
* Fichiers utiles : //mettre un lien vers un code ou un fichier//
{{tag>wind arduino sensor}}
===== Note d'intention =====
Create a enelctronic device with anenometer connected to arduino.
Arduino drives several Mp3 readers.
Case :
* Nowind : no mp3 reading
* Little wind : few mp3 play - low audio volume
* Medium wind : more mp3 play - medium audio volume
* Little wind : allmp3 play - max audio volume
{{projets:electronic_wind_bell:start:screen_shot_10-29-20_at_11.19_am.png?800|Electronic Wind Bell}}
==== Références et liens ====
* Maya Dunietz, "Thicket" http://www.mayadunietz.com/new-gallery-12
* Erik Samakh
* Eol force , Impala Utopia https://jeromeabel.net/workshop/eol-force-5/
===== Notes techniques et matériaux =====
* Arduino
* wind sensor (anemometer)
* mp3 player (arduino) +sd https://github.com/salvadorrueda/SerialMP3Player
* amplifier
* Speakers
* Battery
===== Codes =====
* Anemometre branché sur A0 et GND.
* Lecteur mp3 - RX TX sur d11,d10 +5v et Gnd
===== Code pour serial mp3 player avec anemometer =====
#include "SerialMP3Player.h"
#define TX 11 // tx en fait
#define RX 10 // rx en fait
SerialMP3Player mp3(RX,TX);
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
mp3.begin(9600); // start mp3-communication
delay(500); // wait for init
mp3.sendCommand(CMD_SEL_DEV, 0, 2); //select sd-card
delay(500); // wait for init
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
float sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
if (sensorValue > 3) {
mp3.play(); // Play "hello.mp3". You must hear "Hello World"
mp3.setVol(sensorValue/5); // audio volume en fonction du vent...
delay(10);
}
else {
mp3.stop(); // Stop "hello.mp3". You must hear "Hello World"
delay(10);
}
}
===== Photos et médias=====
Code pour afficher les images du projet :
{{gallery>?&crop&lightbox}}