Hello大家好,我是伊娃老師,今天介紹DIY大神KendinYap的無人機DIY。
很多做飛機的都是靠K大啟蒙的,我們來看他用Arduino做一個無人機。
在這里我特別佩服K大的是他直接用焊接電路的PCB板加工成無人機的機身,再直接焊接需要的電路,真可以說是一舉兩得,省了材料也省了重量。
解說過程大家可以看看視頻,一共15分鐘,講解遙控器跟無人機兩部分。
視頻中用到的工具跟材料,我都對應了某寶關鍵字找到了,大家覺得有幫助的話,就幫我多轉發、關注吧,最下面也可以點喜歡作者支持我喲~
準備工具
焊槍+焊錫
尖嘴鉗
剝線錢
臺鋸
臺鉆
筆刀
平口鉗夾具
熱熔膠槍+膠
雙面膠
螺絲刀
膠帶
遙控器制作
1 xArduinoNano
2 x雙軸按鍵傳感器
1 x3檔搖臂開關
1 x100uF電容
1 xNRF24L01 + PA大功率無線收發模塊
1 x7.4v460Mah鋰電池
1 x680R電阻
若干x5mmKT板、PCB板、2.54插座、電子連接線
// 6 Channel Transmitter | 6 Kanal Verici #include #include #include const uint64_t pipeOut = 0xE9E8F0F0E1LL; //IMPORTANT: The same as in the receiver 0xE9E8F0F0E1LL | Bu adres al?c? ile ayn? olmal? RF24 radio(9, 10); // select CE,CSN pin | CE ve CSN pinlerin se?imi struct Signal { byte throttle; byte pitch; byte roll; byte yaw; byte aux1; byte aux2;}; Signal data; void ResetData() { data.throttle = 12; // Motor stop | Motor Kapal? (Signal lost position | sinyal kesildi?indeki pozisyon) data.pitch = 127; // Center | Merkez (Signal lost position | sinyal kesildi?indeki pozisyon) data.roll = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon) data.yaw = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon) data.aux1 = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon) data.aux2 = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon)} void setup(){ //Start everything up radio.begin(); radio.openWritingPipe(pipeOut); radio.setAutoAck(false); radio.setDataRate(RF24_250KBPS); radio.setPALevel(RF24_PA_HIGH); radio.stopListening(); //start the radio comunication for Transmitter | Verici olarak sinyal ileti?imi ba?lat?l?yor ResetData(); } // Joystick center and its borders | Joystick merkez ve s?n?rlar? int mapJoystickValues(int val, int lower, int middle, int upper, bool reverse){ val = constrain(val, lower, upper); if ( val < middle ) val = map(val, lower, middle, 0, 128); else val = map(val, middle, upper, 128, 255); return ( reverse ? 255 - val : val );} void loop(){ // Control Stick Calibration | Kumanda Kol Kalibrasyonlar? // Setting may be required for the correct values of the control levers. | :Kontrol kollar?n do?ru de?erleri i?in ayar gerekebilir. data.throttle = mapJoystickValues( analogRead(A0), 12, 524, 1020, true ); // "true" or "false" for signal direction | "true" veya "false" sinyal y?nünü belirler data.roll = mapJoystickValues( analogRead(A3), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler data.pitch = mapJoystickValues( analogRead(A2), 12, 524, 1020, false ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler data.yaw = mapJoystickValues( analogRead(A1), 12, 524, 1020, false ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler data.aux1 = mapJoystickValues( analogRead(A6), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler data.aux2 = mapJoystickValues( analogRead(A7), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler radio.write(&data, sizeof(Signal));}
接收器制作
1 xArduinoNano
1 x7.4v460Mah鋰電池
1 xNRF24L01 + PA大功率無線收發模塊
1 x100uF電容
若干xPCB板、2.54插座、2.54排針、電子連接線
// 6 Channel Transmitter | 6 Kanal Verici #include #include #include const uint64_t pipeOut = 0xE9E8F0F0E1LL; //IMPORTANT: The same as in the receiver 0xE9E8F0F0E1LL | Bu adres al?c? ile ayn? olmal? RF24 radio(9, 10); // select CE,CSN pin | CE ve CSN pinlerin se?imi struct Signal { byte throttle; byte pitch; byte roll; byte yaw; byte aux1; byte aux2;}; Signal data; void ResetData() { data.throttle = 12; // Motor stop | Motor Kapal? (Signal lost position | sinyal kesildi?indeki pozisyon) data.pitch = 127; // Center | Merkez (Signal lost position | sinyal kesildi?indeki pozisyon) data.roll = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon) data.yaw = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon) data.aux1 = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon) data.aux2 = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon)} void setup(){ //Start everything up radio.begin(); radio.openWritingPipe(pipeOut); radio.setAutoAck(false); radio.setDataRate(RF24_250KBPS); radio.setPALevel(RF24_PA_HIGH); radio.stopListening(); //start the radio comunication for Transmitter | Verici olarak sinyal ileti?imi ba?lat?l?yor ResetData(); } // Joystick center and its borders | Joystick merkez ve s?n?rlar? int mapJoystickValues(int val, int lower, int middle, int upper, bool reverse){ val = constrain(val, lower, upper); if ( val < middle ) val = map(val, lower, middle, 0, 128); else val = map(val, middle, upper, 128, 255); return ( reverse ? 255 - val : val );} void loop(){ // Control Stick Calibration | Kumanda Kol Kalibrasyonlar? // Setting may be required for the correct values of the control levers. | :Kontrol kollar?n do?ru de?erleri i?in ayar gerekebilir. data.throttle = mapJoystickValues( analogRead(A0), 12, 524, 1020, true ); // "true" or "false" for signal direction | "true" veya "false" sinyal y?nünü belirler data.roll = mapJoystickValues( analogRead(A3), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler data.pitch = mapJoystickValues( analogRead(A2), 12, 524, 1020, false ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler data.yaw = mapJoystickValues( analogRead(A1), 12, 524, 1020, false ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler data.aux1 = mapJoystickValues( analogRead(A6), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler data.aux2 = mapJoystickValues( analogRead(A7), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler radio.write(&data, sizeof(Signal));}
無人機制作
1 xKK2.15飛控
4 x1806 2380KV無刷電機
4 x4045螺旋槳
4 x12A電子調速器
6 x塑料六角隔離柱
若干x5mmKT板、PCB板、M3螺絲、M3墊片、M3螺母、2mm電線對接頭、熱縮管、JST母頭插座、電子連接線、T型插頭
審核編輯黃宇
-
無人機
+關注
關注
230文章
10470瀏覽量
181108 -
Arduino
+關注
關注
188文章
6472瀏覽量
187349
發布評論請先 登錄
相關推薦
評論