Introduction: TuneGlass: Can We Make Music Using Our Eyes?

About: A Computer Science and Engineering student and a Hobbyist. love to make robots,electric devices,diy things and Programming them by Myself. My youtube channel Follow me on gi…

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

  • 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

Buy electronic components at

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

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:

* 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); }


//make sound


Step 5: 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

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.