Skip to main content

TuneGlass: Can we make MUSIC using our EYEs????

There was a question in my head, if morse code can be used by eyes then... I can make a music with that. Morse code is of some pattern, music is also some patterns of sound or bit (Have a little knowledge in that). Then I thought if we can wink in a pattern we can definitely generate music, at least we can synthesize that pattern. That's what I've tried to do in this project. I tried to make music using eyes.
Let's see how we can do that.

Step 1: Parts You'll Need

Picture of Parts You'll Need
Picture of Parts You'll Need
Picture of Parts You'll Need
  • Arduino pro mini - I've used the ATmega328p 5v 16 mHz one
  • IR sensor (without ADC board)
  • Speaker - I've taken it from old phone
  • Powerbank Module - booster
  • Small lipo battery - I used a 150 mAh battery

Step 2: Principle

So, I've used two ir sensors to see if eyes are closed or open. Each IR sensor outputs some data (0 to 1023). Now if it sees any closed eye the value decreases thus it can say the corresponding Eye is closed (wink detected). You can buy Eye Blink sensor but the working functionality is all the same yet my solution is cheaper and it works.
After detecting any wink or blink it outputs a sound in a different frequency for each eye. And if both the eyes are closed another frequency. Hope you got the point.
Now lets make it.

Step 3: Build the Circuit

Picture of Build the Circuit
Picture of Build the Circuit
Picture of Build the Circuit
2 More Images
The circuit diagram is pretty easy and simple. You can always watch the video on top to see how I did it. Just use a ribbon cable to avoid messy wires. Then solder parts as per the circuit diagram.
Note: Use a better cable for battery connection. As you know that the resistance value increases as the wire becomes longer, so I've used a servo cable which can pass enough current to get things going. Then power it up before connecting things together.

Step 4: Upload the Program

Now as I've mentioned earlier two different frequencies are set for each eyes. This works using Tone function.
tone(speaker_name, frequency_in_Hz, delay);
To program Arduino pro mini:
  1. Remove the ATmega 328p IC from Arduino Uno
  2. Connect uno Tx to mini tx
  3. Uno Rx to mini rx
  4. Uno 5v to mini vcc
  5. Uno Gnd to mini gnd
  6. Uno Reset to mini rst
Then go to arduino.ide and select board (arduino pro mini) and port then upload the following code. You can also download or follow the code here.
/* * Making music using Eye
* by: Ashraf Minhaj
* mail: ashraf_minhaj@yahoo.com
* license: General Public License
*/
//connect sensors on int sen1 = A0; //A0 int sen2 = A1; //A1
//Connect speakers (Not acutally buzzers) int buz1 = 8; //on digital pin 8 int buz2 = 9; //digital 9
void setup() // put your setup code here, to run once: { pinMode(buz1, OUTPUT); //set pins as output pinMode(buz2, OUTPUT);
Serial.begin(9600); //initialize serial com to see values
}
void loop() { // put your main code here, to run repeatedly:
int val1 = analogRead(sen1); int val2 = analogRead(sen2);
//print what's been read by the sensors Serial.println(val1);
if(val1 < 750 && val2 < 750) { tone(buz1, 1000, 10); }
else if(val1 < 750) { tone(buz1, 2000, 100); }
else if(val2 < 750) { tone(buz1, 1500, 100); }
//Serial.println(val2);
//make sound
}

Step 5: Connect All Things Together

Picture of Connect All Things Together
Picture of Connect All Things Together
Picture of Connect All Things Together
Now, connect sensors facing at your eye, you might need to adjust that. Then Arduino and speaker on one side and the battery with 5v booster on another side of the frame. Use enough hot glue to secure the connections and secure the components on the frame.

Step 6: Last, Power and Have Fun

Picture of Last, Power and Have Fun
Picture of Last, Power and Have Fun
Now power it up and see how it works. Use the serial monitor to see the values and adjust if needed. That's it !!! Now you have a glass that can generate music.
This can also be used to count blink numbers thus how many times a user blinks or winks thus this can also be used by disabled people. Got a project Idea?? ;)
Thank you.

Comments

Popular posts from this blog

Make a Smart Phone Controlled Robotic Arm ! Arduino DIY.

Making ROBOT ARMs is very popular and fun among hobbyists, but it's not that easy to control a ROBOT ARM. So today we'll be making a robot arm that can be controlled using just your Android Smartphone or tablet. Good news is, you just need to program the Arduino, the App is already available to download for free. Step 1: Parts You'll Need 2 More Images Servo motor 4x (I'm using micro servo Sg90 but any model or size is okay) you can use upto 5 servo for this robot arm, I've only 4, so I'm using them. sliced piece of Card Board - to make the body. USB OTG (on the go) [pic3 & 4- all the same] And of course a Arduino board (any board) And a few jumpers to make the connection And a 9v battery to power the servo motors. Step 2: Making the Robot Arm (THE BODY) Now in here I'm actua

Make a Smart Humanoid Talking Robot- MOFIZA.

This Robot - Mofiza - (weird name) Can SEE , TALK and REACT to her surroundings. Before I proceed watch the video: Ever since I've seen making talking robots I saw that people actually use other development boards rather than Arduino to make talking robots. But it's completely possible to make a Humanoid robot with Arduino who can talk and add a lot of servos to make it move. So lets begin: Step 1: Parts You'll Need Arduino Pro mini (5v 16 Mhz) [any board is good but i've used this to make it small) Female header pins for connecting on pcb Male header pins Vero Board to make the circuit Sd card TF module (to make it talk) micro sd card (not more than 2GB) 3x IR proximity sensor 3x servo motor (I've used micro servo sg90) Cardboard to make the body Step 2: Connecting IR Sensor and the Body Make a

Make AI Assistant Robot with Arduino and Python

Introduction: We all are familiar with ‘Jarvis’ AI assistant robot from “Iron Man’ movies and Marvel series. It has always been a dream of programmers to make something on their own. I will today show a simple way to make such an assistant using Python programming. Moreover, I will also make a physical avatar of that robot, so that whenever we talk to the robot, it can do some movements. That will be more amazing than just a software robot. Because if it has a body, it is cool. So today we will learn to use both Arduino and Python programming to make an AI robot which can control your computer and have a little chit chat with you. Let’s hop in guys! Why I named the robot ‘Jaundice’? Because I painted it yellow, very very yellow!   Parts: Electronics - Arduino Nano – 1x Micro Servo Sg90 – 3x Ultra Sonic Sensor HCsr04 – 1x Body – PVC sheet (preferably white, better for coloring, I used blue one) Servo wheel (for the stand) Tools -  Cutter knife Scissor Hot glu

Arduino Automated Parking Garage

An Arduino Automated Car Parking System that is too easy and too fun to make. When a car arrives it shows the number of empty slots (if available) and then opens the gate. if there is not any empty slot then the gate does not open.  Amazing thing is that the whole project can just be POWERED using a POWER BANK!! Watch the video for the full tutorial. Note: you can use display instead of my hand made led sign display. Now lets get started. Step 1: Parts Arduino  - any board Infrared proximmity sensor  (pic 2 & 3 - both are functional) 330r resistor some  LED 's Servo motor  - any model or size you wish. Step 2: Making the LED Display To make this  LED display  I have used a piece of bredboard then soldered the LED's and the 330r resistor. Then just added a ribbon cable f

Problems using PIR sensor?? Always HIGH? DELAY? Solution is here.

PIR sensor When I was working on a project "controlling home appliances using just a wave of hand" I had used a PIR sensor and found some issues: PIR doesn't work properly when starts. PIR output value is always 1. It some times doesn't read motions. Now those are three Common and Unavoidable problems of a PIR sensor. So what would we do? I assume you know what a PIR sensor is and I'll just try to give a solution to the problems so that you can use PIR in your project efficiently, also I've added a code below on how to solve that problem. As I have mentioned earlier those are Common and Unavoidable,  keep 3 issues in mind: After powering - PIR sensor needs 1 minute to function For that 1 minute the OUTPUT is always HIGH. When a motion is detected it'll take 5 to 7 seconds to detect motion again. SOLUTION: After powering - PIR sensor needs 1 minute to function:  which means when you'll power a PIR sensor it wi

Control Anything Over Internet / WiFi. IOT Light Switch_ NodeMCU ESP8266 .

Parts: NodeMCU ESP8266  WiFi Development Board LED 330r resistor Android app Download the app from Below , To Upload code to NodeMCU using Arduino.ide Update Arduino.ide (desktop app) start Arduino app goto  Files > Preferences  Then  paste the link  then press  ok.    http://arduino.esp8266.com/stable/package_esp8266com_index.json goto  Tools>Boards> Board Manager  then wait untill it finds ESP8266 properties Scroll down and  click install Then Restart the Arduino App. Now you can upload Code in C / C++ to NodeMCU ESP8266 using Arduino.ide Getting IP Address Code T o get the IP Address (Internet Protocol Address) Upload this Code and open serial monitor. #include <ESP8266WiFi.h> const char* ssid="WIFI name"; const char* password = "WIFI PASSWORD"; int ledPin = 13; void setup() { pinMode(ledPin,OUTPUT); digitalWrite(ledPin,LOW); Serial.begin(115200); Serial.println(); Serial.print("Wifi co

How to use ServoTimer2 Library with Arduino- full tutorial.

Introduction I've been trying to make a humanoid robot  MOFIZA -Arduino Talking Humanoid Robot.  recently- which means dealing with Servo motors. Everything worked just as fine just before I tried to make the robot TALK. When I needed to use the TMRpcm library. But there's some libraries like #TMRpcm .h #VirtualWire .h are libraries that use the Timer1 of Arduino. It appears that you can't use two devices simultaneously where both use the same timer...So, if my robot talks- the servos don't work. Because The Servo.h and the TMRpcm both works on Arduino TImer1. Which is a mess. If you want to make both of them work you have to use another library for servos. Which is ServoTimer2 library? This uses the Timer2 on Arduino...Unfortunately on internet I haven't found any tutorials to understand how this ServoTimer2 library actually works, and how to use it in code. So, I've decided to make a tutorial so that people like me can understand better. We'll be u