Tag Archives: interfacing

Touch Screen interfacing with Arduino

Resistive touch screen displays are composed of multiple layers that are separated by thin spaces. Pressure applied to the surface of the display by a finger or stylus causes the layers to touch, which completes electrical circuits and tells the device where the user is touching.

In this chapter we are focusing only on 4-wire resistive touch screen interfacing. Continue reading Touch Screen interfacing with Arduino

Three Wire LCD Interface with Arduino

We have seen parallel interface technique using Arduino library and we know that it requires 6 IO Lines, Now let’s see how we can reduce required IO’s using 74HC595. We know that we can reduce number IO required by using I2C based LCD interface circuit; It costs ten times more than 74HC595 Circuit.

Arduino 3 wire LCD interface circuit

            In this circuit similar to the bargraph display we are using 74HC595 Shift register to interface 16×2 LCD. Continue reading Three Wire LCD Interface with Arduino

RGB LED Interfacing with Arduino

In some cases you need to display a static text with different colors, for this purpose you can use RGB LED Strips. In this tutorial we will learn how to interface RGB LED strip with arduino and drive it using ULN2003.

rgb-led-strip

This is a basic tutorial for using Common Anode RGB LED Strip, PWM, and switch. By the end, you will have single switch to control colors of the LED strip. Connect the LED’s anode lead to +12V and connect the 3 RGB cathode leads to digital pins 9, 10, 11 through ULN2003 respectively.

RGB LED Strip Pin out
RGB LED Strip Pin out

RGB LED Strip Connections with Arduino

To drive complete RGB LED Strip we have used ULN2003 as a driver circuit, LED strip works at 12V. You can combine ULN2003 driver outputs to get more current.

RGB LED Arduino Interfacing Circuit
RGB LED Arduino Interfacing Circuit

Arduino Code for RGB LED Color Control

//=========================================================================
//         RGB LED Color Control
//         circuits4you.com
//=========================================================================
// constants won't change. They're used here to 
// set pin numbers:
const int buttonPin = 7;     // the number of the pushbutton pin
const int BLUEledPin =  11;      // LED pin
const int REDledPin =  10;      // LED pin
const int GREENledPin =  9;      // LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status
int color=0;
//=========================================================================
//              SETUP
//=========================================================================
void setup() {
  // initialize the LED pin as an output:
  pinMode(BLUEledPin, OUTPUT);  
  pinMode(REDledPin, OUTPUT);
  pinMode(GREENledPin, OUTPUT);
  
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);     
  digitalWrite(buttonPin, HIGH); //Activate internal pull up for switch
}
//=========================================================================
//                         LOOP
//=========================================================================
void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == LOW) {     
    delay(300);
    color++;
    if(color>10)
    {color=0;}
  } 
  
  //Set different color values refer HTML Color codes
  switch (color)
  {
    case 0:
      SetColor(255,0,0);
    break;
    case 1:
      SetColor(255,255,0);
    break;
    case 2:
      SetColor(0,0,255);
    break;
    case 3:
      SetColor(128,128,20);
    break;
    case 4:
      SetColor(0,255,255);
    break;
    case 5:
      SetColor(55,100,100);
    break;
    case 6:
      SetColor(0x00,0xA8,0xA9);
    break;
    case 7:
      SetColor(0xCC,0x66,0x66);
    break;
    case 8:
      SetColor(0x12,0xA2,0x7E);
    break;
    case 9:
      SetColor(0xF0,0x80,0x32);
    break;    
    case 10:
      SetColor(0x30,0xFF,0xFF);
    break;    
  }
}
//=========================================================================
//                   Write Color Value
//=========================================================================
void SetColor(char R,char G,char B)
{
  analogWrite(REDledPin,R);
  analogWrite(GREENledPin,G);
  analogWrite(BLUEledPin,B);  
}

Results

Press switch and see that we have around ten different colors; You can change the color using SetColor(R,G,B). try different values of RGB.

GSM Modem Interfacing With Arduino

In this tutorial we will learn how to interface GSM Modem and send SMS. GSM Modems are easy long range interface where we need to read sensor data or control electrical equipment. We will start with selection of GSM modem, AT commands and connection of GSM Module with Arduino. A GSM modem is a specialized type of modem or phone hardware on small PCB which accepts a SIM card, and operates over a subscription to a mobile operator, just like a mobile phone. Continue reading GSM Modem Interfacing With Arduino

Matrix Keypad Interfacing with Arduino

The keyboard matrix is the arrangement of circuit connections between the keyboard controller and all the keys on the keyboard. Each key does not have its own dedicated circuit; instead, each key is placed at the intersection of a matrix row and a matrix column. The keyboard repeatedly applies current to each column in turn, and checks to see which rows output current. From this, the keyboard can deduce which keys in that column have been depressed. The matrix takes the form of a printed circuit, either on a conventional PCB, or on membrane sheets. Continue reading Matrix Keypad Interfacing with Arduino