1. Onboard peripherals
1.1 Infrared receiver
1.2 Infrared obstacle avoidance interface
1.3 Motor drive circuit
1.4 Bluetooth interface
1.5 esp82266 interface
1.6 NRF24L01 interface
1.7 OLED circuit
1.8 JQ8900 interface
1.9 Ultrasonic interface
1.10 Servo interface
1.11 Three independent buttons
1.12 Two LED lights
1.13 Lead out all the pins of the microcontroller
1.14 Comes with reset button
You can use this board as a development board by adding a USB to TTL cable, which is very economical and practical.
2. Function
2.1 Motor forward and reverse rotation:
Two sets of onboard dual H-bridge drive circuits can drive four motors, and each set of motors can achieve forward and reverse rotation.
2.2 PWM control speed:
Each group of motors is externally connected to the IO port of the microcontroller. A total of 8 IO ports are used to control 4 groups of motors. The microcontroller IO output PWM can be used to control the motor speed in different ways and is programmable.
2.3 Manual control:
2.3.1 红外控制:可以通过板子上集成的红外接收头用红外遥控控制,这种控制方法简单,外设少,但干扰性强,信号强度弱,距离短。
2.3.2 蓝牙和wifi控制:还可以通过手机连接蓝牙或者通过esp8266连接wifi控制,这两种方法都是在手机上安装一个软件,需要一个手机,操作简单,信号较强,使用较为舒适。
2.3.3 无线控制:还有一种控制是通过NRF24L01的2.4G传输,这种控制方式需要一对NRF24L01,控制端和接收端下载配套的程序,双方可进行通信。这种方式用遥感电位器输出信号,需要较为复杂的硬件电路。但无论在信号,距离还是手感方面都较为完美。
Remote sensing control chart (here is connected to the development board, there is no other board, you can make a board yourself if necessary)
2.4 Automatic control:
2.4.1 超声波控制:超声波是利用发射和接收的时间来判断距离,可通过编程设置最短距离进行改变智能车的方向。另外超声波搭配了一个SG90舵机,可以在左,中,右三个方向进行旋转,提高了检测障碍的正确性。
2.4.2 红外避障:红外避障是利用一对红外对管,一个发送和一个接收,判断产生距离的时间判断是否前方有障碍物,若时间间隔较短,则有障碍物,改变智能车的方向。
2.5 Real-time display:
The board integrates OLED, which is controlled by IIC and can display the distance of ultrasonic detection in real time and whether it is automatic mode or manual mode.
2.6 Voice broadcast:
The board is externally connected to the JQ8900 voice chip. By copying the required voice in advance, when executing the corresponding program, it sends commands through the first-line serial port to play the corresponding voice.
Supplement: The power supply part uses 2 3.7V lithium batteries. The board integrates 5V and 3.3V regulated sources, which are well adapted to the battery and meet the normal operation of 5V and 3.3V peripherals.
3. Physical objects:
寒假的时候自己在家里做了一个小车,是用开发板接的线,非常的乱,而且接线很复杂,每次使用开发板的时候都要拆掉,再组装的时候非常费时、费力,一直想打一块板子。在B站看到了这个活动,获得了这次机会。于是乎,连夜测量画板子,绘制原理图,绘制PCB,经过一天多的奋战,终于完成了这个项目。今天找莫工领了PCB劵和器件劵,下了单,期待快点到。在这里感谢莫工,感谢立创EDA,遇到你们很开森。这里贴出原来的图,等后续再更新打样的新图,肯定是焕然一新,值得期待。
)
4. Code
The code has been modified repeatedly and there is no problem with the basic functions.
Post some code here
#include
uchar Auto_Hand_Mode_Flag=1;//自动手动模式切换标志(默认手动)
uchar Hand_Mode_Flag=0;//手动模式切换标志(默认红外)
uchar Auto_Mode_Flag = 1;//自动模式切换标志
/*********************************
* @函数名:Mode_Key_Scan
* @描 述:按一下是手动控制,再按一下是自动控制
* @参 数:无
* @返回值:无
*********************************/
void Mode_Key_Scan()//模式按键扫描
{
uchar i;
if(Key1==0)//Key1自动手动模式切换
{
i=20;
while(i--); //延迟消抖
if(Key1==0)
{
if(Auto_Hand_Mode_Flag) //一共两种模式
Auto_Hand_Mode_Flag=0; //不是0就是1
else
Auto_Hand_Mode_Flag=1;//没按一下就换一种模式
}
while(!Key1);
}
}
/*********************************
* @函数名:Control_Method_Key_Scan
* @描 述:手动模式控制方式按键
* @参 数:无
* @返回值:无
*********************************/
void Control_Method_Key_Scan()//控制方式
{
uchar i;
if(Key2==0)//控制方式切换
{
i=20;
while(i--); //延迟消抖
if(Key2==0)
{
if(Hand_Mode_Flag==3) //一共三种控制方式0123
Hand_Mode_Flag=0; //循环
else
Hand_Mode_Flag++; //每次换一种
}
while(!Key2);
}
}
/*********************************
* @函数名:Auto_Mode
* @描 述:自动模式 (超声波避障)
* @参 数:无
* @返回值:无
*********************************/
void Auto_Mode()
{
// static uchar
switch(Auto_Mode_Flag)
{
case 0:
Judge_distance(); //超声波避障
break;
case 1:
Ray_Avoid(); //红外避障
break;
}
//Ray_jiance();
}
/*********************************
* @函数名:Hand_Mode
* @描 述:手动模式工具切换函数,Hand_Mode_Flag选用不同的工具控制
* @参 数:无
* @返回值:无
*********************************/
void Hand_Mode()
{
static uchar Voice_Flag[4]={0};//语音标志
static uchar One_Flag=0;//消除第一次语音播报标志
Control_Method_Key_Scan();//控制方式按键扫描
switch(Hand_Mode_Flag)
{
case 0:
Ray_Hand_Key(); //红外手动按键
Ray_Decode_Ser(); //红外解码函数
if(One_Flag) //程序执行第一次的时候不执行
{
if(Voice_Flag[0]==0)
{
//ES=0;//关闭蓝牙串口中断
JQ8900_Select_TwoCmd_Song(0x01,0x04);//红外遥控
// EX0=1;//打开外部中断0
Voice_Flag[0]=1;
Voice_Flag[1]=0;
Voice_Flag[2]=0;
Voice_Flag[3]=0;
}
}
break;
case 1:
Blue_Hand_Key(); //蓝牙手动模式
if(Voice_Flag[1]==0)
{
One_Flag=1; //再执行红外的时候播报
JQ8900_Select_TwoCmd_Song(0x01,0x05);//蓝牙遥控
Voice_Flag[0]=0;
Voice_Flag[1]=1;
Voice_Flag[2]=0;
Voice_Flag[3]=0;
}
break;
case 2:
NRF24L01_Hand_Key(); //无线手动按键
NRF24L01_Receive();//接收数据的函数
if(Voice_Flag[2]==0)
{
One_Flag=1; //再执行红外的时候播报
// ES=0;//关闭蓝牙串口中断
//EX0=0;//关闭外部中断0
JQ8900_Select_TwoCmd_Song(0x01,0x06);//无线遥控
Voice_Flag[0]=0;
Voice_Flag[1]=0;
Voice_Flag[2]=1;
Voice_Flag[3]=0;
}
break;
case 3:
if(Voice_Flag[3]==0)
{
One_Flag=1; //再执行红外的时候播报
// EX0=0;//关闭外部中断0
JQ8900_Select_TwoCmd_Song(0x01,0x07);//WIFI遥控
// ES=1;//打开蓝牙串口中断
Voice_Flag[0]=0;
Voice_Flag[1]=0;
Voice_Flag[2]=0;
Voice_Flag[3]=1;
}
ESP8266_Hand_Key();//WIFI手动按键
break;
}
}
/*********************************
* @函数名:Auto_Hand_Mode
* @描 述:自动手动模式切换函数Auto_Hand_Mode_Flag为0自动,为1手动
* @参 数:无
* @返回值:无
*********************************/
void Auto_Hand_Mode()//自动手动模式切换
{
static uchar Voice_Flag[2]={0};//语音标志
static uchar One_Flag=0;//消除第一次不语音播报标志
Mode_Key_Scan();//按键扫描切换自动手动
switch(Auto_Hand_Mode_Flag)
{
case 0:
if(Voice_Flag[0]==0) //语音只执行一次
{
EX1 = 1; //打开超声波
One_Flag=1;//第二次,可以播报
JQ8900_Select_TwoCmd_Song(0x01,0x02);//自动模式
Voice_Flag[0]=1;
Voice_Flag[1]=0;
}
Auto_Mode();//自动
break;
case 1:
/*一上电程序进入这里,由于要播放发送机已启动,所以不播放下面的*/
if(One_Flag)//如果等于1播报,否则不播报
{
if(Voice_Flag[1]==0)
{
EX1 = 0; //关闭超声波
Car_Stop();// //由自动模式切换到手动模式,小车需停止
// TR1=0;//关闭定时器1
JQ8900_Select_TwoCmd_Song(0x01,0x03);//手动模式
Voice_Flag[0]=0;
Voice_Flag[1]=1;
}
}
Hand_Mode();//手动
break;
}
}
5. PCB and components
Last time I got a coupon from Mo Gong and placed an order. After two days of waiting, the express delivery arrived as scheduled. SF Express and Postal Express are really fast. I really like it. When I went to pick up the express delivery, I was shocked. The express box was too big!
Post a picture:
After taking it apart, I was shocked again. There were too many components. When I placed the order, I didn't realize how many there were. It is enough to last a long time.
The printed PCB board is also quite nice.
6. Welding
Directly above the picture:
This is after welding without the module:
front:
Back: (Note: This OLED screen is useless, so there is no welding)
This is the module installed
This is tested with external power supply
There are still many modules to be added in the future, so I will update this for today, and will continue to improve them in the future.
I perfected it again today and installed it on the car. Pictured above: (Originally, I planned to use an electric rotor to drill holes, but because I forgot to buy copper posts, I fixed them with tape first)
Doesn't it look much better than before? Not only does it look good, but it is also much more convenient to wire and assemble. It can be disassembled and used as a development board at any time. A simple demonstration video is given below.
Here is the previous complete demo version. Friends who want to see it can go in and have a look.
Bilibili: The full version of the car
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet