Skip to content

Latest commit

 

History

History
290 lines (223 loc) · 8.07 KB

README.md

File metadata and controls

290 lines (223 loc) · 8.07 KB

Small Car Using Arduino Pro Mini and ESP8266

The Small Car can be controlled with infrared and WIFI.

​Components

  • Arduino Pro Mini x1
  • ESP8266-01S x1
  • Motor Drive:L298N x1
  • IR Kit: Receiver and Remote Controller
    • Receiver:VS1838B x1
    • Remote Controller: 21 Keys x1
  • Ultrasonic Sensor:HC-SR04 x1
  • Shift Register:74HC595N x1
  • Speed Detection
    • Encoder Wheel x2
    • H206 Optical Interrupter Sensor x2
  • Buzzer(active) x1
  • LED: 5mm Yellow x2
  • Resistor: 220Ω x2, 100K x1
  • Capacitance:47μF x1, 0.1μF x1
  • 2WD Robotic Car Kit (2 wheels, 2 motors, and a chassis) x1
  • Power: 7.4V 800mAh Lithium Battery x1
  • 400-Point Breadboard x2
  • Connecting Wires and Jumper Wires
  • FTD1232-1 mini-USB to TTL converter x1

Arduino Libraries

Arduino UNO

ESP8266

Arduino Sketches

  1. SmallCar_Arduino.ino

    • Remote Controller: IR and WIFI
    • Web App:Control Buttons only
  2. SmallCar_Arduino_WIFI.ino

    • Remote Controller: WIFI only
    • Web App:Control Buttons, the obstacle distance, the car speed

Layout

400-Point Breadboards

Breadboard 1

  • IR Receiver, Ultrasonic Sensor,LEDs,Resistor,Buzzer,74HC595
Breadboard 1 Arduino Pro Mini
+5V VCC
GND GND

Breadboard 2

  • Arduino Pro Mini,Capacitancs
Breadboard 2 L298N
+5V +5V
GND GND

IR Receiver VS1838B

#define IR_RECEIVE_PIN 7
IR Receiver
out Arduino Pro Mini Pin 7
VCC Breadboard 1 +5
GND Breadboard 1 GND

Ultrasonic Sensor:HC-SR04

// Ultrasonic - Arduino
#define TRIG_PIN 8  // Trigger
#define ECHO_PIN 9  // Echo
HC-SR04
VCC Breadboard 1 +5V
Trigger Arduino Pro Mini Pin 8
Echo Arduino Pro Mini Pin 9
GND Breadboard 1 GND

Yellow LEDS

// Led - 74HC595 
#define LED_LEFT_PIN_SR 6 // +
#define LED_RIGHT_PIN_SR 5 // +
Left LED
+ 220Ω ->74HC595 Pin 6
- Breadboard 1 GND
Right LED
+ 220Ω -> 74HC595 Pin 5
- Breadboard 1 GND

Active Buzzer

#define BUZZER_PIN_SR 0 // 0 is the No. of Shift Register,P15
Active Buzzer
+ 74HC595 Pin 15
- Breadboard 1 GND

Shift Register:74HC595N

#define LATCH_PIN 13
#define CLOCK_PIN 4
#define DATA_PIN 12
74HC595N
QB Pin 1 L298N IN4
QC Pin 2 L298N IN3
QD Pin 3 L298N IN2
QE Pin 4 L298N IN1
QF Pin 5 Right LED
QG Pin 6 Left LED
GND Pin 8 Breadboerd 1 GND
SRCLR Pin10 Breadboerd 1 GND
SRCLK(Shift Register Clock) Clock Pin 11 Arduino Pin 4
RCLK(Register Clock) Latch Pin 12 Arduino Pro Mini Pin 13
SER(Serial Input) Data Pin 14 Arduino Pro Mini Pin 12
QA Pin 15 Active Buzzer
VCC Pin 16 Breadboerd 1 +5V

To configure 74HC595 to have low pin outputs at power on

74HC595N
QE Pin 13 47μF -> Breadboard 1 +5
100K -> Breadboard 1 GND
VCC Pin 16(Breadboard 1 +5V) 0.1μF -> Breadboard 2 GND

H206 Optical Interrupter Sensor

H206
Right H206 OUT Arduino Pro Mini Pin 3
Left H206 OUT Arduino Pro Mini Pin 2
VCC Breadboard 1 +5V
GND Breadboard 1 GND

L298N

// L298N - 74HC595
#define MOTOR_LEFT_FORWARD_PIN_SR 4  // IN1 OUT1 -
#define MOTOR_LEFT_BACK_PIN_SR 3     // IN2 OUT2 +
#define MOTOR_RIGHT_FORWARD_PIN_SR 1 // IN4 OUT4 +
#define MOTOR_RIGHT_BACK_PIN_SR 2    // IN3 OUT3 -
// L298N - Arduino
#define LEFT_PWM_PIN 6  // ENB
#define RIGHT_PWM_PIN 5  // ENA
L298N
IN4 74HC595N Pin1
IN3 74HC595N Pin2
IN2 74HC595N Pin3
IN1 74HC595N Pin4
OUT4 Left Motor +
OUT3 Left Motor -
OUT2 Right Motor +
OUT1 Right Motor -
ENB Arduino Pro Mini Pin 6
ENA Arduino Pro Mini Pin 5
VCC Lithium Battery +
GND Lithium Battery - and Breadboard 2 GND
+5V Breadboard 2 +5V

Arduino Pro Mini

Arduino Pro Mini
Pin 13 74HC595 LATCH_PIN 12
Pin 12 74HC595 DATA_PIN 14
Pin 11 ESP8266 RX
Pin 10 ESP8266 TX
VCC Breadboard 1 +5v
Vin Breadboard 2 +5v
Pin 9 HC-SR04 Echo
Pin 8 HC-SR04 Trigger
Pin 7 IR Receiver out
Pin 6 L298N ENB
Pin 5 L298N ENA
Pin 4 74HC595 CLOCK_PIN 11
Pin 3 Right H206, intercept 1
Pin 2 Left H206, intercept 0
GND Breadboard 1 GND

ESP8266-01S

// Softserial: ESP8266 - Arduino 
#define SS_RX_PIN 10
#define SS_TX_PIN 11
ESP8266
VCC3.3 Breadboard 1 +3.3V
RX Arduino Pro Mini Pin 11
TX Arduino Pro Mini Pin 10
EN(CH_PD) Breadboard 1 +5V
GND Breadboard 1 GND

FTD1232-1 mini-USB to TTL converter

Uploading the Sketch to the Arduino Pro Mini

FTD1232-1 Arduino Pro Mini
GND GND
VCC VCC
TXD RXD
RXD TXD
DTR GRN(DTR)

Uploading the Sketch to the ESP8266-01

FTD1232-1 ESP8266
RXD TX
TXD RX
VCC CH_PD
GND IO0(GPIO_0)(pull-down: USRT Download)
VCC VCC
GND GND