Friday, September 23, 2016

Arduino Controller using Bluetooth Chatting

Arduino Controller using Bluetooth Chatting



Networking is the one of the most important mean of communication used to communicate with people who are connected to one. Most of the available network communication modules in the market are not affordable by the overall end users. Considering this problem, a prototype has been developed, which can be used as networking module. It is made up of cheap and easily available standard modules.
Working of the system
The overall communication system uses the I2C protocol to send or receive data. Consider the two devices between which the data transfer is going to take place. One of these will connected as master and the other as slave. The master device is going to connect with the slave devices and control communication between them.
Modules Used
The Bluetooth Module (HC-05) has been used as the communication medium for building the basic prototype. Two such devices are required, since this would be a two way communication in master-slave mode.
For controlling the data transmission in the prototype, an Arduino microcontroller board has been used.
About the Modules
Arduino
Arduino is open source hardware and software which is used to create the prototype of the idea what is in your mind. The software for the machine is given by the same developer of the hardware.

 Bluetooth Module (HC-05)

Bluetooth (HC-05) is a Interactive way for the communication wirelessly around the distance of 9m (30ft)Approx. It is capable to send the discrete data with the Synchronized baud rates.
But now most of the Bluetooth devices (HC-05) which are now available at very cheap cost and low power consumption. And most importantly it is available with the Arduino compatible version.
There are lots of configured types of BT Modules are available in the home market. 
Which can varies in configuration according to it’s version

Wiring Diagram

We have to configure the HC-05 module to meet the requirement. For the configuration AT commands for the HC-05 module is used. The wiring and the AT Commands are detailed. Using this AT commands described the configuration of this BT is changed.



















Slave Role

To configure the HC-05 as the slave role. Do the AT commands after entering your BT into the AT commands.

After done this. Remember the address of your slave device.

Time for Master

It’s time to configure the master devices. After following the below steps.


Use AT+LINK <address of the slave> to interconnect the master and the slave device.

After config. Circuit reconnect

After configuring your BT module reconnect the circuit as show.

Programming

The important tool to control the Hardware is the software. We have to do the software programming to finish the job.
#include <SoftwareSerial.h>//Serial communication header
SoftwareSerial a(6, 7); // RX | TX
void setup()
{
  Serial.begin(9600);//begin serial monitor with 9600 baud
  Serial.println("Type message");
  a.begin(38400);  // HC-05 default baud
}
void loop()
{
  if (a.available())
    Serial.write(a.read());//reads data from BT
  if (Serial.available())
    a.write(Serial.read());//reads data from serial monitor
}

Arduino Controller using Bluetooth Chatting

Arduino Controller using Bluetooth Chatting



Networking is the one of the most important mean of communication used to communicate with people who are connected to one. Most of the available network communication modules in the market are not affordable by the overall end users. Considering this problem, a prototype has been developed, which can be used as networking module. It is made up of cheap and easily available standard modules.
Working of the system
The overall communication system uses the I2C protocol to send or receive data. Consider the two devices between which the data transfer is going to take place. One of these will connected as master and the other as slave. The master device is going to connect with the slave devices and control communication between them.
Modules Used
The Bluetooth Module (HC-05) has been used as the communication medium for building the basic prototype. Two such devices are required, since this would be a two way communication in master-slave mode.
For controlling the data transmission in the prototype, an Arduino microcontroller board has been used.
About the Modules
Arduino
Arduino is open source hardware and software which is used to create the prototype of the idea what is in your mind. The software for the machine is given by the same developer of the hardware.

 Bluetooth Module (HC-05)

Bluetooth (HC-05) is a Interactive way for the communication wirelessly around the distance of 9m (30ft)Approx. It is capable to send the discrete data with the Synchronized baud rates.
But now most of the Bluetooth devices (HC-05) which are now available at very cheap cost and low power consumption. And most importantly it is available with the Arduino compatible version.
There are lots of configured types of BT Modules are available in the home market. 
Which can varies in configuration according to it’s version

Wiring Diagram

We have to configure the HC-05 module to meet the requirement. For the configuration AT commands for the HC-05 module is used. The wiring and the AT Commands are detailed. Using this AT commands described the configuration of this BT is changed.



















Slave Role

To configure the HC-05 as the slave role. Do the AT commands after entering your BT into the AT commands.

After done this. Remember the address of your slave device.

Time for Master

It’s time to configure the master devices. After following the below steps.


Use AT+LINK <address of the slave> to interconnect the master and the slave device.

After config. Circuit reconnect

After configuring your BT module reconnect the circuit as show.

Programming

The important tool to control the Hardware is the software. We have to do the software programming to finish the job.
#include <SoftwareSerial.h>//Serial communication header
SoftwareSerial a(6, 7); // RX | TX
void setup()
{
  Serial.begin(9600);//begin serial monitor with 9600 baud
  Serial.println("Type message");
  a.begin(38400);  // HC-05 default baud
}
void loop()
{
  if (a.available())
    Serial.write(a.read());//reads data from BT
  if (Serial.available())
    a.write(Serial.read());//reads data from serial monitor
}

Arduino Controller using Bluetooth Chatting

Arduino Controller using Bluetooth Chatting



Networking is the one of the most important mean of communication used to communicate with people who are connected to one. Most of the available network communication modules in the market are not affordable by the overall end users. Considering this problem, a prototype has been developed, which can be used as networking module. It is made up of cheap and easily available standard modules.
Working of the system
The overall communication system uses the I2C protocol to send or receive data. Consider the two devices between which the data transfer is going to take place. One of these will connected as master and the other as slave. The master device is going to connect with the slave devices and control communication between them.
Modules Used
The Bluetooth Module (HC-05) has been used as the communication medium for building the basic prototype. Two such devices are required, since this would be a two way communication in master-slave mode.
For controlling the data transmission in the prototype, an Arduino microcontroller board has been used.
About the Modules
Arduino
Arduino is open source hardware and software which is used to create the prototype of the idea what is in your mind. The software for the machine is given by the same developer of the hardware.

 Bluetooth Module (HC-05)

Bluetooth (HC-05) is a Interactive way for the communication wirelessly around the distance of 9m (30ft)Approx. It is capable to send the discrete data with the Synchronized baud rates.
But now most of the Bluetooth devices (HC-05) which are now available at very cheap cost and low power consumption. And most importantly it is available with the Arduino compatible version.
There are lots of configured types of BT Modules are available in the home market. 
Which can varies in configuration according to it’s version

Wiring Diagram

We have to configure the HC-05 module to meet the requirement. For the configuration AT commands for the HC-05 module is used. The wiring and the AT Commands are detailed. Using this AT commands described the configuration of this BT is changed.



















Slave Role

To configure the HC-05 as the slave role. Do the AT commands after entering your BT into the AT commands.

After done this. Remember the address of your slave device.

Time for Master

It’s time to configure the master devices. After following the below steps.


Use AT+LINK <address of the slave> to interconnect the master and the slave device.

After config. Circuit reconnect

After configuring your BT module reconnect the circuit as show.

Programming

The important tool to control the Hardware is the software. We have to do the software programming to finish the job.
#include <SoftwareSerial.h>//Serial communication header
SoftwareSerial a(6, 7); // RX | TX
void setup()
{
  Serial.begin(9600);//begin serial monitor with 9600 baud
  Serial.println("Type message");
  a.begin(38400);  // HC-05 default baud
}
void loop()
{
  if (a.available())
    Serial.write(a.read());//reads data from BT
  if (Serial.available())
    a.write(Serial.read());//reads data from serial monitor
}

Wednesday, September 21, 2016

DIMMING LCD BACKLIGHT

DIMMING LCD BACKLIGHT


Presented here is an LCD power-saving backlight-control circuit. An LCD is used in many projects for indication or information display since it consumes less power and, hence, saves energy. But power consumption in an LCD backlight draws a lot of attention.





Pin diagram of a 16×2 alphanumeric LCD is shown in Fig. 1. Pins 15 and 16 are internally connected to the backlight LED. Normally, backlight LED+ is connected to +5V supply via a current-limiting resistor (it is not included in the circuit here for simplicity). But this LED stays on, all the time. So if you want to dim it, you need a solution so that during day time, or when ambient light is enough to make the LCD characters visible, the backlight gets dimmed and energy can be saved. For this, we have two options: one is microcontroller (MCU) based and the other is discrete-component based.
Circuit using an LCD is generally driven by an MCU. If the MCU has capture-compare pulse (CCP) width modulation module, our task becomes very easy. One such solution using a transistor is shown in Fig. 2. Here, CCP pin needs to be connected to the base resistor so that the LED can be dimmed. Then, we can use a light-dependent resistor (LDR) to sense the ambient light and command the MCU to dim the backlight accordingly.
If CCP pin is busy, or the MCU does not have a CCP pin, then an alternative circuit shown in Fig. 3 will ensure that the backlight is dimmed accordingly.
Circuit for dimming LCD backlight using NE555 is shown in Fig. 3. This NE555 based astable multi-vibrator generates output pulse frequency of 4.8kHz.


Note that control pin 5 is not grounded through a capacitor in the usual way, but is connected to a voltage-divider network formed by resistor R5 and VR1. This configuration makes it work as a pulse width modulator, which changes the width of output pulse at pin 3 based on the voltage at pin 5.

Potmeter VR1 can be replaced with an LDR so that the LCD automatically gets dimmed during day time. At night, or when ambient light is less, backlight intensity (current) increases. Since LDR resistance changes as per ambient light, voltage at pin 5 of NE555 also varies accordingly. This variation in voltage at pin 5 changes the duty cycle of the output waveform, giving higher duty cycle when ambient light is not present, and vice versa. In this way it can be used to dim the LCD backlight for power saving.


GSM Based messaging Using Arduino


GSM BASED MESSAGING USING ARDUINO

Today, GSM networks are widely-used, whether for making calls or sending SMSes. But some places need urgent messages like in colleges, railway stations, events, share market and so on, and this information should be in real-time. This project is an experiment to give a start to the era of sending messages in real-time. It is about writing the message, which is to be displayed on mobiles, and sending it as an SMS to the receivers. The received message is fetched into a microcontroller (MCU) and, after authentication, is displayed on an LCD screen.

CIRCUIT AND WORKING
Circuit shown in Fig. 1 operates using a 12V power supply (connected across CON1). An Arduino MCU requires only 5V but a GSM modem requires 12V. As Arduino Uno has an inbuilt 5V voltage regulator, a common 12V supply can be used for the whole system.
The brain of the circuit is Arduino Uno MCU board (BOARD1). A 16×2 LCD display (LCD1) is used for receiving and displaying the messages. Pins of LCD1, namely, RS, EN, D4, D5, D6 and D7 are connected to Arduino digital pins 12, 11, 5, 4, 3 and 2. When you want to show some information or message, you send an SMS to the GSM modem. Then, Arduino’s MCU reads the GSM modem and sends it to the LCD. Here, the LCD is used in 4-bit mode, which means only four data lines are required to display the data.

GSM modem SIM900A (connected with CON2 and CON3) sends the commands in text mode to Arduino Uno using an RS232 interface. CON3 is connected with DB9 connector of the GSM modem. RS232 voltage levels are at ±12V, whereas both MCU input and output operate at 0V to +5V. Since RS232 is not compatible with the MCU, MAX232 (IC1) is utilised to enable the communication between the GSM modem and Arduino Uno by converting RS232-level signals to TTL-level signals. Rx (DB9.3) and Tx (DB9.2) pins of the GSM modem are connected through IC1 at Tx and Rx pins of Arduino, respectively.

SOFTWARE
The code written in Arduino can communicate with the GSM modem using AT commands. AT commands are sent or received from the modem using serial communication functions provided by Arduino library.
Serial.begin(9600) function helps to initialise the serial port with a baud rate of 9600.
Serial.available() function is always called before reading a data byte from the serial port of Arduino. This function returns a positive value when the data byte reception is complete; otherwise, it returns a non-positive value. It serves the purpose of waiting till the data byte reception is complete, so that there are no errors in reading the data byte.
Serial.read() function reads a data byte from the serial port of Arduino. It can return the data byte, which can then be stored in a variable or used for some condition check.
GSM modem responds OK when it receives command AT.
This is the best way to check communication between the modem and the MCU.
+CMGF command is used to set the SMS mode. Either text or PDU mode can be selected by assigning 1 or 0 in the command.
+CNMI AT command is used to specify how newly-arrived SMSes should be handled. It can be used to set the GSM/GPRS modem or mobile phone either to route the received SMS messages directly to the serial port or to save these in message storage and then notify the host device by sending a string through the serial port.
For example, to route the received message string to the serial port of the device, the code written for this project uses AT+CNMI=2,2,0,0,0 command.

Once an SMS is received, the GSM modem sends a long string to Arduino board, which consists of many details regarding the message including the original text. The code is written in such a way that it waits till any character is received through the serial port. Once it starts receiving, it checks for the occurrence of sixth ‘ “ ’ and writes the rest of the characters directly into the 16×2 LCD. Characters after the sixth ‘ “ ’ in the received string is the original text.
 CODE

#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12,11,5,4,3,2);//RS,EN,D4,D5,D6,D7

// give the pin a name:
int led = 9;
// incoming serial byte
int inByte = 0;        
int i = 0;        

void setup()
{
  pinMode(9, OUTPUT);    
  lcd.begin(16, 2);
  lcd.print("EG TECHNOLOGIES");
  //lcd.setCursor(0, 1);
  //lcd.print("www.egtechprojects.com ");
  delay(1000);
 
  // initialize the led pin as an output.
  pinMode(led, OUTPUT); 
  // start serial port at 9600 bps
  Serial.begin(9600);
  // wait for a while till the serial port is ready
  delay(100);

// send the initial data once //   
  Serial.print("AT+CMGF=1\n\r");
  delay(500);
  Serial.print("AT+CNMI=2,2,0,0,0\n\r");
  delay(2000);
 
  digitalWrite(led, HIGH);      
}

void loop()
{
    do
    {
        while ( !Serial.available() );   
    } while ( '"' != Serial.read() );
 
    do
    {
        while ( !Serial.available() );   
    } while ( '"' != Serial.read() );
 
    do
    {
        while ( !Serial.available() );   
    } while ( '"' != Serial.read() );
   
    do
    {
        while ( !Serial.available() );   
    } while ( '"' != Serial.read() );
    do
    {
        while ( !Serial.available() );   
    } while ( '"' != Serial.read() );
   
    do
    {
        while ( !Serial.available() );   
    } while ( '"' != Serial.read() );
   
   
    while ( !Serial.available() );
    inByte = Serial.read();    
    while ( !Serial.available() );
    inByte = Serial.read();
   
    lcd.clear();
    while(1)
    {
        while ( !Serial.available() );
        inByte = Serial.read();
        i++;
        if ( inByte == '\r' )
          break;
        else;
        lcd.write ( inByte );
        Serial.write( inByte );
        if (i==15)
        {
        lcd.setCursor(0,1);  
        i=0;
        }
        
    }

 }

CONSTRUCTION AND TESTING

An actual-size, single-side PCB pattern of the wireless notice board is shown in Fig. 2 and its component layout in Fig. 3. For convenience, we have designed the PCB as an Arduino shield. You can modify the design as per requirement. Also, you can test PCB with Arduino board using a cable connector.
Download the program in Arduino. Connect CON2 and CON3 with the GSM modem power and DB9 connector, respectively. Insert a SIM card in the GSM modem SIM slot. Power on the PCB using 12V supply to CON1. Send the SMS to the inserted SIM card number. LCD1 as well as Arduino serial port will display the message.




Subscribe to EG Technologies


Social media links