For my final project, I am planning to create tiny motorized dancing insects that responds to your footsteps and
moves in certain patterns based on the number of your footsteps. This week I tried using sound sensor and motors with ATTiny 44 and 45.
For the interface part, I was planning to show the motion of insects in the form of drawing.
Programming 2 motors to start moving in forward and reverse direction alternately
Here is the Arduino code
Using a sound sensor
I first recreated Neil's electret mic board and tried to check the input data.
When I used the python script, I was able to see varying values from the sensor in the form of waves.
However, when I tried to read the values from arduino serial monitor, I was getting just a constant value.
I checked the code, it worked fine with light sensor but it wasn't working for the electret microphone.
I asked around and someone mentioned that there is some compatibility issue with Attiny 45 and Arduino serial monitor.
Jie suggested that I attach an LED and use that as an output to check the level of sound.
Here is her amazing tutorial.
I attached an LED and a tiny DC motor to the electret board and it worked. The motor is on and LED is off, when the sound level rises,
motor stops spinning and LED turns on.
Here is the video