Things used in this project

Hardware components:
Swel30ysinrlyiqmmnfr
Arduino MKRZero
×1
Medium breadboard
×1
Jumper Wires
×1
Diode
×1
Mosfet N-Channel
×2
ICS43432 I2S digital microphone
×1
micro servo motor+ DC motor
×1
0.1 uF ceramic capacitor
×1
100 uF electrolitic capacitor
×1
2.2Kohm resistor
×1
Rubber band
×1
Software apps and online services:
Ide web
Arduino IDE
Ide web
Arduino Web Editor
Hand tools and fabrication machines:
Lasercutter
Laser cutter (generic)

Custom parts and enclosures

LaserCutterTemplates
Templates for the box.
I6neCvVZL9MBbADnderV.rar

Schematics

Circuit Diagram
Fevtlljfzypwrliv8wul

Code

MKRZero_MakeItRainMachineC/C++
/*
  Make-it-Rain Machine

  Create a small machine that throws paper (notes) when clapping.
  This sketch uses the new ArduinoSound library to communicate
  with the I2S microphone. The microphone is used to detect
  the clappings.

  This example code is in the public domain.

  Parts required:
  1 Mkrzero board (or compatible)
  1 ICS43432 I2S Digital MicrophoneS
  1 Standard servo motor
  1 DC motor
  2 N-channel mosfet transistors
  2 2kohm pull up resistors
  1 0.1uF capacitor
  1 100uF capacitor

  Link for the laser cut parts in the project hub
  tutorial page.

  created by
  E.Lopez <e.lopez@arduino.cc>
  T.Pham  <t.pham@arduino.cc>
  1 Dec 2016
*/

#include <ArduinoSound.h>
#include <Servo.h>

AmplitudeAnalyzer amplitudeAnalyzer;

const int amplitudeDeltaThreshold = 100000000;
const int ledPin = LED_BUILTIN;
//pin for the DC motor
const int dcMotor = 7;
Servo myservo;
int lastAmplitude = 0;

/**********
   SETUP
 *********/
void setup() {
  Serial.begin(9600);

  myservo.attach(6);

  pinMode(ledPin, OUTPUT);
  pinMode(dcMotor, OUTPUT);

  analogWrite(dcMotor, 0);
  myservo.write(5);

  if (!AudioInI2S.begin(44100, 32)) {
    Serial.println("Failed to initialize I2S input!");
    while (1); // do nothing
  }

  // configure the I2S input as the input for the amplitude analyzer
  if (!amplitudeAnalyzer.input(AudioInI2S)) {
    Serial.println("Failed to set amplitude analyzer input!");
    while (1); // do nothing
  }
}

/**********
   LOOP
 *********/
void loop() {
  if (amplitudeAnalyzer.available()) {
    int amplitude = amplitudeAnalyzer.read();
    int delta = amplitude - lastAmplitude;

    //check for clappings
    if (delta > amplitudeDeltaThreshold) {
      Serial.println("clap detected");

      digitalWrite(ledPin, !digitalRead(ledPin));

      //turn on DC motor at a reduced speed.
      analogWrite(dcMotor, 125);
      delay(250);
      //Activate servo tu push the paper up.
      myservo.write(95);

      delay(1000);

      //Turn off the motor and reposition servo
      analogWrite(dcMotor, 0);
      myservo.write(6);
    }

    lastAmplitude = amplitude;
  }
}

Credits

Replications

Did you replicate this project? Share it!

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Personal Healthcare Assistant PHA
Intermediate
  • 1,584
  • 113

Full instructions

Wearable for monitoring the health condition of patients who have suffered or are in risk of having a cardiac arrest.

Arduino Altair 8800 simulator
Intermediate
  • 5,827
  • 30

Full instructions

Ever wanted to play with the computer that sparked the personal computer age but don't have the cash to buy an Altair? Build your own!

Rocky Rover: Robotic Vision System PixyCam & Arduino 101
Intermediate
  • 4,034
  • 42

Full instructions

Using PixyCam and Intel Arduino 101 to drive this rover. Easy Robotic Vision system using PixyCam, rover reacts to the ball using Pan/Tilt.

Smart and Safe Cabinets
Intermediate
  • 391
  • 8

Full instructions

With 41% of poisonings happening to children under 4, more needs to be done. We use Amazon Alexa and Intel IoT to lock and unlock cabinets.

Smart and Safe Cabinets

Magic Smoke Replacement Team

Robot for supercool indoor navigation
Intermediate
  • 369
  • 6

Work in progress

The robot navigates indoor, in a pre-defined path, with high accuracy, and allows its real-time tracking on a phone. No GPS, No WiFi, No Map

Sketch It (CNC plotter)
Intermediate
  • 567
  • 8

Full instructions

It can Sketch accurately, You just have to upload the gcode of the image.Try it it's just Awesome......My first project.

ProjectsCommunitiesContestsLiveFree StoreBlogAdd projectSign up / Login
Respect project