avana LLC

Input Devices

MIT'S BRIEF

Measure something: add a sensor to a microcontroller board that you have designed and read it.


For this Assignment I wanted to use an Electret Microphone as input device that I also going to use in my Final Project to turn sound into light.



I decided to redesign the sound board from Neil.

The first thing to do was to have a look and redesign the sound board from Neil with the Electret microphone, an Operational Amplifier( Op Amp) and the ATtiny45


Reading the Datasheet of the Attiny 45 I noticed about the power requirements,the pinout scheme and the difference in amount of memory between the attiny25/45/85.
ATtiny25 = Micocontroller with 2KB
ATtiny45 = Microcontroller with 4KB
ATtiny85 = Microcontroller with 8KB



I used Eagle to redesign the board with this component:

Schematics

Board


Milling and Soldering

I used the Fab Modules and the ROLAND SRM-20 to mill the board.


It was very important during soldering to recognize the polarity of the Microphone. The terminal with a solder mark(connecting to the case) is negative and the terminal without a mark is positive.


I tested two dimensions of the Electret microphones available in the Lab because the dimension of my tiny box.
- 9.7 mm Ø, height 4,5mm and 6.5mm Ø, height 4,5mm

Final Board


PROGRAMMING THE BOARD


To program the board, firstly I connected the board to the fabISP and to the computer using the FTDI cable and the usb cable to provide power. I used an Arduino code called "Led Color Organ" which I needed for my Arduino UNO in order to make the circuit recognize the sound and blink through an LED strip.
Before loading the color organ program, I needed to install the Adafruit Neopixel Library downloadable here

Once I downloaded the Library I had to define the correspondent digital pins of my microphone and the ones of my LED strip for the Microcontroller of my board - replacing the correspondent value in Arduino.


Result:
MIC pin:A1
LED pin:0




My bigger issue was trying to get the LED to respond appropriately to the electret microphone using my board.
I made several attempts to make it work but could not get a response that was compelling enough. Mostly, the light flickered constantly even when there was no sound being detected. I was not sure if the Microphone needed to be calibrated but after few attempts I discovered that first I needed to change a resistor and then I had to adjust the gain through the Arduino sketch.



DOWNLOAD FILES.