Overview
In this tutorial, we will learn about APR33A3 Voice Record & Playback Module & its interfacing with Arduino. APR33A3 is a 8 Channel Voice Record & Audio Playback Board integrated with APR33A series IC which is a powerful audio processor along with high-performance audio analog-to-digital converters (ADCs) and digital-to-analog converters (DACs).
We will learn how to use this module, i.e. recording of Audio and playing it back again. We will also make Audio supported project using Arduino Board. The board can be used in multiple applications like Audio Notifier in Accident Detection System or as a Namastey Greeting Robot in PIR Sensor Application. It can also be used in applications such as doorbells, Voice-Controlled Robots, railway announcement systems, and automatic telephone answering devices. Here, we will use this module with the ultrasonic Sensor HC-SR04 to notify the detected distance to a blind person.
APR33A3 Voice Record & Playback Module
The APR33A series is a powerful audio processor along with high-performance audio analog-to-digital converters (ADCs) and digital-to-analog converters (DACs). The IC is a fully integrated solution offering high performance and unparalleled integration with analog input, digital processing, and analog output functionality.
The APR33A series is specially designed for the simple key trigger. The user can record & play the message averagely for 1, 2, 4, or 8 voice message(s) by a switch and be adjusted the sample rate by using different values of resistors. It is suitable in a simple interface or needs to limit the length of a single message, e.g. toys, leave messages system, answering machine, etc.
APR33A3 Features
1. Operating Voltage Range: 3V ~ 6.5V
2. Single-Chip, High-Quality Audio/Voice Recording & Playback Solution
3. No External ICs Required
4. Minimum External Components
5. User Friendly, Easy to Use Operation
6. Programming & Development Systems Not Required
7. 680 sec.(11 Minutes) Voice Recording Length in APR33A3-C2
8. Nonvolatile Flash Memory Technology
9. No Battery Backup Required
10. External Reset pin
11. Powerful Power Management Unit
12. Very Low Standby Current: 1uA
13. Low Power-Down Current: 15uA
14. Supports Power-Down Mode for Power Saving
15. Built-in Audio-Recording Microphone Amplifier
16. No External OPAMP or BJT Required
17. Easy to PCB layout
18. Configurable analog interface
19. Differential-ended MIC pre-amp for Low Noise
20. High-Quality Line Receiver
21. High-Quality Analog to Digital and PWM module
22. Simple And Direct User Interface
23. Averagely 1,2,4 or 8 voice messages record & playback
How to Record your Voice using APR33A3?
1. The device can be power up in two ways, either by a 5V supply or by a 12V supply. Slide the power switch for selection.
2. We can use 8 channels(M1 TO M8) for audio recording, each channel having 1.3 minutes recording length.
3. Onboard MIC will automatically be used for recording.
4. Switch on the board power LED(LD1) will on.
5. There is a slide button called REC/PLAY, which means you can select the recording or play mode.
6. While in record mode, select a channel(M1-M8) to record the message. Let us assume we want to record messages in channel M0, Connect M1 to GND. Or you can press & hold the M1 button directly.
7. Now whatever we speak will be captured by MIC and recorded, status LED(LD2) will on in record mode indicating that the chip is currently recording. Once the duration is full the LED(LD2) will off means that the segment is full.
8. You can release the M1 button to stop recording or simply disconnect it from the GND.
How to Playback recorder message using APR33A3?
- Connect the speaker to the board Speaker section.
- Now let us check what we recorded. For that slide the REC/PLAY to PLAY part.
- Now press the button(M1-M8), status LED(LD2) will ON till the recorded sound play in the speaker.
- This procedure same for the remaining channels also.
How to use APR33A3 with Arduino or any Microcontroller?
Let us see how we can use the APR33A3 Voice Recorder Playback module with Arduino or any other microcontroller.
1. First, do Voice Recording Manually
2. To playback connect Controller I/Os to M0 to M7
3. When the output goes low for a particular Pin recorded message will play
Interfacing APR33A3 Voice Recorder & Playback Module with Arduino
Now let us interface APR33A3 Voice Recorder & Playback Module with Arduino. In this part, we will be using this module along with Ultrasonic Sensor HC-SR04 & OLED Display. The connection diagram is given below.
The HC-SR04 Module is an ultrasonic sensor used to measure distance. To display the measured distance, I used a 0.96″ I2C OLED Display. The APR33A3 Voice Recorder & Playback Module has 8 output pins from M0-M8. One of the pins can be connected to Arduino. The digital low input will activate the module pin and can be used to playback the recorded voice message. I selected M1 & connected it with Arduino D8 pin.
In this project the device will play the audio like distance 5CM, 10CM, 15CM, 20CM. For this initially, record the audio from channel M1-M4 as the following message.
1. M1: Distance is 5cm
2. M2: Distance is 10cm
3. M3: Distance is 15cm
4. M4: Distance is 20cm
The code will activate the channel on the basis of distance detected. To check the working of the entire system, you can follow the video at the end of this tutorial.
Source Code/Program
The complete source code is given below. You need Arduino U8glib Library for this code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
#include "U8glib.h" #include <Wire.h> // setup u8g object U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE); // I2C // const int trigPin = 8; const int echoPin = 7; long duration, inches, cm, avgCm; String longString = ""; int tapeLength = 0; int voice1 = 2; int voice2 = 3; int voice3 = 4; int voice4 = 5; void setup() { Serial.begin(9600); Wire.begin(); pinMode(voice1, OUTPUT); pinMode(voice2, OUTPUT); pinMode(voice3, OUTPUT); pinMode(voice4, OUTPUT); } void loop() { avgCm = 0; for (int f = 0; f < 5; f++) { // average out 5 readings ultrasonic(); avgCm = avgCm + cm; } cm = avgCm / 5; //draw loop u8g.firstPage(); do { draw(); } while ( u8g.nextPage() ); delay(50); if (cm <= 5) { digitalWrite(voice1, LOW); } else { digitalWrite(voice1, HIGH); } if ((cm > 5) && (cm <= 10)) { digitalWrite(voice2, LOW); } else { digitalWrite(voice2, HIGH); } if ((cm > 10) && (cm <= 15)) { digitalWrite(voice3, LOW); } else { digitalWrite(voice3, HIGH); } if ((cm > 15) && (cm <= 20)) { digitalWrite(voice4, LOW); } else { digitalWrite(voice4, HIGH); } } void ultrasonic() { pinMode(trigPin, OUTPUT); digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); pinMode(echoPin, INPUT); duration = pulseIn(echoPin, HIGH); inches = microsecondsToInches(duration); cm = microsecondsToCentimeters(duration); Serial.print(inches); Serial.print("in, "); Serial.print(cm); Serial.print("cm"); Serial.println(); delay(100); } long microsecondsToInches(long microseconds) { return microseconds / 74 / 2; } long microsecondsToCentimeters(long microseconds) { return microseconds / 29 / 2; } void draw(void) { u8g.setFont(u8g_font_profont12); u8g.drawStr(5, 8, "Arduino Tape Measure"); if (cm > 110) { longString = "---"; tapeLength = 0; } else { longString = String(cm) + "cm"; tapeLength = cm; } const char* newData = (const char*) longString.c_str(); u8g.setFont(u8g_font_profont29); u8g.drawStr(30, 40, newData); // now draw tape for (int f = 10; f < 120; f = f + 10) { u8g.drawLine(f, 48, f, 61); } for (int f = 2; f < tapeLength + 3; f++) { u8g.drawBox(f, 50, 1, 10); } } |
1 Comment
Where is the circuit diagram