Puzzle - Infrared Receiver 红外接收器

来自Duinopeak_COM
跳转至: 导航搜索

产品简介

红外线发射器通过红外线LED发射红外信号,然后使用Puzzle- Infrared Receiver 红外线接收器接受信号。另外红外发射器还可以控制家中用遥控器控制的设备。红外发射器传输最大距离为10m,超过10m就有可能接收不到信号。

Puzzle Infrared Receiver top.pngPuzzle Infrared Receiver back.png

参数规格

  • 工作电压: 3.3-5V
  • 感应距离: 10m

应用示例

  1. 红外线发射器发射红外信号,红外线接收器接受该信号。
  2. 连接Puzzle - Infrared Emitter到D3.
  3. 连接Puzzle - Infrared Receiver到A4.
  4. 下载IR Send and Receiver Library, 解压至以下路径: ..\arduino-1.0\libraries.
  5. 按以下路径打开:File -> Example ->IRSendRev->sendTest. 并将代码下载到发射器对应的主控板上。

Puzzle Infrared receiver connection.jpg

/*******************************
IR sent demo v1.0
Connect the IR sent pins to D3 for this demo
****************************** //
#include <IRSendRev.h>
void setup()
{
      //enableIROut(38);
}
//unsigned char d[] = {9, 90, 91, 11, 31, 4, 1, 2, 3, 4};
unsigned char d[] = {15, 70, 70, 20, 60, 10, 1, 2, 3, 4,5,6,7,8,9,10};
//Very Important:
//the first parameter(15): the data that needs to be sent;
//the next 2 parameter(70,70): the logic high and low duration of "Start";
//the next 2 parameter(20,60): the logic "short" and "long"duration in the communication
//that to say:  if "0", the high duration is 20ms and  low is      
//20 ms; while logic "1",
// the high duration is 20 ms and low is 60 ms;
//the next 2 parameter(10): number of data you will sent;
//the next parameter(1, 2, 3, 4,5,6,7,8,9,10): data you will sent ;
void loop()
{
    IR.Send(d, 38);//sent the data via 38Kz IR
    delay(1000);
}

依下列路径打开:File -> Example ->IRSendRev->revTest. 并将代码下载到接收器对应的主控板上。

/*******************************
   IR receive demo v1.0
   Connect the IR sent pins to A4 for this demo
  ******************************/
#include <IRSendRev.h>
//#include <IRSendRevInt.h>
void setup()
{
   Serial.begin(38400);
   IR.Init(A4);
   Serial.println("init over");
}
unsigned char dta[20];
void loop()
{
   if(IR.IsDta())
   {
       // IR.Recv(dta);
       int length= IR.Recv(dta);
       for (int i =0;i<length;i++)
       {
          Serial.print(dta[i]);
          Serial.print("\t");
       }
       Serial.println();
// Very Important:
// the received data are comprised of the trsmission parameters , please refer to 
// the sendTest.ino in the library ;
   }
}

把代码下载到Puzzle - Infrared Receiver 连接的arduino。 打开Serial Monitor查看信号接收情况。

IR Send and Receiver Serial data.jpg


资源


Infrared Receiver 红外接收器原理图PDF: 文件:Puzzle Infrared Receiver schematic.pdf

Infrared Receiver 红外接收器程序库: 文件:Puzzle Infrared Receiver program library.zip

Infrared Receiver 红外接收器芯片TSOP328数据手册: 文件:Puzzle Infrared Receiver Tsop382 datasheet.pdf


如何购买

Duinopeak 官方淘宝商城
Infrared Receiver 红外接收器购买链接

支持

如果你有什么建议或者好的点子, 你可以来我们的DuinoPeak论坛参与讨论.

外部链接

链接到外部网页将会给你提供更多应用创意,文档/数据表或软件库

视频