This is the third iteration of our robots at AISVN as described in the history further down. It used the Arduino Leonardo and incorporates:
- Motorshield L298 with buzzer on pin4
- 4 DoF robot arm with 4 servos on pin A0 to A3
- Bluetooth Low Energy connection with pin 0 and 1 (Serial1)
- PWM motor control on pin 10 to 13
- 1602 LCD display over I2C on pin 2 and 3 SDA SCL
- MPU6050 gyroscope for location control on I2C
- Ultrasonic distance with pin 7 (trigger) and pin 8 (echo/response)
- PS2X controller at pin 5 SC, 6 CLK, A4 DAT and A5 CMD
We ordered the following materials for all students among others at CỬA HÀNG IC ĐÂY RỒI. This gives a common ground for further experiments both in software and hardware:
nr | name | amount | unit price | price | link |
---|---|---|---|---|---|
1 | Arduino Leonardo | 1 | 125.000 VND | 125.000 VND | link icdayroi.com |
2 | Robot base 4 wheels | 1 | 140.000 VND | 140.000 VND | link icdayroi.com |
3 | Motor Shield L298 | 1 | 120.000 VND | 120.000 VND | link icdayroi.com |
4 | Bluetooth AT-09 | 1 | 75.000 VND | 75.000 VND | link icdayroi.com |
5 | Battery 18650 3.7V | 2 | 35.000 VND | 70.000 VND | link icdayroi.com |
6 | Battery holder 2C 18650 | 1 | 7.000 VND | 7.000 VND | link icdayroi.com |
7 | Power switch MTS 102 | 1 | 4.000 VND | 4.000 VND | link icdayroi.com |
8 | Battery voltage display | 1 | 22.000 VND | 22.000 VND | link icdayroi.com |
9 | Servo SG90 | 5 | 29.000 VND | 145.000 VND | link icdayroi.com |
10 | Ultrasonic module HC-SR04 | 1 | 20.000 VND | 20.000 VND | link icdayroi.com |
11 | Robot 4DOF kit | 1 | 246.000 VND | 246.000 VND | link lazada.vn |
12 | Wires DuPont MF and FF | 20 | 300 VND | 6.000 VND | link thegioiic.com |
13 | Voltmeter for Battery | 1 | 21.000 VND | 21.000 VND | link thegioiic.com |
14 | Display 1602 3.3V white on blue | 1 | 32.000 VND | 32.000 VND | link thegioiic.com |
15 | I2C serial to parallel adapter | 1 | 13.500 VND | 13.500 VND | link thegioiic.com |
1.046.500 VND |
Apart from these materials for 1.046.500 VND or 45 USD we need some time to assemble all parts - and then to program the robot car! Over the months of development several changes and standardizations took place. We ended up with a standard as platform at AISVN, to be found in the respective github project.
- Assemble the robot
- Connect the motors to M1 and M4 on the L293D shield
- Connect the bluetooth module pin TXD to pin 8 of the motorshield
how to control with 10 keys
Key | Character | Mode 1 | Mode 2 | Mode 3 | Mode 4 |
---|---|---|---|---|---|
↑ | F | forward | forward | ||
↓ | B | backward | backward | ||
← | L | left | left | left | |
→ | R | right | right | right | |
Select | M | Menu+ | Menu+ | Menu+ | Menu+ |
Start | S | Start | Return | toggle sound | start autonomous |
△ | T | turbo | up | ||
○ | C | faster | open | ||
X | X | Stop | down | Stop | |
☐ | Q | slower | close |
- 'F' forward
- 'B' backward
- 'L' turn left
- 'R' turn right
- 'M' select (menu)
- 'S' start
- 'T' triangle
- 'C' circle
- 'X' button X
- 'Q' sQuare
pin | general | used for | note |
---|---|---|---|
0 | RX | Bluetooth RX | |
1 | TX | Bluetooth TX | has voltage divider 1kΩ/2kΩ for 3.3V |
2 | SDA | I2C | Display 1602 and |
3~ | SCL | I2C | MPU 6050 gyroscope |
4 | buzzer | acoustic feedback | |
5~ | PS2X CS | Chip Select (SPI SS) | |
6~ | PS2X CLK | Clock (SPI SCLK) | |
7 | Ultrasonic trigger | ||
8 | Ultrasonic echo | ||
9~ | Servo ultrasonic | ||
10~ | E1 | enable Moter 1 (PWM) | |
11~ | E2 | enable Motor 2 (PWM) | |
12 | M1 | forward/backward | |
13 | LED | M2 | forward/backward |
A0 | Servo left-right | Robotarm 5-175 | |
A1 | Servo up-down | Robotarm 45-120 | |
A2 | Servo forward-back | Robotarm 65-140 | |
A3 | Servo open-close | Robotarm 90-125 | |
A4 | PS2X DAT | Data (SPI MISO) | |
A5 | PS2X CMD | Command (SPI MOSI) |
After some time of use almost all of the boards no longer support PWM for pin 11 on the motor shield. Any value below 255 is interpreted as a low and the motor is shut off. Not very usefull for a motor project. Same is true for pin 1. Even though a voltage divider with 1kΩ/2kΩ is reducing the output voltage of the Arduino to 3.3 V several boards don't submit any signal. The bluetooth module can therefore only receive information, but not send them back.
- 2019-12-17 T300 this robot with 4 wheels, robot arm, ultrasonic distance sensor is the enhanced asa robot. Winner of the first AISVN robot competition ROBOT 2019.
- 2019-11-04 asa robot from first ASA period 2019/2020, evolved to T300 in the second period. After 9 sessions 60% of the students successfully finished their remote controlled robot.
- 2019-04-08 T200 updated 2-wheel robot, controlled by an ESP32 over BLE and the software reverse engineered for our purpose.
- 2019-03-26 T80 simplified version for Viet for the Sciencefair 2019 Design project. Has a L298N motor driver and HC-05 bluetooth module. Power supply was upgraded to LiIon because the 4 AA batteries provided not enough voltage for the bluetooth module once the motors where started.
- 2018-10-25 T110 updated robot with Bluetooth 4.0 remote to be used by iOS devices.
- 2018-10-09 T100 first robot with Bluetooth remote control, 2 wheels, L293D motorshield.
We ordered the following materials at CỬA HÀNG IC ĐÂY RỒI for all students to have a common ground for further experiments both in software and hardware:
- Arduino Leonardo (because of the Micro-USB interface) 125.000₫
- Khung xe robot 4 bánh (4 wheels - stable driving) 140.000₫
- Arduino Motor Shield L298 120.000₫
- Module thu phát bluetooth HC-05 80.000₫
- Pin Cell 18650 4200mAh 3.7V (4 AA batteries are not enough for motor and bluetooth, and not rechargable) 35.000₫
- Hộp đế pin 18650 loại 2 cell battery holder for two 18650 batteries 7.000₫
- Công tắc gạt MTS-103 3 trạng thái power switch for the robot 5.500₫
- Đồng hồ đo Vôn (Volt) 3.5-30V Voltage display to check the charge level of the battery 22.000₫
- Four 10 cm cable 0.25 mm² to connect the motors to the shield ₫
- Three female-male jumper wire to connect the bluetooth module to the Arduino (+3.3V, GND, RX)
- So in general: some jumper wires 19.000₫
- Maybe a breadboard to connect 5.000₫
All in all some 550.000₫ are already spend on these simple materials. Further steps include the collaborative project of a self driving robot (Khung xe robot omni đa hướng 2.250.000₫), controlled by an Raspberry Pi 1.580.000 VND with Camera 305.000 VND for object detection and obstacle avoidance.
The above program consumes 91% of the available RAM of the Arduino Leonardo. For future projects we need more. Some contenstants:
Model | RAM instructions | RAM data | Flash | Clock | Pins |
---|---|---|---|---|---|
Arduino Leonardo | 2.5 KB | - | 32 KB | 16 MHz | 20 |
ESP8266 (NodeMCU) | 32 KB | 80 KB | 4000 KB | 160 MHz | 12 |
ESP32 (WROVER-32) | 520 KB | 4000 KB | 4000 KB | 240 MHz | 20 |
Raspberry Pi 1 | 512,000 KB | - | 16,000,000 KB | 700 MHz | 26 |
Raspberry Pi 4 | 4,000,000 KB | - | 64,000,000 KB | 1500 MHz | 40 |
Nvidia Jetson Nano | 4,000,000 KB | 473 GFLOP | 16,000,000 KB | 918 MHz | 40 |