Capteur de son

Ce capteur va nous permettre de détecter le son

BeginnerProtip30 minutes23
Capteur de son

Things used in this project

Hardware components

Gravity: Analog Sound Sensor For Arduino
DFRobot Gravity: Analog Sound Sensor For Arduino
Capteur de son qui fourni un signal analogique.
×1
Arduino MKR WiFi 1010
Arduino MKR WiFi 1010
×1
Gravity: 130 DC Motor Module
DFRobot Gravity: 130 DC Motor Module
×1
Micro-USB to USB Cable (Generic)
Micro-USB to USB Cable (Generic)
×1

Software apps and online services

Windows 10
Microsoft Windows 10
Arduino IoT Cloud
Arduino IoT Cloud

Story

Read more

Schematics

Diagram Circuit

Diagramme du circuit pour la réalisation.

Code

Untitled_2_nov14a.ino

C/C++
Code utilisé depuis Arduino Cloud.
#include "arduino_secrets.h"
#include <Arduino.h>

int AnalogPin = A3;
int ReadValue = 0;
int motorPin                = 3;   //Motor drive pin D3
bool StateServo = false;

void setup()
{
  Serial.begin(9600);
  pinMode(motorPin, OUTPUT);
  pinMode(AnalogPin, INPUT);
}

void loop()
{
  ReadValue = analogRead(AnalogPin); // connect mic sensor to Analog 0
  Serial.println(ReadValue, DEC);  // print the sound value to serial
  delay(100);
  if (ReadValue > 120)
    StateServo = !StateServo;
  digitalWrite(motorPin, StateServo);   //PWM speed control
}

Credits

Duvalier Delaroch Tsagmo Ngouateu
1 project • 0 followers
Contact
Franck NKEUBOU AWOUGANG
3 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.