Vibration motor meets the Headphone jack

687474703a2f2f692e696d6775722e636f6d2f7678716a3532472e6a70673f31

Although vibration motors are common in Mobile phones, procuring button sized vibration motors were the ultimate challenge. (There were a couple of good ones on ebay, but couldn’t find one at this point of time)

But once that was resolved, one of the leads of the vibration motor was connected to the headphone jack and the ground of the headphone jack to the other lead.

Now square wave signals are played through the headphone jack using Audacity. Although one can feel the motors vibrating, using an operational amplifier such as LM324 helps to intensify the vibrations. ( Power source to LM324 – Battery/Arduino )

drawing

 

 

Note:

One of the weirdest but yet satisfying experience with the vibration motor is when you connect the vibration motor through the audio jack without any amplifier. You can hear the music being played through the vibration motor. The motors seems to be dancing to the music being played. We tried so hard to capture the phenomenon but the sound was too feeble to be picked up. That shouldn’t stop you from giving it a shot.

The ultimate guide to using LEDs with headphone jack

drawing112

Lighting up an LED using the headphone jack is probably one of most easiest tasks. Take the mic of the TRRS pin ( or left in a TRS ) and connect it to the shorter end of the LED. Take the ground and connect it to the longer end of the led and you are good to go !

A potential difference of ~3V exists between the two pins that is sufficient to light up a LED. Why is there a potential difference in the first place ? Well, this will answered in great detail in one of our post on the Anatomy of a headphone jack.

Now no one wants to stop with just lightning up a LED, so let’s improvise..

 

Controlling LED brightness

Like we said: A potential difference of ~3V exists between the two pins that is sufficient to light up a LED.  By controlling the volume, we can reduce this potential difference and thereby dim the LED.

 

You can control 2 LEDs (min.) with a single headphone jack

With a simple headphone jack, one is capable of controlling 2 LEDs at the very minimum. Take 2 LEDs and connect them both to the Left/Right in the configuration shown below:

drawing-1

If one plays a square wave through the Left/Right then the first LED would light during the positive half of the cycle and the second one during the negative half. This is because LEDs are conductive only in one direction.

You can watch a demonstration of this in the following video.

And as a bonus, we did a frequency sweep  from 1 – 30 Hz (Square Wave) and here is how that looks:

Hang on a second!

If you can do that, then you play songs and also visually witness Beats phenomenon right? Absolutely!

Visualizing songs using LED

Beats phenomenon

Headphone jack as a switch

In all our above setups, we connected the jack directly to the LED. But one might need the LED to be brighter. So, to do that we had to bring in a operational amplifier ( LM324 ). This can be powered using a OTG (On-the-go) cable or using an Arduino.

drawing-2

Now using this we can use the headphone to perform switching operations. And this is what we demonstrate in the following series of videos:

Schematics/Circuit diagrams will be uploaded soon! Thank you.

 

 

 

LED as light sensor !!?

Sometime ago there was a post on reddit which claimed that you can use your LED as a light sensor to detect the intensity of light. We decided to try it out and oh boy! it completely changed our perspective on the LED.

We just took a LED and performed an AnalogRead on the Arduino. Check this out:

DIY: Obstacle detector with Audible feedback (IR sensor + Headphone jack + 555 timer)

We were inspired by the buzzer that you find in mobile and laptop showrooms – the ones that produce this annoying high frequency tone if you fiddle a ‘little too much’ with the displayed product.

schematic

We use a 555 timer in its Astable mode to produce the frequency tone and couple it with a digital IR sensor module. We do this by connecting the output pin and the ground parallel to R2 in the figure.

single-ir-sensor

And as a result when there are no objects in the vicinity, the system produces a high frequency tone, but when an object is introduced the sound dies out.  This is attributed to the change in resistance value.

Here is another variation of the same:

LiFi using IR sensor and headphone jack

In our previous post, we explored using the Solar panel + Led as a LiFi module. In this post, we shall be using IR sensors in order to transmit data (tones and square wave signals) wireless. The schematics of the setup are given below:

drawing

One can use this to send square wave of any frequency independently as well. This has been demonstrated in the video below

Video Demo:
Watch the video demo for a live demonstration of the working of this concept.

This is not limited to tones, one can use it to transmit raw music as well.

 

LiFi using Solar Panel and headphone jack

In this post we shall be exploring the usage of the solar panel and a headphone jack as a probable LiFi based module. We will be making use of the Arduino’s ToneMelody example to play tones on a LED. The LED will be shone on a Solar panel whose output will be relayed on to the computer with a 3.5mm headphone jack.

drawing

Video Demo:

Now, some people might be uncomfortable in using an Arduino. OK! Instead of using the Arduino one can use combine the mobile phone and headphone jack to generate the tone instead. The schematics of this is given below:

drawing-1

Video Demo:

 

 

 

Switch on and off LED in Arduino using PySerial

When one starts off learning about Arduino, the Blind LED is one of the most popular programs to begin with. As you go up the learning ladder you find asking the question of ‘Hang on! What if I want to change the blink rate dynamically ?’ How would one go about doing that ?

Or breaking it further, how to turn on and off led with my discretion

Well, off the bat the first thing I could think of is using the Serial port to send the signal to switch on and off the LED. Ardruino has a default command that can be used for this purpose:

Serial.available()

” Get the number of bytes (characters) available for reading from the serial port. This is data that’s already arrived and stored in the serial receive buffer (which holds 64 bytes). available() inherits from the Stream utility class ”

Arduino code:

char c;
int led = 13;
boolean ledLightUp = false;

void setup(){
  Serial.begin(9600);
  pinMode(led,OUTPUT);
}

void loop()
{
// When a user sends serial data then read and execute the following
   if (Serial.available() > 0)
    {
      c = Serial.read(); 
      Serial.println(c);
      if(c == 'y')
      {
        ledLightUp = true;
        Serial.println("LED ON");
      }
      else if(c == 'n')
      {
        ledLightUp = false;
        Serial.println("LED OFF");
      }
    }
  if(ledLightUp){
    digitalWrite(led,HIGH);
  }  
  else{
    digitalWrite(led,LOW);
  }
}

 

Python code:

>> import serial,struct
>> ser = serial.Serial('your port name', 9600)
>> ser.write(struct.pack('b',enter here 'y' or 'n' with paranthesis))

 

You can watch the following video I made that demonstrates the essence of this post.