How to make gesture control blutooth speaker ?
Advantages of a gesture-controlled Bluetooth speaker:
Contactless usage: The touchless operation of the speaker allows users to control music playback and volume without physically touching the device.
Easy to use: hand gestures required to control the speaker are simple , making it easy for anyone to use.
Convenience: Users can change songs, adjust volume, and turn the speaker on or off without having to pick up their phone or get up from their seat.
Improved hygiene: Touchless operation means that the speaker is less likely to collect germs and bacteria from frequent touching.
Safety: Using hand gestures to control the speaker while driving or exercising is safer than trying to manipulate buttons or touch screens.
Energy-saving: The device is designed to automatically turn off after 5 minutes of inactivity, saving energy and extending battery life.
High-quality sound: The speaker's components and design ensure that the sound output is of high quality, with good bass and efficient performance.
Portability: The compact and lightweight design of the speaker makes it easy to carry.
How to make touchless blutooth speaker using arduino?
Gesture Control Bluetooth Speaker.
Materials:
Arduino Nano
HC-05 Bluetooth module
MPU6050 accelerometer and gyroscope sensor
Speaker
Transistor TIP120
1k Ohm resistor
10k Ohm resistor
Breadboard
Jumper wires
Follow this steps:
Step 1: Connect the HC-05 Bluetooth module to the Arduino Nano using the following connections:
VCC to 5V
GND to GND
TX to D10
RX to D11
Step 2: Connect the MPU6050 sensor to the Arduino Nano using the following connections:
VCC to 5V
GND to GND
SCL to A5
SDA to A4
Step 3: Connect the transistor TIP120 to the Arduino Nano using the following connections:
Base to D9
Collector to positive side of the speaker
Emitter to GND
Step 4: Add a 1k Ohm resistor between the base and the Arduino Nano's D9 pin.
Step 5: Add a 10k Ohm resistor between the base and the collector of the TIP120 transistor.
Step 6: Upload the code to the Arduino Nano. You can use the following code as a starting point:
scss
Copy code
#include <SoftwareSerial.h>
SoftwareSerial Bluetooth(10, 11);
int speakerPin = 9;
int zValue = 0;
void setup() {
pinMode(speakerPin, OUTPUT);
Bluetooth.begin(9600);
}
void loop() {
zValue = getZValue();
if (zValue < -15000) {
analogWrite(speakerPin, 0);
} else if (zValue < 0) {
analogWrite(speakerPin, map(zValue, -15000, 0, 255, 0));
} else {
analogWrite(speakerPin, 255);
}
}
int getZValue() {
int16_t zAccel = 0;
int16_t xGyro = 0;
int16_t yGyro = 0;
int16_t zGyro = 0;
Wire.beginTransmission(0x68);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(0x68, 14, true);
zAccel = (Wire.read() << 8) | Wire.read();
xGyro = (Wire.read() << 8) | Wire.read();
yGyro = (Wire.read() << 8) | Wire.read();
zGyro = (Wire.read() << 8) | Wire.read();
return zAccel;
}
This code reads the z-axis acceleration value from the MPU6050 sensor and uses it to control the volume of the speaker.
Step 7: Pair the Bluetooth module with your phone or computer.
Step 8: Open a serial terminal app on your phone or computer and connect to the Bluetooth module using the following settings:
Baud rate: 9600
Data bits: 8
Stop bits: 1
Parity: None
Step 9: Send the letter "a" over Bluetooth to turn on the speaker, and send the letter "b" to turn it off.
That's it! You should now be able to control the volume of the speaker by tilting the accelerometer sensor and turning it on and off using Bluetooth.

Comments
Post a Comment