Infrared distance sensor (GP2Y0A21YK0F) [S036]



https://www.youtube.com/watch?v=GhNwmtpVTY4


*GitHubhttps://github.com/rdiot/rdiot-s036.git


* Specs

operating voltage: 4.5 V to 5.5 V

average current consumption: 30 mA (typical)

distance measuring range: 10 cm to 80 cm (4" to 32")

output type: analog voltage

output voltage differential over distance range: 1.9 V (typical)

response time: 38 ± 10 ms

package size: 29.5×13.0×13.5 mm (1.16×0.5×0.53")

weight: 3.5 g (0.12 oz)


* Contents

- DataSheet : http://www.sparkfun.com/datasheets/Components/GP2Y0A21YK.pdf


- Connect 

Yellow ----- A0

Black ----- GND

Red ----- 5V


- Key Code

int pin = A0;


int I = analogRead(pin);

int value = (6762 /(I-9)) -(4);


lcd.print("distance=" + (String)value + "CM  ");

'2) Sensor > Distance' 카테고리의 다른 글

Infrared distance sensor (GP2Y0A21YK0F) [S036]  (0) 2019.02.23
Ultrasonic Ranging Module (HC-SR04) [S011]  (0) 2016.09.08
Posted by RD IoT RDIoT

댓글을 달아 주세요

IR Infrared Obstacle Avoidance Sensor 2-180cm (DIY) [S246]



https://www.youtube.com/watch?v=iIR1fbxM9uo


*GitHub https://github.com/rdiot/rdiot-s246.git

* Specs

Features:

1.Many kinds of welding methods,vertical and horizontal,expand the scope of application.

2.With precision potentiometer to adjust the range of infrared 38KHz detection.

3.The sensor detects the band enable port,which is convenient for the signal line as the bus line.

4.On power enable the port of the high level of the sensor,the sensor can detect the output signal.

5.Detection range can be up to 1.2 meters.

6.The software is enhanced,and the infrared ray interference of the infrared remote control equipment can be avoided.

7.Using EEPROM to record the work of each module, the probability of interference with each other is down to 1%.

8.Signal low level output.

9.Pin SIP head,application of bread board or through hole project.

10.Board set the jumper JP,short circuit when the output signal has a latch function,or dynamic output.

 

Specifications:

1.Power requirements:5 VDC

2.Communication:digital high/low output

3.Working temperature:32 to 158 degrees F (0 to +70 degrees)

4.Size:2.4cm * 2.8cm

 

Applications:

1.Warehouse door switch (latch set)

2.Security alarm system

3.Automatic production line transportation belt object count

4.Robot control

 

Package Included:

1 * 38KHz IR Infrared Obstacle Avoidance Sensor Switch


* Contents

- Connect

EN ----- X

SIG ----- D2

VCC ----- 5V

GND ----- GND


- Key Code

int T = 2; // INPUT PIN

 

void setup()

{

 Serial.begin(115200); 

 Serial.println("Arduino Examples - IR Sensor");

 Serial.println(" http://docs.whiteat.com/?p=1142");

 pinMode(T, INPUT);

}

 

void loop()

{

 if (LOW == digitalRead(T))

 {

 Serial.println("IR Detected"); //detected

 }

 else

 {

 Serial.print("."); 

 }

 delay(100);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

IR Wave sensor switch DC8-24V (HN-C009A) [S144]



https://www.youtube.com/watch?v=x96Hni0ALos


* Specs

1.type:                   Close to the induction switch

2. Model:                     HN-C009A

3. Power supply:             DC8-24V

4.  Output Voltage:           DC8-24V/4A

5.Power:                 24W(max)

6. Sensitive Angle:           10degrees

7. Super sensitivity:           0.1- 5CM Distance 

8. Working:                     5CM Something is blocking the sensor head,     The first wave open output,Second waved off the output.  The third wave open output,  Continuous cycle

9.Output line:                 15CM

10.Sensor line:               45CM

11. Product Size:                 77*10.8*8.5mm  (L x W x H)

12. Sensing probe Size:     13.4*6.8*10.3 (L x W x H)

13.IP Rating:             IP50

14.Housing Material:       PC

15. Housing Color:         Black 

Posted by RD IoT RDIoT

댓글을 달아 주세요

IR Infrared Obstacle Avoidance Sensor (IR-08H) [S017]



https://www.youtube.com/watch?v=21SB3fJBSLg


*GitHubhttps://github.com/rdiot/rdiot-s017.git


* Specs

Working voltage: DC 3.3V-5V

Working current: ≥ 20mA

Operating temperature: -10 ℃ - +50 ℃

detection distance :2-40cm

IO Interface: 4-wire interfaces (- / + / S / EN)

Output signal: TTL level (low level there is an obstacle, no obstacle high)

Adjustment: adjust multi-turn resistance

Effective angle: 35 °

Size: 28mm × 23mm

Weight Size: 9g


* Contents

- Connect

GND ----- GND

VCC ----- 5V

S ----- 2

EN ----- X


- Key Code

int T = 2; // INPUT PIN

 

void setup()

{

 Serial.begin(115200); 

 Serial.println("Arduino Examples - IR Sensor");

 Serial.println(" http://docs.whiteat.com/?p=1142");

 pinMode(T, INPUT);

}

 

void loop()

{

 if (LOW == digitalRead(T))

 {

 Serial.println("IR Detected"); //detected

 }

 else

 {

 Serial.print("."); 

 }

 delay(100);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

4 Channel IR Tracking Module [S075]



https://www.youtube.com/watch?v=MOsxmBge2wU


*GitHubhttps://github.com/rdiot/rdiot-s075.git


* Specs

Working voltage: DC 3.3V-5V

Working current: try to choose more than 1A power supply

Working temperature: - 10oC - +50oC

Mounting aperture: M3 screws

Detection range: 1mm to 60 CM adjustable, the closer the performance more stable, white reflects the farthest distance.

Size: in the control panel of 42mm * 38mm * 12mm (length * width * height)

Small forward 25mm * 12mm * 12mm (length * width * height)

Output interface: 6 wire interface (1234 to 4 signal output ends, + positive power, - for the negative power is ground)

The output signal: TTL level (can be directly connected to I/0 microcontroller, infrared light reflected back to the sensor induction, the red indicator light, output low level; no infrared light, the indicator light does not shine, the output high.)


* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int IN1 = 2;

int IN4 = 5;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(IN1,INPUT);

  pinMode(IN4,INPUT);


  delay(1000);


  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("S075:4CHIR Tracking");


  String val1str = "";

  String val4str = "";


  int in1_val = digitalRead(IN1);

  int in4_val = digitalRead(IN4);


  if(in1_val == 0)

    val1str = " detected";

  else 

    val1str = "         ";


  if(in4_val == 0)

    val4str = " detected";

  else

    val4str = "         ";


  lcd.setCursor(0,1);

  lcd.print("IN1=" + (String)in1_val + val1str);


  lcd.setCursor(0,2);

  lcd.print("IN4=" + (String)in4_val + val4str);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Sharp Infrared Receiver (GP1UX311QS) [S016]



https://www.youtube.com/watch?v=21SB3fJBSLg



* Specs

Product GP1UX311QS

Make Sharp

Type None

Lead Time Request Quote for Lead Time

Quantity in Stock Request Quote for Quantity in Stock


* Contents

- Connect

GND ----- GND

VCC ----- 5V

S ----- 2

EN ----- X


- Key Code

int T = 2; // INPUT PIN

 

void setup()

{

 Serial.begin(115200);

 Serial.println("Arduino Examples - IR Sensor");

 Serial.println(" http://docs.whiteat.com/?p=1142");

 pinMode(T, INPUT);

}

 

void loop()

{

 if (LOW == digitalRead(T))

 {

 Serial.println("IR Detected"); // Detected

 }

 else

 {

 Serial.print("."); 

 }

 delay(100);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Keyes Infrared Receiver Module (KY-022) [S014]


https://www.youtube.com/watch?v=2tx-SmOXR9Q


*GitHubhttps://github.com/rdiot/rdiot-s014.git


* Specs

Infrared remote control distance: more than 8 meters

Launch tube infrared wavelength: 940Nm

Crystal frequency: 455KHZ crystal

Carrier frequency: 38KHZ

Encoding: encoding format for the NEC

Size: 86 * 40 * 6mm

Power: CR2025/1600mAH


* Contents

- Connect

pin- ----- GND

middle pin ----- 5V

S ----- D11


- Key Code

#include "U8glib.h"

#include "IRremote.h"

 

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);

int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11

 

IRrecv irrecv(receiver);           // create instance of 'irrecv'

decode_results results;            // create instance of 'decode_results'

String str_hex = "";

String str_value = "";

 

void setup() {

  Serial.begin(9600);

  Serial.println("IR Receiver Raw Data + Button Decode Test");

  irrecv.enableIRIn(); // Start the receiver

}

 

void loop(void) {

 

  if (irrecv.decode(&results)) // have we received an IR signal?

  {

//    Serial.println(results.value, HEX);  UN Comment to see raw values

    translateIR(); 

    irrecv.resume(); // receive the next value

  }  

 

  // picture loop

  u8g.firstPage();  

  do {

    draw();

  } while( u8g.nextPage() );

  

  // rebuild the picture after some delay

  //delay(500);

}

 

void draw(void) {

  u8g.setFont(u8g_font_9x15B);

  u8g.setPrintPos(0, 12); 

  u8g.println("IR-VS1838B");

 

  u8g.setFont(u8g_font_helvB14);

  u8g.setPrintPos(0,40);

  u8g.print("hex="+str_hex);

 

  u8g.setFont(u8g_font_helvB14);

  u8g.setPrintPos(0,60);

  u8g.print("str="+str_value);

 

}

 

/*-----( Declare User-written Functions )-----*/

void translateIR() // takes action based on IR code received

 

// describing Car MP3 IR codes 

 

{

 

  switch(results.value)

  {

 

  case 0xFFA25D:  

    Serial.println(" CH-            "); 

    str_hex = "0xFFA25D";

    str_value = "CH-";

    break;

 

  case 0xFF629D:  

    Serial.println(" CH             "); 

    str_hex = "0xFFA25D";

    str_value = "CH-";

    break;

 

  case 0xFFE21D:  

    Serial.println(" CH+            "); 

    str_hex = "0xFFE21D";

    str_value = "CH+";

    break;

 

  case 0xFF22DD:  

    Serial.println(" PREV           "); 

    str_hex = "0xFF22DD";

    str_value = "PREV";

    break;

 

  case 0xFF02FD:  

    Serial.println(" NEXT           "); 

    str_hex = "0xFF02FD";

    str_value = "NEXT";

    break;

 

  case 0xFFC23D:  

    Serial.println(" PLAY/PAUSE     "); 

    str_hex = "0xFFC23D";

    str_value = "PLAY/PAUSE";

    break;

 

  case 0xFFE01F:  

    Serial.println(" VOL-           "); 

    str_hex = "0xFFE01F";

    str_value = "VOL-";

    break;

 

  case 0xFFA857:  

    Serial.println(" VOL+           "); 

    str_hex = "0xFFA857";

    str_value = "VOL+";

    break;

 

  case 0xFF906F:  

    Serial.println(" EQ             "); 

    str_hex = "0xFF906F";

    str_value = "EQ";

    break;

 

  case 0xFF6897:  

    Serial.println(" 0              "); 

    str_hex = "0xFF6897";

    str_value = "0";

    break;

 

  case 0xFF9867:  

    Serial.println(" 100+           "); 

    str_hex = "0xFF9867";

    str_value = "100+";

    break;

 

  case 0xFFB04F:  

    Serial.println(" 200+           "); 

    str_hex = "0xFFB04F";

    str_value = "200+";

    break;

 

  case 0xFF30CF:  

    Serial.println(" 1              "); 

    str_hex = "0xFF30CF";

    str_value = "1";

    break;

 

  case 0xFF18E7:  

    Serial.println(" 2              "); 

    str_hex = "0xFF18E7";

    str_value = "2";

    break;

 

  case 0xFF7A85:  

    Serial.println(" 3              "); 

    str_hex = "0xFF7A85";

    str_value = "3";

    break;

 

  case 0xFF10EF:  

    Serial.println(" 4              "); 

    str_hex = "0xFF10EF";

    str_value = "4";

    break;

 

  case 0xFF38C7:  

    Serial.println(" 5              "); 

    str_hex = "0xFF38C7";

    str_value = "5";

    break;

 

  case 0xFF5AA5:  

    Serial.println(" 6              "); 

    str_hex = "0xFF5AA5";

    str_value = "6";

    break;

 

  case 0xFF42BD:  

    Serial.println(" 7              "); 

    str_hex = "0xFF42BD";

    str_value = "7";

    break;

 

  case 0xFF4AB5:  

    Serial.println(" 8              "); 

    str_hex = "0xFF4AB5";

    str_value = "8";

    break;

 

  case 0xFF52AD:  

    Serial.println(" 9              "); 

    str_hex = "0xFF52AD";

    str_value = "9";

    break;

 

  default: 

    Serial.println(" other button   ");

    str_hex = "NONE";

    str_value = "NONE";

 

  }

 

  delay(500);

 

 

} //END translateIR

Posted by RD IoT RDIoT

댓글을 달아 주세요

Infrared Receiver VS1838 (VS1838B)




Infrared Receiver VS1838 (VS1838B) Dump Value

https://www.youtube.com/watch?v=esL8Hr-H_mc


Infrared Receiver VS1838 (VS1838B) Print Value

https://www.youtube.com/watch?v=wLmI6IGGVtw


*GitHub https://github.com/rdiot/rdiot-s013.git


* Specs

Typical distance 20m @ 45 degree angle, power 2.7-5.5V, typical current 0.4mA, -3db bandwidth 3.3kHz, output CMOS/TTL, response 600us.


* Contents

- Library : https://github.com/z3t0/Arduino-IRremote

- Library Test : IRrecvDumpV2


- Connect

OUT ----- D11

GND ----- GND

VCC ----- 5V


- Key Code

#include "U8glib.h"

#include "IRremote.h"


U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);

int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11


IRrecv irrecv(receiver);           // create instance of 'irrecv'

decode_results results;            // create instance of 'decode_results'

String str_hex = "";

String str_value = "";


void setup() {

  Serial.begin(9600);

  Serial.println("IR Receiver Raw Data + Button Decode Test");

  irrecv.enableIRIn(); // Start the receiver

}


void loop(void) {


  if (irrecv.decode(&results)) // have we received an IR signal?

  {

//    Serial.println(results.value, HEX);  UN Comment to see raw values

    translateIR(); 

    irrecv.resume(); // receive the next value

  }  


  // picture loop

  u8g.firstPage();  

  do {

    draw();

  } while( u8g.nextPage() );

  

  // rebuild the picture after some delay

  //delay(500);

}


void draw(void) {

  u8g.setFont(u8g_font_9x15B);

  u8g.setPrintPos(0, 12); 

  u8g.println("IR-VS1838B");


  u8g.setFont(u8g_font_helvB14);

  u8g.setPrintPos(0,40);

  u8g.print("hex="+str_hex);


  u8g.setFont(u8g_font_helvB14);

  u8g.setPrintPos(0,60);

  u8g.print("str="+str_value);


}


/*-----( Declare User-written Functions )-----*/

void translateIR() // takes action based on IR code received


// describing Car MP3 IR codes 


{


  switch(results.value)

  {


  case 0xFFA25D:  

    Serial.println(" CH-            "); 

    str_hex = "0xFFA25D";

    str_value = "CH-";

    break;


  case 0xFF629D:  

    Serial.println(" CH             "); 

    str_hex = "0xFFA25D";

    str_value = "CH-";

    break;


  case 0xFFE21D:  

    Serial.println(" CH+            "); 

    str_hex = "0xFFE21D";

    str_value = "CH+";

    break;


  case 0xFF22DD:  

    Serial.println(" PREV           "); 

    str_hex = "0xFF22DD";

    str_value = "PREV";

    break;


  case 0xFF02FD:  

    Serial.println(" NEXT           "); 

    str_hex = "0xFF02FD";

    str_value = "NEXT";

    break;


  case 0xFFC23D:  

    Serial.println(" PLAY/PAUSE     "); 

    str_hex = "0xFFC23D";

    str_value = "PLAY/PAUSE";

    break;


  case 0xFFE01F:  

    Serial.println(" VOL-           "); 

    str_hex = "0xFFE01F";

    str_value = "VOL-";

    break;


  case 0xFFA857:  

    Serial.println(" VOL+           "); 

    str_hex = "0xFFA857";

    str_value = "VOL+";

    break;


  case 0xFF906F:  

    Serial.println(" EQ             "); 

    str_hex = "0xFF906F";

    str_value = "EQ";

    break;


  case 0xFF6897:  

    Serial.println(" 0              "); 

    str_hex = "0xFF6897";

    str_value = "0";

    break;


  case 0xFF9867:  

    Serial.println(" 100+           "); 

    str_hex = "0xFF9867";

    str_value = "100+";

    break;


  case 0xFFB04F:  

    Serial.println(" 200+           "); 

    str_hex = "0xFFB04F";

    str_value = "200+";

    break;


  case 0xFF30CF:  

    Serial.println(" 1              "); 

    str_hex = "0xFF30CF";

    str_value = "1";

    break;


  case 0xFF18E7:  

    Serial.println(" 2              "); 

    str_hex = "0xFF18E7";

    str_value = "2";

    break;


  case 0xFF7A85:  

    Serial.println(" 3              "); 

    str_hex = "0xFF7A85";

    str_value = "3";

    break;


  case 0xFF10EF:  

    Serial.println(" 4              "); 

    str_hex = "0xFF10EF";

    str_value = "4";

    break;


  case 0xFF38C7:  

    Serial.println(" 5              "); 

    str_hex = "0xFF38C7";

    str_value = "5";

    break;


  case 0xFF5AA5:  

    Serial.println(" 6              "); 

    str_hex = "0xFF5AA5";

    str_value = "6";

    break;


  case 0xFF42BD:  

    Serial.println(" 7              "); 

    str_hex = "0xFF42BD";

    str_value = "7";

    break;


  case 0xFF4AB5:  

    Serial.println(" 8              "); 

    str_hex = "0xFF4AB5";

    str_value = "8";

    break;


  case 0xFF52AD:  

    Serial.println(" 9              "); 

    str_hex = "0xFF52AD";

    str_value = "9";

    break;


  default: 

    Serial.println(" other button   ");

    str_hex = "NONE";

    str_value = "NONE";


  }


  delay(500);



} //END translateIR

Posted by RD IoT RDIoT

댓글을 달아 주세요

4 Head Infrared Transmitter Module [S180]




https://www.youtube.com/watch?v=ZpDeUjWLtsM


*GitHubhttps://github.com/rdiot/rdiot-s180.git


* Specs

Dimensions : 35 * 35mm

Weight : 4g

Voltage : 5V

Ports : Digital Level

Modulation : Direct emission unmodulated

Emission head : 4

Transmitting distance : 1-3m

Wavelength : 940nm


Four launch, multi-directional signal synchronization

A wide range of signal radiation 

With the transmitted signal indicating LED, easy to observe debugging 

Small infrared signal transmitter can be used as the source


* Contents

- Connect

GND ----- GND

VCC ----- 5V

DAT ----- D3


- Key Code

#include <IRremote.h>

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x20 for a 16 chars and 2 line display


//* An IR LED must be connected to Arduino PWM pin 3.

IRsend irsend;

 

void setup()

{

  lcd.init();    // initialize the lcd 

  // Print a message to the LCD.

  lcd.backlight();

}


int count = 0;

void loop() {

 

  int khz = 38; // 38kHz carrier frequency for the NEC protocol

  unsigned int  rawData[67] = {4500,4400, 600,1650, 550,1650, 650,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1650, 550,1650, 600,550, 550,550, 550,550, 550,550, 550,550, 600,500, 600,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 600,1600, 600,550, 550,1650, 600,1650, 550,1650, 600,1650, 600,1650, 550,1650, 600};  // SAMSUNG E0E040BF

unsigned int  data = 0xE0E040BF;

 

  irsend.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), khz); //Note the approach used to 


automatically calculate the size of the array.

  

  lcd.setCursor(0,0);

  lcd.print("S180:4 Head IR Trans.");

  lcd.setCursor(0,1);

  count++;

  lcd.print("every 5sec count: "+(String)count+" ");

  lcd.setCursor(0,2);

  lcd.print("data=0xE0E040BF");

 

  delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Two-way infrared transmitter module [S095]




https://www.youtube.com/watch?v=PGZuG8FwpmE


*GitHub : https://github.com/rdiot/rdiot-s095.git


* Specs

This is an infrared transmitter very useful for any IR communication for your project. Infrared is a common, inexpensive, and easy to use wireless communication technology.

the module is ready to be connected to an MCU such as an Arduino.

It has two led transmitter to add visibility and an indicator led that shows when the module is transmitting.

Item Weight: 5 g

Boxed-product Weight: 5 g


* Contents

- Library : https://github.com/shirriff/Arduino-IRremote/

- Use : IRsendDemo


- Connect

DAT ----- D3

VCC ----- 5V

GND ----- GND


- Power Off Dump Code

Encoding  : SAMSUNG

Code      : E0E040BF (32 bits)

Timing[67]: 

     +4400, -4400     + 600, -1650     + 550, -1650     + 600, -1600

     + 600, - 500     + 550, - 550     + 550, - 550     + 550, - 550

     + 550, - 550     + 550, -1650     + 550, -1650     + 600, -1650

     + 600, - 500     + 600, - 500     + 600, - 450     + 600, - 500

     + 600, - 500     + 600, - 550     + 550, -1600     + 650, - 500

     + 550, - 550     + 550, - 550     + 550, - 550     + 550, - 500

     + 600, - 500     + 600, -1600     + 600, - 500     + 600, -1650

     + 600, -1600     + 600, -1600     + 600, -1650     + 600, -1600

     + 600, -1600     + 600


- Key Code

#include <IRremote.h>

//* An IR LED must be connected to Arduino PWM pin 3.

IRsend irsend;

  

void loop() {

 

  int khz = 38; // 38kHz carrier frequency for the NEC protocol

 

  unsigned int  rawData[67] = {4500,4400, 600,1650, 550,1650, 650,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1650, 550,1650, 600,550, 550,550, 550,550, 550,550, 550,550, 600,500, 600,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 600,1600, 600,550, 550,1650, 600,1650, 550,1650, 600,1650, 600,1650, 550,1650, 600};  // SAMSUNG E0E040BF

unsigned int  data = 0xE0E040BF;

 

  irsend.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), khz); //Note the approach used to automatically calculate the size of the array.

 

  delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Keyes Infrared Transmitter Module (KY-005) [S015]




https://www.youtube.com/watch?v=vZQNxaUkKw0


*GitHubhttps://github.com/rdiot/rdiot-s015.git


* Specs

Transmit 38KHz modulating signal

MATERIAL PCB

ARCHITECTURE Arduino

BRAND KEYES

DEPTH 7 mm

HEIGHT 35 mm

WIDTH 15 mm

PRODUCT WEIGHT 1.3 g


* Contents

- Library : https://github.com/shirriff/Arduino-IRremote/

- Use : IRsendDemo


- Connect

S ----- D3

middle ----- 5V

- ----- GND


- Power Off Dump Code

Encoding  : SAMSUNG

Code      : E0E040BF (32 bits)

Timing[67]: 

     +4400, -4400     + 600, -1650     + 550, -1650     + 600, -1600

     + 600, - 500     + 550, - 550     + 550, - 550     + 550, - 550

     + 550, - 550     + 550, -1650     + 550, -1650     + 600, -1650

     + 600, - 500     + 600, - 500     + 600, - 450     + 600, - 500

     + 600, - 500     + 600, - 550     + 550, -1600     + 650, - 500

     + 550, - 550     + 550, - 550     + 550, - 550     + 550, - 500

     + 600, - 500     + 600, -1600     + 600, - 500     + 600, -1650

     + 600, -1600     + 600, -1600     + 600, -1650     + 600, -1600

     + 600, -1600     + 600


- Key Code

#include <IRremote.h>

//* An IR LED must be connected to Arduino PWM pin 3.

IRsend irsend;

  

void loop() {

 

  int khz = 38; // 38kHz carrier frequency for the NEC protocol

 

  unsigned int  rawData[67] = {4500,4400, 600,1650, 550,1650, 650,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1650, 550,1650, 600,550, 550,550, 550,550, 550,550, 550,550, 600,500, 600,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 600,1600, 600,550, 550,1650, 600,1650, 550,1650, 600,1650, 600,1650, 550,1650, 600};  // SAMSUNG E0E040BF

unsigned int  data = 0xE0E040BF;

 

  irsend.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), khz); //Note the approach used to automatically calculate the size of the array.

 

  delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

IR Transmitter Module [S066]



https://www.youtube.com/watch?v=dSP6zp6fjdE


*GitHubhttps://github.com/rdiot/rdiot-s066.git



* Specs

Product Name IR Transmitter Module

Working Voltage DC 5V

Pin Quantity 3

Body Size 21 x 22 x 5mm/0.83" x 0.87" x 0.2"(L*W*T)

Material Plastic, Electronic Part

Main Color As Picture Show

Net Weight 5g

Package Content 1 x IR Transmitter Module


* Contents

- Connect

Transmitter

GND - GND

VCC - 5V

DAT - D3 (When RAW)


Receiver

pin- - GND

middle pin - 5V

S - D11


- Key Code

Transmitter

#include <IRremote.h>

//* An IR LED must be connected to Arduino PWM pin 3.

IRsend irsend;

void loop() {

 

  int khz = 38; // 38kHz carrier frequency for the NEC protocol

 

  unsigned int  rawData[67] = {4500,4400, 600,1650, 550,1650, 650,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1650, 550,1650, 600,550, 550,550, 550,550, 550,550, 550,550, 600,500, 600,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 600,1600, 600,550, 550,1650, 600,1650, 550,1650, 600,1650, 600,1650, 550,1650, 600};  // SAMSUNG E0E040BF

  unsigned int  data = 0xE0E040BF;

 

  irsend.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), khz); //Note the approach used to automatically calculate the size of the array.

 

  delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.

}


Receiver

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include "IRremote.h"

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11

 

IRrecv irrecv(receiver);           // create instance of 'irrecv'

decode_results results;            // create instance of 'decode_results'

String str_hex = "";

String str_value = "";

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  irrecv.enableIRIn(); // Start the receiver

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S066:IR Transmitter");

  

  if (irrecv.decode(&results)) // have we received an IR signal?

  {

    //    Serial.println(results.value, HEX);  UN Comment to see raw values

    translateIR(); 

 

    lcd.setCursor(0,1);

    lcd.print("str_hex=" + (String)str_hex);

    lcd.setCursor(0,2);

    lcd.print("str_value=" + (String)str_value);

 

    irrecv.resume(); // receive the next value

  }   

}

 

void translateIR() // takes action based on IR code received

{

  switch(results.value)

  {

 

  case 0xE0E040BF:  

    str_hex = "0xE0E040BF";

    str_value = "power off ";

    break;

 

  default: 

    str_hex = (String)results.value;

    str_value = "NONE      ";

 

  } 

  delay(500);

 

} //END translateIR

Posted by RD IoT RDIoT

댓글을 달아 주세요