Advice 1: How to connect microphone to Arduino

Connect the module with sound sensor (microphone) to the Arduino.
Module with microphone
You will need
  • - Arduino;
  • module with electret capsule microphone CMA-4544PF-W;
  • - connecting wires.
Instruction
1
Electret microphone CMA-4544PF-W, which is the basis of the module that responds to sound waves with frequencies from 20 Hz to 20 kHz. The microphone is omnidirectional, i.e., sensitive to sound coming from all directions, with a sensitivity of -44 dB. Learn more about the device and principle of operation of electret microphones can be read in the article referenced in the list of sources.
Electret microphone CMA-4544PF-W
2
The module contains electret microphone that requires a power supply of 3 to 10 volts. The correct polarity is important. Connect the module by a simple scheme: the conclusion "V" module to supply +3.3 or +5 volts, the output "G" of the module to GND of the Arduino, the output "S" to analog port "A0" of Arduino.
Connection diagram microphone to Arduino
3
Write a program for Arduino that will read the readings from microphone and output them to the serial port in the mV. Why might we need it? For example, to measure the level of noise; to control the robot to go for cotton or to stop. Some even manage to "teach" the Arduino to identify different sounds and thus create a more intelligent control: the robot will understand the commands "Stop" and "Go" (as, for example, in the article "voice Recognition using the Arduino" in the sources).
Sketch for the reading of electret microphone
4
Let's put a kind of equalizer according to the attached scheme.
A simple "equalizer" on Arduino
5
Some modifications to the sketch. Add LEDs and thresholds were triggered.
Equalizer is ready! Try to talk into the microphone and see how the LEDs light up when you change the volume of speech.
Sketch "equalizer"
Useful advice
The thresholds, after which light up corresponding LEDs depend on the set sensitivity of the microphone. I got 2000, 2125 and 2150 mV. You have to define them yourself.

Advice 2: How to connect a LCD display for Nokia 5110 for Arduino

Deal with connecting a LCD monochrome display with a resolution of 84х48 points from the Nokia 5110 to the Arduino.
LCD screen for Nokia 5110
You will need
  • - Arduino;
  • LCD display for Nokia 5110/3310;
  • - connecting wires.
Instruction
1
Connect LCD from Nokia 5110 Arduino according to the diagram above.
Connection diagram of LCD screen Nokia 5110 for Arduino
2
To work with this LCD screen written a lot of libraries. I suggest to use this: http://www.rinkydinkelectronics.com/library.php?id=44 (the downloading of the file LCD5110_Basic.zip).
To install rotaryforum the file to the directory of Arduino IDE/libraries/.
The library supports the following features.
LCD5110(SCK, MOSI, DC, RST, CS); - the announcement LCD screen showing the matching Arduino pins;
InitLCD([contrast]); - initialization of the 5110 display with optional indication of the contrast (0 to 127), the default value is 70;
setContrast(contrast); sets the contrast (0 to 127);
enableSleep(); - puts the screen to sleep mode;
disableSleep(); - displays a screen from sleep mode;
clrScr(); - clears the screen;
clrRow(row, [start], [end]); - clear the selected line number of the row, from position start to end;
invert(true); invert(false); - disabling and enabling the inversion of the contents of the LCD screen;
print(string, x, y); - displays the character string with the specified coordinates; the x-coordinates you can use LEFT, CENTER and RIGHT; the height of the standard font is 8 points, so the line should go, with intervals of 8;
printNumI(num, x, y, [length], [filler]); - print the number on the screen at the given position (x, y); length - the desired length of the number; filler - the character to fill the "voids" if the number is less than the desired length; the default is an empty space " ";
printNumF(num, dec, x, y, [divider], [length], [filler]); - display a floating-point number; dec - number of decimal places divider - sign decimal separator, by default a period ".";
setFont(name); - choose the font; the built-in font called SmallFont and TinyFont; you can define your fonts in the sketch;
invertText(true); invertText(false); - invert text on/off.off;
drawBitmap(x, y, data, sx, sy); - bring a picture to the screen coordinates x and y; data - an array containing the image; sx and sy are the width and height of the picture.
3
Write this sketch. First, attach the library, then declare an instance of the class LCD5110 with the terminal assignment.
In the procedure setup() initialize the LCD screen.
In the procedure loop() clear the screen and write in the small print arbitrary text underneath - medium font, display seconds counter.
The sketch to display text on the LCD screen Nokia 5110
4
Let's display picture. To do this, prepare a monochrome image that you want to display Nokia 5110. Remember that the screen resolution is 48 by 84 points, and the picture should be no more. On the page http://www.rinkydinkelectronics.com/t_imageconverter_mono.php convert image to array of bits. Download the resulting file with the extension "*.c" and add it to the project via the menu: Sketch -> Add file... or just put the file in the sketch directory, and then restart the Arduino development environment IDE.
Add the image file to the Arduino project
5
Now we need the code to declare an array with the image data (in my code this line extern uint8_t mysymb[];) and then use the function drawBitmap() to display the image in the desired location on the screen.
Output to LCD Nokia 5110
6
Upload the sketch in Arduino. Now the text is replaced by the picture, and every time the counter increases its value.
Text and image on the LCD screen Nokia 5110
Is the advice useful?
Search