You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/ArminJo/Arduino-RobotCar/commits/master)
[](https://github.com/ArminJo/Arduino-RobotCar/commits/master)

16
+
<br/>
17
+
<br/>
18
+
[](https://stand-with-ukraine.pp.ua)
19
+
20
+
Available as [RobotCarBlueDisplay](https://github.com/ArminJo/PWMMotorControl/tree/master/examples/RobotCarBlueDisplay) example of the Arduino library [PWMMotorControl](https://github.com/ArminJo/PWMMotorControl).<br/>
21
+
Requires the Arduino library [BlueDisplay](https://github.com/ArminJo/Arduino-BlueDisplay).
22
+
23
+
</div>
24
+
25
+
#### If you find this program useful, please give it a star.
26
+
27
+
<br/>
28
+
29
+
# Features
30
+
- Obstacles avoidance by a HC-SR04 ultrasonic sensor mounted on a SG90 Servo which continuously scans the environment.
10
31
- To overcome the drawbacks of ultrasonic sensors, an additional IR or TOF (TimeOfFlight) sensor can be mounted to the servo.
11
-
- Manual control is implemented by a GUI using a Bluetooth HC-05 Module and the [BlueDisplay library](https://github.com/ArminJo/Arduino-BlueDisplay).
32
+
- Manual control implemented by a GUI using a Bluetooth HC-05 Module and the [BlueDisplay library](https://github.com/ArminJo/Arduino-BlueDisplay).
12
33
13
34
**Just overwrite the function doUserCollisionAvoiding() to test your own skill**.
14
35
You may also overwrite the function fillAndShowForwardDistancesInfo(), if you use your own scanning method.
15
36
16
-
This example requires the **[PWMMotorControl library](https://github.com/ArminJo/PWMMotorControl)** to control the motors,
17
-
the **[BlueDisplay library](https://github.com/ArminJo/BlueDisplay)** for Smartphone control and **[PlayRtttl library](https://github.com/ArminJo/PlayRtttl)** for the melody feature.
37
+
# Installation
38
+
- Install **[BlueDisplay library](https://github.com/ArminJo/BlueDisplay)** with *Tools > Manage Libraries...* or *Ctrl+Shift+I*. Use "BlueDisplay" as filter string.<br/>
39
+
- Install **[PWMMotorControl library](https://github.com/ArminJo/PWMMotorControl)** with *Tools > Manage Libraries...* or *Ctrl+Shift+I*. Use "PWMMotorControl" as filter string.<br/>
40
+
- Open the example **[RobotCarBlueDisplay](https://github.com/ArminJo/PWMMotorControl/tree/master/examples/RobotCarBlueDisplay)**, available at File > Examples > Examples from Custom Libraries / **PWMMotorControl**.
41
+
42
+
Other examples of PWMMotorControl like **[SmartCarFollower](https://github.com/ArminJo/PWMMotorControl#smartcarfollower)** will also run on this robot car.
43
+
44
+
<br/>
18
45
19
46
# Pictures
20
47
| 4WD car with IR receiver and Bluetooth module and 4 AA rechargeable batteries. | Instructable |
@@ -25,9 +52,11 @@ the **[BlueDisplay library](https://github.com/ArminJo/BlueDisplay)** for Smartp
| Youtube video of mecanum demo | Youtube video of mecanum car controlled by the accelerator sensors of the tablet |
30
-
|[](https://www.youtube.com/watch?v=https://youtu.be/VX92jeqr8_g)|[](https://www.youtube.com/watch?v=lhlxLTj9Mrg)|
55
+
|||
56
+
|**Youtube video** of MecanumWheelCar demo |**Youtube video** of mecanum car controlled by the accelerator sensors of the tablet |
57
+
|[](https://www.youtube.com/watch?v=VX92jeqr8_g)|[](https://www.youtube.com/watch?v=lhlxLTj9Mrg)|
58
+
59
+
<br/>
31
60
32
61
# SCREENSHOTS
33
62
| Start page | Test page |
@@ -45,13 +74,17 @@ Automatic control page with detected wall at right
45
74
- The tiny white bars are the distances computed by the doWallDetection() function. They overlay the green (assumed timeout) values.
46
75
- The tiny black bar is the rotation chosen by doCollisionAvoiding() function.
47
76
77
+
<br/>
78
+
48
79
# Wall detection
49
80
Ultrasonic distance measurement has a problem with walls.
50
81
You can **only detect a wall** if the angle of the wall relative to sensor axis is approximately **between 70 and 110 degree**.
51
82
For other angels the reflected ultrasonic beam cannot reach the receiver which leads to unrealistic great distances.<br/>
52
83
The implemented wall detection function `doWallDetection()` takes samples every 18 degrees and if it gets 2 adjacent short distances below `DISTANCE_MAX_FOR_WALL_DETECTION_CM`, it assumes a wall determined by these 2 samples.
53
84
The (invalid) values 18 degrees right and left of these samples are then extrapolated by `computeNeigbourValue()`.
54
85
86
+
<br/>
87
+
55
88
# Compile options / macros for this software
56
89
To customize the software to different car configurations, there are some compile options / macros available.<br/>
57
90
Modify them by enabling / disabling them, or change the values if applicable.
@@ -61,7 +94,7 @@ Compile options for the used **PWMMotorControl library** like `USE_ENCODER_MOTOR
61
94
| Name | Default value | Description |
62
95
|-|-|-|
63
96
|`CAR_HAS_VIN_VOLTAGE_DIVIDER`| undefined | VIN/11 at A2, e.g. 1 MΩ to VIN, 100 kΩ to ground. Required to show and monitor (for undervoltage) VIN voltage. |
64
-
|`VIN_VOLTAGE_CORRECTION`| undefined or 0.8 for UNO| Voltage to be subtracted from VIN voltage for voltage monitoring. E.g. if there is a series diode between Li-ion and VIN as on the UNO boards, set it to 0.8. |
97
+
|`VIN_VOLTAGE_CORRECTION`| undefined or 0.8 for Uno| Voltage to be subtracted from VIN voltage for voltage monitoring. E.g. if there is a series diode between Li-ion and VIN as on the Uno boards, set it to 0.8. |
65
98
|`CAR_HAS_US_DISTANCE_SENSOR`| disabled | A HC-SR04 ultrasonic distance sensor is mounted (default for most China smart cars). |
66
99
|`US_SENSOR_SUPPORTS_1_PIN_MODE`| disabled | Use modified HC-SR04 modules or HY-SRF05 ones.</br>Modify HC-SR04 by connecting 10 kΩ between echo and trigger and then use only trigger pin. |
67
100
|`CAR_HAS_IR_DISTANCE_SENSOR`| disabled | Use Sharp GP2Y0A21YK / 1080 IR distance sensor. |
0 commit comments