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

制作可靠的 Arduino RC 接收机,用于模型和项目

Arduino RC 接收机电路图

首先,让我们看看该系统的电路图。无线通信基于 NRF24L01 收发器模块。

制作可靠的 Arduino RC 接收机,用于模型和项目

发射器不断发送其控制器(摇杆、按钮、电位器和拨码开关)的数据,接收器接收这些数据。关于该 Arduino 发射器的更多工作细节,请参阅我之前的详细教程。

值得注意的是,这个 RC 接收机不一定只能与我制作的这个特定发射器配合工作。它可以与任何由 Arduino 开发板和 NRF24L01 模块组成的类似设置配合使用。

制作可靠的 Arduino RC 接收机,用于模型和项目

这个 RC 接收机的核心是一块 Arduino Pro Mini 开发板。供电方面,我们可以使用 VCC 引脚(接 5V),也可以使用 RAW 引脚(接 6-12V)。请注意 Arduino Pro Mini 有两个版本:我这里使用的工作在 5V,另一个版本工作在 3.3V。而 NRF24L01 模块工作在 3.3V,因此我们需要一个稳压器。这里我使用了 AMS1117 3.3V 稳压器,它可以从 5V 到 12V 的输入中输出 3.3V。

所需元件

NRF24L01 模块通过 SPI 协议与 Arduino 通信,外加两个额外的数字引脚。因此我们还剩下 9 个数字引脚可作为输出通道,其中两个是 RX 和 TX 引脚。值得注意的是,上传草图时这些引脚必须与外部电路断开,所以我通过独立的排针使其可连接/断开。实际上,我们还可以将模拟输入用作数字输出,因此虽然这块 Arduino 板很小,但我们有足够的输出通道。

PCB 设计

为了使电路紧凑,我使用 EasyEDA 免费在线电路设计软件制作了定制 PCB。在这里,我将 8 个通道排列在 5V 和地轨旁边,以便直接连接舵机和 ESC。通道 9 位于单独位置,靠近 Arduino 的 VCC 引脚,可用于连接带有 BEC(电池消除电路)功能的 ESC 为 Arduino 供电(提供 5V)。当然,其他通道也可以用于此目的,因为 VCC 引脚也连接到那些 5V 轨。

制作可靠的 Arduino RC 接收机,用于模型和项目

通道 7 和 8 通过排针中断,如果要使用它们,只需将两个引脚连接起来。编程排针位于右上角,100uF 电容同时为稳压器和 NRF24L01 模块服务。PCB 左下角放置了模拟引脚。

还有一点需要注意:某些 Arduino Pro Mini 开发板的引脚排列可能不同,因此我提供了另一个版本的 PCB,您可以选择与您的开发板匹配的版本。

制作可靠的 Arduino RC 接收机,用于模型和项目

这是该 PCB 的项目文件链接。设计完成后,我生成了制造 PCB 所需的 Gerber 文件。

然后我从 JLCPCB 订购了 PCB(他们也是本视频的赞助商)。

制作可靠的 Arduino RC 接收机,用于模型和项目

我们只需拖放 Gerber 文件,上传后即可在 Gerber 查看器中检查 PCB。如果一切正常,选择所需的 PCB 属性即可下单。注意:如果是您首次在 JLCPCB 下单,最多可获得 5 块 PCB,仅需 2 美元。

制作可靠的 Arduino RC 接收机,用于模型和项目

PCB 组装

几天后 PCB 到货。质量很好,与设计完全一致。

制作可靠的 Arduino RC 接收机,用于模型和项目

现在开始组装 PCB。首先焊接 Arduino 开发板的排针。一种方便的方法是使用面包板固定排针,使开发板在焊接时保持稳固。如前所述,不同开发板的引脚可能略有差异,焊接时请注意。

制作可靠的 Arduino RC 接收机,用于模型和项目

此外,有些地线引脚需要保持空置,因为 PCB 下方有走线。焊接完 Arduino 后,我剪去了多余的引脚长度。

接下来,安装所有其他排针。我们需要公母排针,但具体使用哪种由您决定。不过,建议数字通道使用公排针,因为舵机和 ESC 的连接器通常是母头,这样可以直接插接。

制作可靠的 Arduino RC 接收机,用于模型和项目

稳压器是贴片元件,我用蓝胶(Blue-Tack)将其固定后再焊接。最后,焊接两个电容后,将 NRF24L01 模块插到相应的排针上。

制作可靠的 Arduino RC 接收机,用于模型和项目

根据应用或所需范围,我们可以使用板载天线的普通模块,也可以使用可外接大天线的增强版模块,后者在开阔地带可实现高达 700 米的无线通信。至此,我们的 Arduino RC 接收机已准备就绪,可用于各种用途。

为接收机编程或将 Arduino Pro Mini 连接到电脑,可使用 USB 转串口 UART 接口连接到编程排针。

制作可靠的 Arduino RC 接收机,用于模型和项目

在 Arduino IDE 的工具菜单中,需选择 Arduino Pro or Pro Mini 开发板,选择合适的处理器版本,选择端口,并将编程方式设为“USBasp”。

制作可靠的 Arduino RC 接收机,用于模型和项目

现在我们可以上传代码到 Arduino 了。

示例 1 – Arduino RC 小车

好的,现在来看第一个例子。

制作可靠的 Arduino RC 接收机,用于模型和项目

这是一辆由两个 12V 直流电机组成的简单小车,我在之前的视频中已经展示过其工作原理和制作方法。

另请参阅:L298N 电机驱动器 – Arduino 接口、工作原理、代码、原理图

这次我们将使用新的 Arduino RC 接收机来控制它。驱动直流电机使用 L298N 电机驱动器,供电使用 3 节锂离子电池(约 12V)。

制作可靠的 Arduino RC 接收机,用于模型和项目

所需元件

连接非常简单:电池的 12V 接到接收机的 12V 引脚,驱动器的 6 个控制引脚接到 6 个通道。注意:为了控制电机速度,我们需要向驱动器的 Enable A 和 Enable B 引脚提供 PWM 信号。在我们的接收机中,通道 2、3、6 和 9 可以输出 PWM 信号,这里我将驱动器的 Enable 引脚分别连接到通道 2 和 6。

Arduino 代码

/* Arduino RC Receiver - Car Example by Dejan, www.HowToMechatronics.com Library: TMRh20/RF24, https://github.com/tmrh20/RF24/ */
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define enA 9 // Arduino pin D9 - CH6 on PCB board - PWM output
#define in1 8 // D8 - CH5
#define in2 7 // D7 - CH4
#define in3 6 // D6 - CH3
#define in4 4 // D4 - CH1
#define enB 5 // D5 - CH2 - PWM output
RF24 radio(3, 2); // nRF24L01 (CE, CSN)
const byte address[6] = "00001";
unsigned long lastReceiveTime = 0;
unsigned long currentTime = 0;
// Max size of this struct is 32 bytes
struct Data_Package {
  byte j1PotX;
  byte j1PotY;
  byte j1Button;
  byte j2PotX;
  byte j2PotY;
  byte j2Button;
  byte pot1;
  byte pot2;
  byte tSwitch1;
  byte tSwitch2;
  byte button1;
  byte button2;
  byte button3;
  byte button4;
};
Data_Package data; //Create a variable with the above structure
int steering, throttle;
int motorSpeedA = 0;
int motorSpeedB = 0;
void setup() {
  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  //Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_LOW);
  radio.startListening(); // Set the module as receiver
  resetData();
}
void loop() {
  // Check whether we keep receving data, or we have a connection between the two modules
  currentTime = millis();
  if ( currentTime - lastReceiveTime > 1000 ) {
    // If current time is more then 1 second since we have recived the last data, that means we have lost connection
    resetData(); // If connection is lost, reset the data. It prevents unwanted behavior, for example if a drone jas a throttle up, if we lose connection it can keep flying away if we dont reset the function
  }
  // Check whether there is data to be received
  if (radio.available()) {
    radio.read(&data, sizeof(Data_Package)); // Read the whole data and store it into the 'data' structure
    lastReceiveTime = millis(); // At this moment we have received the data
  }
  // Parse the data from the Joystic 1 to the throttle and steering variables
  throttle = data.j1PotY;
  steering = data.j1PotX;
  // Throttle used for forward and backward control
  // Joystick values: 0 to 255; down = 0; middle = 127; up = 255
  if (throttle < 110) {
    // Set Motor A backward
    digitalWrite(in1, HIGH);
    digitalWrite(in2, LOW);
    // Set Motor B backward
    digitalWrite(in3, HIGH);
    digitalWrite(in4, LOW);
    // Convert the declining throttle readings for going backward from 110 to 0 into 0 to 255 value for the PWM signal for increasing the motor speed
    motorSpeedA = map(throttle, 110, 0, 0, 255);
    motorSpeedB = map(throttle, 110, 0, 0, 255);
  } else if (throttle > 140) {
    // Set Motor A forward
    digitalWrite(in1, LOW);
    digitalWrite(in2, HIGH);
    // Set Motor B forward
    digitalWrite(in3, LOW);
    digitalWrite(in4, HIGH);
    // Convert the increasing throttle readings for going forward from 140 to 255 into 0 to 255 value for the PWM signal for increasing the motor speed
    motorSpeedA = map(throttle, 140, 255, 0, 255);
    motorSpeedB = map(throttle, 140, 255, 0, 255);
  }
  // If joystick stays in middle the motors are not moving
  else {
    motorSpeedA = 0;
    motorSpeedB = 0;
  }
  // Steering used for left and right control
  if (steering < 110) {
    // Convert the declining steering readings from 140 to 255 into increasing 0 to 255 value
    int xMapped = map(steering, 110, 0, 0, 255);
    // Move to left - decrease left motor speed, increase right motor speed
    motorSpeedA = motorSpeedA - xMapped;
    motorSpeedB = motorSpeedB + xMapped;
    // Confine the range from 0 to 255
    if (motorSpeedA < 0) {
      motorSpeedA = 0;
    }
    if (motorSpeedB > 255) {
      motorSpeedB = 255;
    }
  }
  if (steering > 140) {
    // Convert the increasing steering readings from 110 to 0 into 0 to 255 value
    int xMapped = map(steering, 140, 255, 0, 255);
    // Move right - decrease right motor speed, increase left motor speed
    motorSpeedA = motorSpeedA + xMapped;
    motorSpeedB = motorSpeedB - xMapped;
    // Confine the range from 0 to 255
    if (motorSpeedA > 255) {
      motorSpeedA = 255;
    }
    if (motorSpeedB < 0) {
      motorSpeedB = 0;
    }
  }
  // Prevent buzzing at low speeds (Adjust according to your motors. My motors couldn't start moving if PWM value was below value of 70)
  if (motorSpeedA < 70) {
    motorSpeedA = 0;
  }
  if (motorSpeedB < 70) {
    motorSpeedB = 0;
  }
  analogWrite(enA, motorSpeedA); // Send PWM signal to motor A
  analogWrite(enB, motorSpeedB); // Send PWM signal to motor B
}
void resetData() {
  // Reset the values when there is no radio connection - Set initial default values
  data.j1PotX = 127;
  data.j1PotY = 127;
  data.j2PotX = 127;
  data.j2PotY = 127;
  data.j1Button = 1;
  data.j2Button = 1;
  data.pot1 = 1;
  data.pot2 = 1;
  data.tSwitch1 = 1;
  data.tSwitch2 = 1;
  data.button1 = 1;
  data.button2 = 1;
  data.button3 = 1;
  data.button4 = 1;
}

代码说明: 首先包含 SPI 和 RF24 库,定义引脚、无线电对象和数据结构(用于存储来自发射器的传入数据)。在 setup 部分定义引脚输出并启动无线电通信。更多细节请参阅我详细的 NRF24L01 教程。

在 loop 部分,我们不断检查是否接收到数据,如果有则读取传入数据。查看发射器代码可知,它读取所有控制器(摇杆、电位器、按钮)的数据,并作为单个数据包发送给接收器。

读取数据后,我们可以随意处理。本例中,使用摇杆 1 的 Y 轴值控制油门,X 轴值控制转向。摇杆值范围 0-255。向下推摇杆设置驱动器控制引脚使小车后退,并用油门值控制速度。前进、左转、右转同理。我在之前有详细教程解释小车工作原理。代码底部的 resetData() 自定义函数将所有值重置为初始默认值,以便在无线电通信丢失时小车停止运动。

示例 2 – Arduino RC 接收机控制舵机和无刷电机

好的,现在进行第二个示例:使用这个 Arduino RC 接收机控制舵机和无刷电机。

制作可靠的 Arduino RC 接收机,用于模型和项目

控制无刷电机需要 ESC(电子调速器)。Arduino 通过单个引脚与 ESC 通信,发送特定的 PWM 信号,ESC 据此控制电机转速。ESC 通过同一连接的 BEC 功能提供 5V,也可为接收机供电。

另请参阅:Arduino 无刷电机控制教程 | ESC | BLDC

舵机电机的连接方式与 ESC 相同,可直接插在任何可用通道上。

制作可靠的 Arduino RC 接收机,用于模型和项目

所需元件

控制舵机和通过 ESC 控制无刷电机的输入信号几乎相同。它们使用特定的 50Hz PWM 信号,可使用 Arduino Servo 库轻松生成。

注意: 在此设置中使用 MG996R 舵机可能会导致电路问题并烧毁 Arduino Pro Mini。它们可能消耗更大电流,导致 5V 轨出现电压尖峰。Arduino Pro Mini 的 5V 引脚最高可承受 5.5V,但尖峰发生时可能烧毁 Arduino。我在测试时遇到过此问题,评论区也有用户报告相同情况。解决方法可能是在舵机处添加更大的去耦电容,但我尚未测试,不确定。请知悉此问题。

另一方面,示例中使用的另外两个 MG996R 舵机未烧毁 Arduino,可能是因为它们未产生如此高的尖峰。我也用 4 个较小的 S90 舵机测试过,没有问题。

另请参阅:舵机工作原理及如何使用 Arduino 控制舵机

Arduino 代码

/* DIY RC Receiver - Servos and Brushless motors control by Dejan, www.HowToMechatronics.com Library: TMRh20/RF24, https://github.com/tmrh20/RF24/ */
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Servo.h>
RF24 radio(3, 2); // nRF24L01 (CE, CSN)
const byte address[6] = "00001";
unsigned long lastReceiveTime = 0;
unsigned long currentTime = 0;
Servo esc; // create servo object to control the ESC
Servo servo1;
Servo servo2;
int escValue, servo1Value, servo2Value;
// Max size of this struct is 32 bytes - NRF24L01 buffer limit
struct Data_Package {
  byte j1PotX;
  byte j1PotY;
  byte j1Button;
  byte j2PotX;
  byte j2PotY;
  byte j2Button;
  byte pot1;
  byte pot2;
  byte tSwitch1;
  byte tSwitch2;
  byte button1;
  byte button2;
  byte button3;
  byte button4;
};
Data_Package data; //Create a variable with the above structure
void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_LOW);
  radio.startListening(); // Set the module as receiver
  resetData();
  esc.attach(10); // Arduino digital pin D10 - CH9 on PCB board
  servo1.attach(4); // D4 - CH1
  servo2.attach(5); // D5 - CH2
}
void loop() {
  // Check whether we keep receving data, or we have a connection between the two modules
  currentTime = millis();
  if ( currentTime - lastReceiveTime > 1000 ) {
    // If current time is more then 1 second since we have recived the last data, that means we have lost connection
    resetData(); // If connection is lost, reset the data. It prevents unwanted behavior, for example if a drone jas a throttle up, if we lose connection it can keep flying away if we dont reset the function
  }
  // Check whether there is data to be received
  if (radio.available()) {
    radio.read(&data, sizeof(Data_Package)); // Read the whole data and store it into the 'data' structure
    lastReceiveTime = millis(); // At this moment we have received the data
  }
  // Controlling servos
  servo1Value = map(data.j2PotX, 0, 255, 0, 180); // Map the receiving value form 0 to 255 to 0 to 180(degrees), values used for controlling servos
  servo2Value = map(data.j2PotY, 0, 255, 0, 180);
  servo1.write(servo1Value);
  servo2.write(servo2Value);
  // Controlling brushless motor with ESC
  escValue = map(data.j1PotY, 127, 255, 1000, 2000); // Map the receiving value form 127 to 255 to 1000 to 2000, values used for controlling ESCs
  esc.writeMicroseconds(escValue); // Send the PWM control singal to the ESC
}
void resetData() {
  // Reset the values when there is no radio connection - Set initial default values
  data.j1PotX = 127;
  data.j1PotY = 127;
  data.j2PotX = 127;
  data.j2PotY = 127;
  data.j1Button = 1;
  data.j2Button = 1;
  data.pot1 = 1;
  data.pot2 = 1;
  data.tSwitch1 = 1;
  data.tSwitch2 = 1;
  data.button1 = 1;
  data.button2 = 1;
  data.button3 = 1;
  data.button4 = 1;
}

接收发射器数据后,我们将 0-255 的值映射为 0-180 度以通过 write() 函数控制舵机。同样,将 ESC 控制数据映射为 1000-2000。本例中,我们从摇杆 1 的中点(127)到向上(255)控制 ESC,因此将 127-255 映射为 1000-2000。使用 Servo 库的 writeMicroseconds() 函数发送 PWM 信号到 ESC,从而控制无刷电机从最小到最大转速。

另请参阅:Arduino RC 飞机 | 100% DIY

这就是我们如何控制 RC 飞机、小车、船等,因为它们通常使用这种类型的电机、舵机和无刷电机。

示例 3 – RC 车模控制

这辆 RC 小车自带控制器,可控制前轮左右转向以及前进后退。

制作可靠的 Arduino RC 接收机,用于模型和项目

但作为廉价 RC 小车,其控制是数字式的,即要么全左/全右,要么全速前进/后退。不管怎样,我拆解了小车查看内部结构,以及如何植入 Arduino RC 接收机进行控制。

制作可靠的 Arduino RC 接收机,用于模型和项目

拆开电子元件后,我发现两个电机实际上是工作在 5V 的简单直流电机。甚至控制转向的前电机也是简单的连续旋转直流电机。

既然我们已经知道如何控制直流电机,用我们的 DIY Arduino 接收机替换这块电路板就很简单了。除了接收机,我们只需要一个能同时驱动两个电机的电机驱动器。选项很多,甚至可以用第一个示例中的 L298N 驱动器。

制作可靠的 Arduino RC 接收机,用于模型和项目

但 L298N 对此应用太大,所以我选择了 MX1508 电机驱动器。这是一个简单的双直流电机驱动器,具有 H 桥和 PWM 控制。它有 4 个控制输入引脚、4 个电机引脚和 2 个电源引脚。

制作可靠的 Arduino RC 接收机,用于模型和项目

我从 RC 小车电路板上拆下电机连接线并焊接到驱动器上。背面焊接电源引脚,剩下的就是将驱动器与接收机连接。该 RC 小车的电源来自底部的 4.8V 镍镉电池。

制作可靠的 Arduino RC 接收机,用于模型和项目

用跳线将这些引脚连接到 Arduino 的 VCC 引脚,并将驱动器的 4 个控制输入引脚连接到 4 个数字通道。如前所述,该驱动器支持 PWM 控制,所以对于电机 B(后电机),我使用了 PWM 通道 2 和 3。

制作可靠的 Arduino RC 接收机,用于模型和项目

所需元件

该 RC 小车的代码与第一个示例非常相似。

/* Arduino RC Receiver - RC Model control by Dejan , www.HowToMechatronics.com Library: TMRh20/RF24, https://github.com/tmrh20/RF24/ */
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define in3 5 // D5 - CH2 - PWM output
#define in4 6 // D6 - CH3 - PWM output
#define in1 7 // D7 - CH4
#define in2 8 // D8 - CH5
RF24 radio(3, 2); // nRF24L01 (CE, CSN)
const byte address[6] = "00001";
unsigned long lastReceiveTime = 0;
unsigned long currentTime = 0;
// Max size of this struct is 32 bytes
struct Data_Package {
  byte j1PotX;
  byte j1PotY;
  byte j1Button;
  byte j2PotX;
  byte j2PotY;
  byte j2Button;
  byte pot1;
  byte pot2;
  byte tSwitch1;
  byte tSwitch2;
  byte button1;
  byte button2;
  byte button3;
  byte button4;
};
Data_Package data; //Create a variable with the above structure
int steering, throttle;
int motorSpeedA = 0;
int motorSpeedB = 0;
void setup() {
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_LOW);
  radio.startListening(); // Set the module as receiver
  resetData();
}
void loop() {
  // Check whether we keep receving data, or we have a connection between the two modules
  currentTime = millis();
  if ( currentTime - lastReceiveTime > 1000 ) {
    // If current time is more then 1 second since we have recived the last data, that means we have lost connection
    resetData(); // If connection is lost, reset the data. It prevents unwanted behavior, for example if a drone jas a throttle up, if we lose connection it can keep flying away if we dont reset the function
  }
  // Check whether there is data to be received
  if (radio.available()) {
    radio.read(&data, sizeof(Data_Package)); // Read the whole data and store it into the 'data' structure
    lastReceiveTime = millis(); // At this moment we have received the data
  }
  // Parse the data from the Joystic 1 to the steering and throttle variables
  steering = data.j2PotX;
  throttle = data.j1PotY;
  // Throttle used for forward and backward control
  if (throttle < 110) {
    // Convert the declining throttle readings for going backward from 110 to 0 into 0 to 255 value for the PWM signal for increasing the motor speed
    motorSpeedB = map(throttle, 110, 0, 0, 255);
    // Set Motor B backward
    analogWrite(in3, motorSpeedB);
    digitalWrite(in4, LOW);
  } else if (throttle > 140) {
    // Convert the increasing throttle readings for going forward from 140 to 255 into 0 to 255 value for the PWM signal for increasing the motor speed
    motorSpeedB = map(throttle, 140, 255, 0, 255);
    // Set Motor B forward
    digitalWrite(in3, LOW);
    analogWrite(in4, motorSpeedB);
  }
  // If joystick stays in middle the motors are not moving
  else {
    digitalWrite(in3, HIGH);
    digitalWrite(in4, HIGH);
  }
  // steering used for left and right control
  if (steering < 110) {
    digitalWrite(in1, HIGH);
    digitalWrite(in2, LOW);
  }
  if (steering > 140) {
    digitalWrite(in1, LOW);
    digitalWrite(in2, HIGH);
  }
  // If joystick stays in middle the motors are not moving
  else {
    digitalWrite(in1, HIGH);
    digitalWrite(in2, HIGH);
  }
}
void resetData() {
  // Reset the values when there is no radio connection - Set initial default values
  data.j1PotX = 127;
  data.j1PotY = 127;
  data.j2PotX = 127;
  data.j2PotY = 127;
  data.j1Button = 1;
  data.j2Button = 1;
  data.pot1 = 1;
  data.pot2 = 1;
  data.tSwitch1 = 1;
  data.tSwitch2 = 1;
  data.button1 = 1;
  data.button2 = 1;
  data.button3 = 1;
  data.button4 = 1;
}

我们使用摇杆数据控制 RC 小车的油门和转向。后退时使用 analogWrite() 向驱动器的 Input3 引脚发送 PWM 信号,同时 Input4 保持 LOW。前进则相反。摇杆居中时,向驱动器发送刹车/停止命令。转向电机同理,但不需要 analogWrite(),因为不需要控制其速度。

上传草图后,我重新组装了 RC 小车。将小驱动器放入内部外壳,用螺丝固定其余部件。重新连接接收机与驱动器,将接收机放入外壳下方(有足够空间)。

制作可靠的 Arduino RC 接收机,用于模型和项目

这样我们不仅将 RC 小车改装为由 DIY RC 发射机控制,还通过添加 PWM 控制改进了它,现在可以控制车速。如果您想改装的 RC 模型使用舵机和无刷电机而非直流电机,可参考第二个示例的方法。

希望您喜欢这个教程并学到新知识。欢迎在下方评论区提问,别忘了查看我的 Arduino 项目合集。

制造工艺

  1. DIY 家酿温控系统:Arduino 监测与调节发酵温度
  2. 实验室级热电偶精密测温与记录:树莓派接 ADS1118
  3. Arduino UNO 驱动 16x2 LCD 实现动画与小游戏
  4. Arduino 与智能手机打造智能电压表——简单易做的 DIY 项目
  5. Arduino DIY 电压表:Nokia 5110 屏幕显示,手把手教学
  6. Python 3 控制 Arduino UNO - 串口通信点亮内置 LED 入门教程
  7. 使用 Arduino Nano 和 RDA8057M 制作紧凑型 FM 收音机
  8. 可编程三轴机械臂套件:Arduino + 蓝牙 本地/远程双模控制
  9. CAD模型驱动金属制造项目成功的核心逻辑
  10. Arduino MKR1000 开发板详解:引脚定义、Wi-Fi/加密芯片、供电方式与上手指南
  11. CNC路由器 vs CNC激光切割机:DIY手作项目该如何选择?
  12. Twister高速车床:抛光去毛刺动力增50%与再生控制