Pages

Thursday 24 December 2015

Circuit to interface HC-05 bluetooth module to Arduino uno

Household equipment such as bulb or fan controlled using your android device is an interesting project which most hobbyists want to do. A communication should be there between the android device and household equipment through some microcontroller boards such as Arduino uno. Bluetooth is a simple method to establish a communication between android device and household equipment. Here, I am using a HC-05 bluetooth module to communicate with android device. HC-05 is connected to Arduino uno to receive the data sent from android device. Depending on the data received from android device, we can use this Arduino uno to control our household equipment.
Connections are done as shown in the following diagram. Connections can be summarized as,
  1. 5V pin of Arduino uno is connected to the VCC terminal of HC-05 bluetooth module.
  2. Gnd pin of Arduino uno is connected to the Gnd terminal of HC-05 bluetooth module.
  3. RX pin of Arduino uno is connected to the TX terminal of HC-05 bluetooth module.
  4. TX pin of Arduino uno is connected to the RX terminal of HC-05 bluetooth module.

After completing the circuit, upload the following program to your Arduino board. Disconnect RX and TX pins connected to Arduino uno for successful uploading. Otherwise, uploading will be failed. After successful uploading, reconnect the RX and TX pins.

char junk;
String inputString="";

void setup()
{
  while (!Serial);
  Serial.begin(9600);
}

void loop()
{
  if(Serial.available())
  {
    while(Serial.available())
    {
      char inChar = (char)Serial.read(); //read the input
      inputString += inChar;             //make a string of the characters coming on serial
    }
    Serial.println(inputString);
    while (Serial.available() > 0)  
    { 
      junk = Serial.read() ; 
    } 
    inputString = "";
  }
}

Now, open the serial monitor from Arduino IDE. Nothing will be displayed in the serial monitor. Still, you must keep the serial monitor open until the remaining steps also get completed.

Next steps will be in your android device. Install Bluetooth Terminal application in your android device from Google Play Store.

After installing, open Bluetooth Terminal application and connect your android device to bluetooth device HC-05.
Select your bluetooth device from a list of available devices.
If connection goes successful, your Bluetooth Terminal will be as shown below.
Now, type letters in the text box and send.
Letters sent from your android device will be displayed in the serial monitor of Arduino.

Wednesday 16 December 2015

Programming ATtiny44 / ATtiny84 using Arduino uno

We had already seen the circuit for programming ATtiny45 / ATtiny85 using Arduino uno in my previous post. ATtiny45 / ATtiny85 has fewer number of analog and digital pins. So, for bigger applications, we have to go for microcontrollers having more analog and digital pins. ATtiny44 / ATtiny84 is an example of such kind of microcontrollers. Here, we will see a method for programming ATtiny44 / ATtiny84 using Arduino uno.

Circuit is done as shown in the following diagram. An LED should be connected to the 13th pin of ATtiny44 / ATtiny84 to test the program.

Step 1 :

Disconnect the capacitor from the circuit (Capacitor connected between RESET and GND pin of Arduino uno).
Select Arduino Uno board from Tools menu.















Upload the ArduinoISP sketch to your Arduino uno.

Step 2 :

After uploading the ArduinoISP, connect the capacitor in the circuit (Capacitor connected between RESET and GND pin of Arduino uno). Then, open Blink program from your sample programs.

Change the digital pin number from 13 to 0.

Select ATtiny board from Tools menu.

When ATtiny board is selected, a Processor sub-menu will appear under Tools menu. Select your processor from Processor sub-menu. My processor is ATtiny44.

Upload the modified Blink program to your ATtiny44 / ATtiny84. If uploading is successful, LED connected to ATtiny44 / ATtiny84 will start blinking.

Monday 7 December 2015

Split video screen to play two videos together using Kdenlive in ubuntu 14.04

In certain situations, we will have to split our video screen to play two videos together side by side. Many software are there to make such videos. Here, we will see the video demonstration of splitting our video screen using kdenlive video editor in ubuntu 14.04.

Sunday 6 December 2015

Interface 16 switches to arduino uno using only 5 digital pins (HEF4067BP)

Under certain situations, we will have to interface many switches to our arduino uno. Simplest method to interface switches to arduino uno is to connect the switch directly to any one of the digital pin or analog pin of arduino uno. But, if we have to interface many switches to arduino uno, previous mentioned method is not advisable because, only 14 digital pins and 6 analog pins are available in arduino uno. If we connect switches to all these pins, we could not use this arduino uno board for any other purposes. Then, we have to go for some other methods which use minimum pins of arduino to interface maximum number of switches.

Circuit given below shows a simple method to interface 16 switches to arduino uno using only 5 digital pins. A HEF4067BP multiplexer/demultiplexer IC should be connected in between switches and arduino uno as shown in the diagram.

After completing the circuit, upload the following program to your arduino board.

int val = 0;         // variable to store the read value

int A_zero = 8;       
int A_one = 9;
int A_two = 10;
int A_three = 11;

int z = 12;

void setup()
{
  
  pinMode(z, INPUT);      // sets the digital pin "z" as input

  pinMode(A_zero, OUTPUT);      // sets the digital pin "A_zero" as output
  pinMode(A_one, OUTPUT);       // sets the digital pin "A_one" as output
  pinMode(A_two, OUTPUT);       // sets the digital pin "A_two" as output
  pinMode(A_three, OUTPUT);     // sets the digital pin "A_three" as output
  
  Serial.begin(9600);

}

void loop()
{
  // Select address 0000  
  digitalWrite(A_zero, LOW);    
  digitalWrite(A_one, LOW);     
  digitalWrite(A_two, LOW);     
  digitalWrite(A_three, LOW);   
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 1");  
    delay(50);
  }

  // Select address 0001  
  digitalWrite(A_zero, HIGH);   
  digitalWrite(A_one, LOW);     
  digitalWrite(A_two, LOW);     
  digitalWrite(A_three, LOW);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 2");  
    delay(50);
  }

  // Select address 0010  
  digitalWrite(A_zero, LOW);   
  digitalWrite(A_one, HIGH);     
  digitalWrite(A_two, LOW);     
  digitalWrite(A_three, LOW);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 3");
    delay(50);  
  }

  // Select address 0011  
  digitalWrite(A_zero, HIGH);   
  digitalWrite(A_one, HIGH);     
  digitalWrite(A_two, LOW);     
  digitalWrite(A_three, LOW);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 4");
    delay(50);  
  }

  // Select address 0100  
  digitalWrite(A_zero, LOW);   
  digitalWrite(A_one, LOW);     
  digitalWrite(A_two, HIGH);     
  digitalWrite(A_three, LOW);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 5");
    delay(50);  
  }  

  // Select address 0101  
  digitalWrite(A_zero, HIGH);   
  digitalWrite(A_one, LOW);     
  digitalWrite(A_two, HIGH);     
  digitalWrite(A_three, LOW);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 6");
    delay(50);  
  }  

  // Select address 0110  
  digitalWrite(A_zero, LOW);   
  digitalWrite(A_one, HIGH);     
  digitalWrite(A_two, HIGH);     
  digitalWrite(A_three, LOW);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 7");
    delay(50);  
  }  

  // Select address 0111  
  digitalWrite(A_zero, HIGH);   
  digitalWrite(A_one, HIGH);     
  digitalWrite(A_two, HIGH);     
  digitalWrite(A_three, LOW);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 8");
    delay(50);  
  }  

  // Select address 1000  
  digitalWrite(A_zero, LOW);   
  digitalWrite(A_one, LOW);     
  digitalWrite(A_two, LOW);     
  digitalWrite(A_three, HIGH);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 9");
    delay(50);  
  }  

  // Select address 1001  
  digitalWrite(A_zero, HIGH);   
  digitalWrite(A_one, LOW);     
  digitalWrite(A_two, LOW);     
  digitalWrite(A_three, HIGH);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 10");
    delay(50);  
  }

  // Select address 1010  
  digitalWrite(A_zero, LOW);   
  digitalWrite(A_one, HIGH);     
  digitalWrite(A_two, LOW);     
  digitalWrite(A_three, HIGH);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 11");
    delay(50);  
  }

  // Select address 1011  
  digitalWrite(A_zero, HIGH);   
  digitalWrite(A_one, HIGH);     
  digitalWrite(A_two, LOW);     
  digitalWrite(A_three, HIGH);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 12");
    delay(50);  
  }

  // Select address 1100  
  digitalWrite(A_zero, LOW);   
  digitalWrite(A_one, LOW);     
  digitalWrite(A_two, HIGH);     
  digitalWrite(A_three, HIGH);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 13");
    delay(50);  
  }

  // Select address 1101  
  digitalWrite(A_zero, HIGH);   
  digitalWrite(A_one, LOW);     
  digitalWrite(A_two, HIGH);     
  digitalWrite(A_three, HIGH);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 14");
    delay(50);  
  }

  // Select address 1110  
  digitalWrite(A_zero, LOW);   
  digitalWrite(A_one, HIGH);     
  digitalWrite(A_two, HIGH);     
  digitalWrite(A_three, HIGH);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 15");
    delay(50);  
  }

  // Select address 1111  
  digitalWrite(A_zero, HIGH);   
  digitalWrite(A_one, HIGH);     
  digitalWrite(A_two, HIGH);     
  digitalWrite(A_three, HIGH);  
  if(digitalRead(z)==1)
  {         
    Serial.println("Switch pressed is 16");
    delay(50);  
  }
}
If uploading is successful, open your serial monitor. Serial monitor will print the number of the switch pressed as shown in the following image.
Watch the video demonstration here.

Wednesday 18 November 2015

Circuit to control a buzzer using arduino uno

Buzzers are commonly used to produce beep sounds when some keys are pressed. Beep sound will help us to confirm the key press easily. Many ways are there to connect buzzers in a circuit. A simple circuit to connect a small buzzer to arduino uno is shown below.
After completing the circuit, upload the following program to your arduino board. If uploading is successful, beep sound will be heard from the buzzer in one second delay.
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the buzzer on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the buzzer off by making the voltage LOW
  delay(1000);              // wait for a second
}

Friday 31 July 2015

Temperature on seven segment display using LM35 and arduino uno

We had already seen the circuit to measure the temperature using LM35 and arduino in one of my previous blog. Here, we will see the video demonstration of working of LM35 using arduino uno. Temperature measured will be displayed in a 5 digit seven segment display. Here, we are bringing a hot soldering iron near LM35 to increase the temperature around LM35.
Watch the video demonstration here.

Monday 27 July 2015

Simple LDR Circuit Designed using ULN2803

We all are familiar with light dependent resistor (LDR) which is widely used in many applications like cars, street lights etc. Many ways are there by which we can interface light dependent resistors. Here, we will see a simple circuit for interfacing light dependent resistors using ULN2803 chip. ULN2803 is a high voltage / high current darlington driver comprised of eight NPN darlington pairs.


Video demonstration of working of a light dependent resistor using ULN2803 is given below.
By making proper changes in circuit, we can reverse the working of circuit.

Wednesday 15 July 2015

Easy Way to Make Slow Motion Videos using Kdenlive 0.9.6 in Ubuntu 14.04

Slow motion frames sometimes increase the beauty of your videos. Many software are there which helps us to make slow motion videos. I am an ubuntu user and searched for a suitable software to make slow motion videos. After a few searching, I got a method to make slow motion videos easily using kdenlive software in ubuntu. Watch the following video to make slow motion videos using kdenlive.

Sunday 12 July 2015

Step by step procedures for making a simple music system using BT66T / UM66

We had already seen the circuit for making 'Jingle Bell' music using BT66T / UM66 in one of my previous blog. But, some of the beginners in electronic circuits may get confused a bit while doing the circuit. Here, we will see the step by step explanation of the procedures for making a simple music system using BT66T / UM66. Circuit require six simple components. They are
  • a 10 K resistor
  • a Press button switch
  • a speaker (I am using a 4 Ohm, 3 Watts speaker)
  • a BT66T  -  Music IC
  • a 2SC9013  - Transistor
Circuit is done on a breadboard. Watch the following video demonstration to get the steps for completing the circuit.

Saturday 11 July 2015

'Jingle Bells' music generated using BT66T / UM66

BT66T is a simple IC which can be used to generate different melody musics. They are manufactured in different modes. Each mode is specific for a particular melody. One I purchased is specific for 'jingle bells'. Circuit for BT66T is simple and is done in my previous blog. Here, we will see the video demonstration of the same.

Police siren, ambulance siren, fire engine siren and machine gun sound using UM3561

Siren generation is an interesting task for electronic beginners. Sirens are very important in our daily life for giving signals and warnings. Many ICs are available in markets to make our favorite sirens. A simple IC which helps us to make four sirens is UM3561. By using two select inputs, we can generate four sirens. They are police siren, ambulance siren, fire engine siren and machine gun sound. We had already seen the circuit to generate sirens using UM3561 in my previous blog. Here, we will see the video demonstration of the same.

Monday 6 July 2015

Block Diagram to Control Devices from Remote area through Mobile Phone

We had seen devices which are controlled using mobile phone from a remote area. Remote area means, from anywhere in the world. It will be interesting, if you can control your lamp or fan from another place or country by pressing different keys on mobile phone. Here, we will see the block diagram and video demonstration of a simple circuit which can be used to control your household devices from a remote area. Block Diagram of system is given below.
  • Take two mobile phones and connect one phone (receiver phone) to "key identification and controlling circuit" through an audio jack.
  • Take second mobile phone (controller phone) and call to the receiver phone.
  • When the receiver phone rings, accept call.
  • Now, call will be in progress between controller and receiver mobile phones. Take the keypad in controller mobile phone and press numbers. Number pressed in the controller phone will be read by the "key identification and controlling circuit". Controlling device can be controlled as per your wish using "key identification and controlling circuit" based on the number read from controller phone. "Key identification and controlling circuit" is given in my next blog.

Watch the video demonstration here.


Monday 29 June 2015

How to Add Clips to Kdenlive for Editing ?

It is a powerful open source video editor which includes many most modern video technologies. Adding videos and audios to Kdenlive for editing is a simple task.

Click on the icon encircled in the following image. Then a window will appear where you can select the videos and audios in single or multiple.
Selected files will appear on the white part just below the "Add clip" icon as shown in the following image. Drag these videos and audios to the project tree for editing.

Monday 2 February 2015

Three Ways of Connecting Potentiometer in Circuits with Circuit Diagram

          Connecting potentiometers in circuit is always a confusing task to many electronic beginners. Potentiometers are unavoidable in circuits such as audio controls where adjustment of resistance is needed. Potentiometers can be connected in three ways in a circuit. One is to get maximum resistance and the others are to get a variable resistance from zero to maximum.

          Circuit to get variable resistance from zero to maximum value is given below. In this circuit, connections are taken across the middle terminal and one end terminal of the potentiometer. When the sliding contact is rotated in one direction, resistance will increase from zero to maximum.
          Another circuit to get variable resistance from zero to maximum value is given below. In this circuit, connections are taken across the middle terminal and end terminal opposite to the end terminal connected in the above circuit. When the sliding contact is rotated in the opposite direction, resistance will increase from zero to maximum. This change in resistance will change the brightness of LED.
          Next is the circuit to get maximum resistance across the potentiometer. If connections are taken across the end terminals of potentiometer, circuit will have maximum resistance.

How to Flip (Mirror Image) an Image using GIMP in Ubuntu ?

          Flipping or creating mirror images are important under certain situations. Many software are there which will help us to flip images horizontally or vertically. GIMP in Linux also provides a user friendly approach for flipping images. Follow the simple instructions given below to flip your images vertically or horizontally using GIMP.

1. Open your image in GIMP.
2. Select the layer to be flipped using Page Down or Page Up keys.
3. Now go to Layer => Transform => Flip Horizontally to flip your image horizontally. Similarly, go to Layer => Transform => Flip Vertically to flip your image Vertically as shown in the following images.

Original Image
Vertically Flipped Image
Horizontally Flipped Image

How to Turn On an LED Using Battery?

          I have found many electronics beginners connecting LED directly to battery. They are not aware about the aftereffects of connecting LED to voltage source directly. LED get damaged if LED is directly connected to voltage source because of the high current that flows through the LED. Since the resistance of LED is very low, a large current will flow through the LED which will permanently damage the LED. To avoid this problem, we are using a current limiting resistor in series to the LED. Value of the current limiting depends on the type of LED. Normally resistors of 1K is connected as current limiting resistors. Circuit is done as shown in the following diagram.

Friday 30 January 2015

Bought One New "Breadboard Power Supply", Amazing by it's Design and Features

          Power supply is always a big issue in many electronic circuits. For the proper working of circuit and to get the expected result, a steady and ripple less DC power supply is essential. I had been searching for a good DC breadboard power supply since the last few months and I got one from rhydoLABZ. I am satisfied in this product because of it's many awesome features. One of the important feature is it's construction. Board can be easily fixed to breadboard as shown in the following image. Another important feature is the facility to power it from computer as well as from external voltage source.

More features of the product is given below.

     Locking ON / OFF Switch
     LED Power Indicator
     Input Voltage: 6.5 V to 12 V (DC) or USB Power Supply
     Output Voltage : 3.3 V / 5 V
     Maximum Output Current: 700 mA
     Power Rails 0 V, 3.3 V, 5 V on Breadboard
     Size: 5.3 cm × 3.5 cm
     Two Groups of Header Pins

          Some more images of the product is given below. For more images, details and to purchase the product online, visit rhydoLABZ.

How to Take the Screenshot of a Video Frame from "Videos" Software in Ubuntu?

          While playing certain videos, we will have a desire to take screenshot of certain frames in that video for further investigations. Even if the keyboard have a direct shortcut to take the screenshot easily, that screenshot will have some unwanted parts that we have to eliminate using another image editing software.  Here, we will see the method of taking a screenshot of a video directly from "Videos" software in Ubuntu. Screenshot taken in that way will not have any unwanted parts. To take the screenshot,

Go to Edit => Take Screenshot in the menu bar.



Screenshot will be saved to your Pictures folder.

Thursday 29 January 2015

Amazing Robotic Car with Steering, Controlled by Arduino Mega and L293D

          Yesterday, I got an idea to design a simple robotic car that can be controlled used arduino. Designing robots using arduino is simple and requires less wiring. Extra things needed to control a robotic vehicle is a motor driver. Motor driver used here is L293D. Each L293D can control the direction of rotation of two DC motors. Here, my robotic vehicle has two DC motors. One motor is for the movement of car and the other is for steering. Some images of my robotic vehicle is given below.







          I have uploaded the video of my robotic car to YouTube. Video of controlling my robotic car using arduino mega is given below.