亿迅智能制造网
工业4.0先进制造技术信息网站!
首页 | 制造技术 | 制造设备 | 工业物联网 | 工业材料 | 设备保养维修 | 工业编程 |
home  MfgRobots >> 亿迅智能制造网 >  >> Manufacturing Technology >> 制造工艺

无线激光数据传输(LIFI)(100b/秒)

组件和用品

Arduino Nano R3
× 2
无焊面包板全尺寸
× 2
字母数字 LCD,16 x 2
× 2
跳线(通用)
× 30
KeyPad 4x3
× 1
9V 电池(通用)
× 2
9V 电池夹
× 2
激光二极管,2 针
× 1
开发套件配件,太阳能电池
× 1
旋转电位器(通用)
× 2
电阻 10k ohm
× 3

必要的工具和机器

烙铁(通用)
焊锡丝,无铅

应用和在线服务

Arduino IDE

关于这个项目

<人物> <人物>

该项目由发射器和接收器两部分组成,可用于使用键盘和 LCD 通过激光发送文本

代码

  • LI-FI 发射器代码 V 2.0
  • LI-FI 接收器代码 V 2.0
LI-FI 发射器代码 V 2.0C/C++
LI-FI 发射器代码 V 2.0
/*LI-FI 发射器代码 V 2.0 由 HOUALEF AHMED RAMZI 撰写 开始于 29-9-2020 最后更新于 14-10-2020*/#define LaserPin 2#include const int rs =12, en =11, d4 =6, d5 =5, d6 =4, d7 =3;LiquidCrystal lcd(rs, en, d4, d5, d6, d7);intcomingchar;int KeyPad_R[ ] ={A2, A1, 9, 7}; //KeyPad rowsint KeyPad_C[] ={8, 10, A3}; // 键盘 Columnsint KeyReturn =0; // 1-12int ABC 键盘函数的输出; // 用于使用一个 buttonint Row 编码 3 个字符的变量; //键盘函数中使用的变量int Column;//键盘函数中使用的变量int StCursor =0; //光标控制变量int NdCursor =0; //Cursor Controlint outcomingmatrix[32][5] 的变量; //DATA Bufferint m =0;//变量用来知道outcomingmatrix的长度,避免发送所有的32*5 emty bufferint A[] ={1, 1, 1, 1, 0}, B[] ={0, 0, 0, 1, 0}, C[] ={0, 0, 0, 1, 1}, D[] ={0, 0, 1, 0, 0}, E[] ={0 , 0, 1, 0, 1}, F[] ={0, 0, 1, 1, 0}, G[] ={0, 0, 1, 1, 1}, H[] ={0, 1 , 0, 0, 0};int I[] ={0, 1, 0, 0, 1}, J[] ={0, 1, 0, 1, 0}, K[] ={0, 1, 0, 1, 1}, L[] ={0, 1, 1, 0, 0}, M[] ={0, 1, 1, 0, 1}, N[] ={0, 1, 1, 1, 0}, O[] ={0, 1, 1, 1, 1}, P[] ={1, 0, 0, 0, 0};int Q[] ={1, 0, 0, 0 , 1}, R[] ={1, 0, 0, 1, 0}, S[] ={1, 0, 0, 1, 1}, T[] ={1, 0, 1, 0, 0 }, U[] ={1, 0, 1, 0, 1}, V[] ={1, 0, 1, 1, 0}, W[] ={1, 0, 1, 1, 1}, X[] ={1, 1, 0, 0, 0};int Y[] ={1, 1, 0, 0, 1}, Z[] ={1, 1, 0, 1, 0}, SPACE [] ={1, 1, 1, 1, 1}; // 一个存储所有编码字符的小数据库 setup() { lcd.begin(16, 2); pinMode(激光针,输出); Serial.begin(9600); for (int i; i <4; i++) { pinMode(KeyPad_R[i], OUTPUT); } for (int j; j <3; j++) { pinMode(KeyPad_C[j], INPUT); } lcd.print("HOUALEF RAMZI");延迟(5000);液晶显示器(); lcd.setCursor(0,0);}void conv(int alpha [5], char Char ) { // 从数据库中填充输出缓冲区 for (int i =0; i <5; i++) { outcomingmatrix[ m][i] =alpha[i]; } lcd.print(Char);}void start_bit() { //THE START BIT digitalWrite(LaserPin, HIGH);延迟(9); digitalWrite(LaserPin, LOW);}void KeyPad() { // 输出从 1 到 12 按下的按钮编号 for (int i =0; i <4; i++) { digitalWrite( KeyPad_R[i], HIGH); for (int j =0; j <3; j++) { if (digitalRead(KeyPad_C[j]) ==1) { Row =i;列 =j;数字写入(KeyPad_R[i],低); if (Row ==0) { switch (Column) { case 0:KeyReturn =1;休息;情况 1:KeyReturn =2;休息;情况2:KeyReturn =3;休息; } } if (Row ==1) { switch (Column) { case 0:KeyReturn =4;休息;情况 1:KeyReturn =5;休息;情况 2:KeyReturn =6;休息; } } if (Row ==2) { switch (Column) { case 0:KeyReturn =7;休息;情况 1:KeyReturn =8;休息;情况 2:KeyReturn =9;休息; } } if (Row ==3) { switch (Column) { case 0:KeyReturn =10;休息;情况 1:KeyReturn =11;休息;情况 2:KeyReturn =12;休息; } } } } } Serial.println(KeyReturn);}void KeyToAscii(int KeyN, int FirtAsciiValue) { // 将数据从键盘转换为 ASCII 值以使用上述转换函数显示器和键盘 if (KeyReturn ==KeyN) {comingchar =FirtAsciiValue + ABC; ABC++;如果(ABC ==3){ ABC =0; } }}void CursorControler() { lcd.setCursor(StCursor, NdCursor); if (KeyReturn ==10) { //确认字符因为 11 在确认按钮延迟(100); StCursor++;米++; } if (StCursor ==16) { // 当第一个已满时写入新行 StCursor =0; NdCursor =1; }}void loop() { KeyPad();延迟(150);光标控制器(); KeyToAscii(1, 65); KeyToAscii(2, 68); KeyToAscii(3, 71); KeyToAscii(4, 74); KeyToAscii(5, 77); KeyToAscii(6, 80); KeyToAscii(7, 83); KeyToAscii(8, 86); KeyToAscii(9, 89); KeyToAscii(11, 32); switch (incomingchar) { case 65:conv(A, 'A');休息;案例 66:conv(B, 'B');休息;案例 67:conv(C, 'C');休息;案例 68:conv(D, 'D');休息;案例 69:conv(E, 'E');休息;案例 70:conv(F, 'F');休息;案例 71:conv(G, 'G');休息;案例 72:conv(H, 'H');休息;案例 73:conv(I, 'I');休息;案例 74:conv(J, 'J');休息;案例 75:conv(K, 'K');休息;案例 76:conv(L, 'L');休息;案例 77:conv(M, 'M');休息;案例 78:conv(N, 'N');休息;案例 79:conv(O, 'O');休息;案例 80:conv(P, 'P');休息;案例 81:conv(Q, 'Q');休息;案例 82:conv(R, 'R');休息;案例 83:conv(S, 'S');休息;案例 84:conv(T, 'T');休息;案例 85:conv(U, 'U');休息;案例 86:conv(V, 'V');休息;案例 87:conv(W, 'W');休息;案例 88:conv(X, 'X');休息;案例 89:conv(Y, 'Y');休息;案例 90:conv(Z, 'Z');休息;案例 32:conv(SPACE, ' ');休息;案例 33:conv(SPACE, ' ');休息; } //要使用串行监视器的空间,您必须将案例 91 更改为案例 32 if (KeyReturn ==12) { //要发送数据,因为 12 是发送按钮延迟 (100); for (int j =0; j  
LI-FI 接收器代码 V 2.0C/C++
LI-FI 接收器代码 V 2.0
/*LI-FI 接收器代码 V 2.0 由 HOUALEF AHMED RAMZI 撰写 开始于 29-9-2020 最后更新于 14-10-2020*/#include #define SolarCell A0 //定义太阳能电池的输入引脚int StCursor =0; // 控制lcd Cursorint A[] ={1, 1, 1, 1, 0}, B[] ={0, 0, 0, 1, 0}, C[] ={0, 0, 0, 1, 1}, D[] ={0, 0, 1, 0, 0}, E[] ={0, 0, 1, 0, 1}, F[] ={0, 0, 1, 1, 0}, G[] ={0, 0, 1, 1, 1}, H[] ={0, 1, 0, 0, 0};int I[] ={0, 1, 0, 0, 1 }, J[] ={0, 1, 0, 1, 0}, K[] ={0, 1, 0, 1, 1}, L[] ={0, 1, 1, 0, 0}, M[] ={0, 1, 1, 0, 1}, N[] ={0, 1, 1, 1, 0}, O[] ={0, 1, 1, 1, 1}, P[ ] ={1, 0, 0, 0, 0};int Q[] ={1, 0, 0, 0, 1}, R[] ={1, 0, 0, 1, 0}, S[] ={1, 0, 0, 1, 1}, T[] ={1, 0, 1, 0, 0}, U[] ={1, 0, 1, 0, 1}, V[] ={ 1, 0, 1, 1, 0}, W[] ={1, 0, 1, 1, 1}, X[] ={1, 1, 0, 0, 0};int Y[] ={1 , 1, 0, 0, 1}, Z[] ={1, 1, 0, 1, 0}, SPACE[] ={1, 1, 1, 1, 1};const int rs =12, en =11, d4 =5, d5 =4, d6 =3, d7 =2;int Cell_Input; // Solar-Cellint Threshold的输入;int info[5]; //接收到的DATALiquidCrystal lcd(rs, en, d4, d5, d6, d7);void setup() { pinMode(A0, INPUT); Serial.begin(9600); lcd.begin(16, 2); lcd.setCursor(0, 0);阈值 =模拟读取(SolarCell)+ 10; lcd.print("准备接收");延迟(5000); lcd.clear();}void BufferClear() { // 清除缓冲区 for (int i =0; i <5; i++) { info[i] =0; }}void check_condition(int received_bits[5], int Binaryalpha[5], char Lcdalpha) {//将接收到的位与数据库进行比较 if (received_bits[0] ==Binaryalpha[0] &&received_bits[1] ==Binaryalpha[1] &&received_bits[2] ==Binaryalpha[2] &&received_bits[3] ==Binaryalpha[3] &&received_bits[4] ==Binaryalpha[4]) { lcd.print(Lcdalpha);光标控制器(); }}void CursorControler() { // 控制光标 StCursor++; if (StCursor ==16) lcd.setCursor(0, 1);}void loop() { Cell_Input =analogRead(SolarCell); if (Cell_Input> Threshold) { // 起始位检测延迟(10); // 计时 (int i =0; i <5; i++) { // 保存数据 if (analogRead(SolarCell)> Threshold) { info[i] =1; } else { 信息[i] =0; } 延迟(10); } check_condition(信息, A, 'A');检查条件(信息,B,'B');检查条件(信息,C,'C');检查条件(信息,D,'D');检查条件(信息,E,'E');检查条件(信息,F,'F');检查条件(信息,G,'G');检查条件(信息,H,'H');检查条件(信息,我,'我');检查条件(信息,J,'J');检查条件(信息,K,'K');检查条件(信息,L,'L');检查条件(信息,M,'M');检查条件(信息,N,'N');检查条件(信息,O,'O');检查条件(信息,P,'P');检查条件(信息,Q,'Q');检查条件(信息,R,'R');检查条件(信息,S,'S');检查条件(信息,T,'T');检查条件(信息,U,'U');检查条件(信息,V,'V');检查条件(信息,W,'W');检查条件(信息,X,'X');检查条件(信息,Y,'Y');检查条件(信息,Z,'Z');检查条件(信息,空格,'');缓冲区清除(); }}

示意图

光电池必须与激光面对面放置才能接收数据
液晶显示:
VSS ---> 接地
VDD ---> Arduino 5V
K ---> 地面
A ---> Arduino 5V
RW ---> 地面
V0/VEE ---> 电位器的 Vout
RS ---> Arduino 数字引脚 12
EN ---> Arduino 数字引脚 11
D4 ---> Arduino 数字引脚 5
D5 ---> Arduino 数字引脚 4
D6 ---> Arduino 数字引脚 3
D7 ---> Arduino 数字引脚 2

太阳能电池:
SC的负极​​接地
SC的正极连接到Arduino模拟引脚A0 用户必须使用键盘和液晶显示器选择他想要发送的内容,在输入每个字母后你应该按下确认按钮并最终按下发送按钮。
液晶显示:
VSS ---> 接地
VDD ---> Arduino 5V
K ---> 地面
A ---> Arduino 5V
RW ---> 地面
V0/VEE ---> 电位器的 Vout
RS ---> Arduino 数字引脚 12
EN ---> Arduino 数字引脚 11
D4 ---> Arduino 数字引脚 6
D5 ---> Arduino 数字引脚 5
D6 ---> Arduino 数字引脚 4
D7 ---> Arduino 数字引脚 3
键盘:
A ---> Arduino 模拟引脚 A2 //所有模拟引脚都用作数字引脚
B ---> Arduino 模拟引脚 A1
C ---> Arduino 数字引脚 9
D ---> Arduino 数字引脚 7
1 ---> Arduino 数字引脚 8
2---> Arduino 数字引脚 10
3---> Arduino 模拟引脚 A3
下拉电阻:
电阻器的第一端连接到数字引脚 8,第二端接地
电阻的第一端连接到数字引脚 10,第二端接地
电阻的第一端连接到模拟引脚A3,第二端接地

激光二极管:
LD的阴极接地
LD的阳极连接到Arduino数字引脚2

制造工艺

  1. 铝激光打标指南
  2. 激光打标指南
  3. 什么是光纤激光打标?
  4. 激光指示器
  5. 半导体激光器
  6. 固态激光器
  7. DVD 播放器
  8. 激光制导导弹
  9. 新型光电激光器每秒发射 300 亿个脉冲
  10. 新的最快光纤传输速度为 1 拍比特/秒
  11. UFO 攻击!
  12. 3D RGB Arduclock