Remote ashok

21
Arduino based remote control Its very simple method to control outputs by using remote control Prepared by: Ashokkumar Sekar BE-EEE

Transcript of Remote ashok

Page 1: Remote ashok

Arduino based remote control

Its very simple method to control outputs by using remote control

Prepared by:

Ashokkumar SekarBE-EEE

Page 2: Remote ashok

Requirements

• Arduino controller (atmeg328)• Tesop1738• Led • Resister• Remote

Page 3: Remote ashok

Circuit diagram

10,11,12

13,14,15

16,17,18

19,20

Page 4: Remote ashok

• There is Tsop output pin is connected to 9th pin of the micro controller, and led +ve pin is connected to 3rd pin of the micro controller

• Tsop 5v supply and gnd , and also led gnd are connected to micro controller supply pins

• After connection to upload program the program code given below slides

Page 5: Remote ashok

Project explanation

• This projects tells about how to control load by using IR remote controller

• There is I preparing , when I press number “1” button led will glow after when press “1” led

will off

Page 6: Remote ashok

Power Jack

Voltage regulator

Power Selection Jumper

USB

FTDI USB chip

Tx Rx leds Digital pins

Analog pinsPower pins

Microcontroller

ICSP Headers

Reset

Power LED

Page 7: Remote ashok

Installing Software

Page 8: Remote ashok

Understanding software

Verify

Upload NewOpen

Save Serial Monitor

Page 9: Remote ashok

Detecting your Microcontroller

Page 10: Remote ashok

SELECTING BOARD AND COM PORT

• TOOLS > BOARDS > ARDUINO DEUMILANOVE W/ATMEGA328

• TOOLS > SERIAL PORT > PORT NUMBER

Page 11: Remote ashok

STRUCTURE OF PROGRAM

Any program should compulsorily have these two functions– void setup() {……. }– void loop() {…… }

NOTE: The common header files such as stdio.h etc., are included in default.

Page 12: Remote ashok

Step1: Declaring Variables

Integer type variableint ledPin = 3;

This should be declared at the very beginning of the program (Even before void setup() and void loop()).

Page 13: Remote ashok

Step2: Setting I/O pins

• You should set the i/o pins as either input or output using the following function

pinMode(pin number, INPUT/OUTPUT);

• You should declare it inside void setup()

Page 14: Remote ashok

Step3: Writing an Output

To write a value to a pin:

digitalWrite(pin number, HIGH/LOW);

This and all the other functions should be written inside void loop()

Page 15: Remote ashok

Step4: Delay function

• To specify a certain period of time for a set of functions to be executed:

delay(value);

Eg: delay(1000);

It is very important to include this function whenever you want to see an output, as the microcontroller works in micro-seconds speed

Time In milliseconds

Page 16: Remote ashok

Getting input

Step 1: Declare a variable int buttonValue;

Step 2: inside void setup(), initialize pin as inputpinMode(A4,INPUT);

Step 3: inside void loop(), read and store the value.buttonValue = digitalRead(A4);

Page 17: Remote ashok

if-else loop if(buttonValue == HIGH) { digitalWrite(ledPin,HIGH); } else { digitalWrite(ledPin,LOW); }

Since you are checking a condition, you have to use 2 equal-to.

Page 18: Remote ashok

Program Code #include <SPIRremote.h>SPIRrecv remote(9);int ledpin = 3; int irValue;int i = 0;void setup(){ remote.enableIR(); pinMode(ledpin, OUTPUT);}void loop(){ int irValue = remote.getIRValue();

switch (irValue) { case 1: if(digitalRead(ledpin) == HIGH) { digitalWrite(ledpin,LOW); } else { digitalWrite(ledpin,HIGH); } break; } }

Page 19: Remote ashok
Page 20: Remote ashok

Project

Page 21: Remote ashok

I attached my video here