ARDUINO based IR remote control robot

on Tuesday, February 18, 2014


                      
Hi everyone. This my new project IR remote control robot using arduino. This is a simple design robot you can easily build it.
Project requirements:
  •   Arduino uno
  •   Tsop1738 (ir receiver)
  •   H bridge ic (L293D)
  •   Two dc motor
  •    A robot base
  •    9v Battery


For The circuit diagram refer the bellow device pin description and make connection to arduino based on the program of the robot:
Important: connect ir receiver out to arduino digital pin 11 only.

  •     Connect arduino pin 7- l293d IN 1 pin 2
  •     Connect arduino pin 6- l293d IN 2 pin 7
  •     Connect arduino pin 5- l293d IN 3 pin 11
  •     Connect arduino pin 4- l293d IN 4 pin 15
  •     Connect two motor show like bellow image





Project step 1: read  your IR  remote button value using serial monitor.
            First do the circuit connection shown above and  download the ir remote library file for arduino IDE. And copy the library file in the arduino libraries folder.
And then run the arduino ide select sketch like that given bellow
File -> examples->IR  remote->IR recv demo




Upload the sketch to arduino and open serial monitor. Press the TV IR remote (any company) in front of  ir receiver then you will see the decode hex code in serial monitor (example : FF30CF). the code will vary according to the remote company. Press any 5 button in remote and note down the codes shown in the serial monitor for programming purpose.

Project step2: upload IR robot code  and  play
This is the code for IR robot:
Type your 5  button s code in if else if statement in bellow code. The shown value is my remote value.
Use 5 button to control robot forward, reverse, left right and stop


#include <IRremote.h>

int RECV_PIN = 11;
int statusled = 13;
IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{

  irrecv.enableIRIn();
 pinMode(statusled,OUTPUT);
  pinMode(8,OUTPUT);
 pinMode(7,OUTPUT);
pinMode(6,OUTPUT);
pinMode(5,OUTPUT);
pinMode(4,OUTPUT);
digitalWrite(statusled,LOW);// Start the receiver
}

void loop() {
  digitalWrite(8,HIGH);
  if (irrecv.decode(&results)) {
   digitalWrite(statusled,HIGH);
    irrecv.resume();
    if (results.value == 0xFF50AF){     // 0xtype your IR remote button value note down in the previous step
digitalWrite(7,HIGH);
digitalWrite(6,LOW);
digitalWrite(5,HIGH);
digitalWrite(4,LOW);
       }else if(results.value == 0xFF30CF){
digitalWrite(7,HIGH);
digitalWrite(6,LOW);
digitalWrite(5,LOW);
digitalWrite(4,LOW);
    }
    else if(results.value == 0xFFB04F){
     digitalWrite(7,LOW);
digitalWrite(6,LOW);
digitalWrite(5,HIGH);
digitalWrite(4,LOW);
    } else if(results.value == 0xFFD02F){
    digitalWrite(7,LOW);
digitalWrite(6,HIGH);
digitalWrite(5,LOW);
digitalWrite(4,HIGH);
    }else if(results.value == 0xFF9867){
    digitalWrite(7,LOW);
digitalWrite(6,LOW);
digitalWrite(5,LOW);
digitalWrite(4,LOW);
    }
  }
}

That it once you upload it you are ready to go connect the robot with battery and play. I hope that you are all like my project
                                                          Thank you all



MSP430 SERIAL COMMUNICATION USING ENERGIA AND PROCESSING

on Saturday, February 15, 2014
         Hi everyone . i am vigneshraja. here i done the varying the color depending upon the analog value read from 10 k potentiometer using MSP430G2231. i am using Energia software for serial communication program. for  varying the color of window i am using Processing software.

The program code for energia to read 10k potentiometer value:

void setup()
{
  Serial.begin(4800);    // start serial communication
}

void loop()
{
  int value = map(analogRead(A0), 0, 1023, 0, 255);        //read value of pod and convert to 8 bit variation
  Serial.println(value);                                // print the read value in serial monitor
  } 




The code for processing software to change the color according to the pod value:

import processing.serial.*;
Serial port;
float brightness = 0;

void setup()
{
  size(500,500);
  port = new Serial(this, "COM4", 4800); // select the COM port shown bellow in the energia IDE  port.bufferUntil('\n'); 
}

void draw()
{
  background(brightness,0,0);
}
 
void serialEvent (Serial port)
{
  brightness = float(port.readStringUntil('\n'));
}