DIY an infrared obstacle avoidance car! (1) Installation of the hardware part
The main thing is to learn the knowledge of single-chip microcomputer. It is relatively simple because of personal strength.
0. Materials used
- Screw nut Dupont wire
- CH340 downloader
- Trolley base
- Infrared sensor module*2
- 51 single chip microcomputer minimum system development board
- L298N motor drive module
The purchased parts are as follows~
1. Start assembly
1.1 Assemble the car base
Follow the instructions for this step. It will not be too difficult. Note that the wiring of the motor should face inwards.
1.2 Assembly of the rest
To be honest, this car does not match well with the rest of the components. Many components are distorted and distorted.
1.3 Wiring
This part is quite magical, you can only install it slowly.
1.3.1 The wiring of the infrared part
Connect to the V5 GND P1.0/P1.1 terminal of the development board from left to right.
1.3.2 The wiring of the motor part has
4 wires connected to the 4 interfaces on both sides of the drive. It is better to remember which interface is for which motor
1.3.3 Wiring between development board and driver The
six wires in the upper left corner of the driver are connected to the microcontroller P2.0 P2.2 P2.1 in turn (note the reverse!) P0.2 P0.1 P0.0
1.3.4 Wiring of the power supply part
finally, the power cord is connected to the three interfaces on the upper right corner of the driver, among which:
- The red wire of the power supply is connected to the switch, and a white wire is drawn from the switch to the rightmost interface
- The power black wire is directly connected to the middle interface
- Finally, connect the left and right interfaces