Engineer
SRI LANKA • + Follow
Edit Project
Components
|
ARDUINO_NANO |
x 1 | |
|
L293DSTMicroelectronics
|
x 1 | |
|
HC05 Bluetooth |
x 1 | |
|
PPN7PA12C1NMB TECHNOLOGIES CORPORATION
|
x 4 | |
|
Switch |
x 1 | |
|
TB003V-500-P02BECUI DEVICES
|
x 4 | |
|
Male Header Connector |
x 2 |
Description
Arduino Control Bluetooth Car Controller
Connect all the components to the PCB.
Motor Pins
Motor 1 - D6, D9
Motor 2 - D10, D11
Code
Arduino Bluetooth Car Controller - Code
Arduino
# define leftMfront 6
# define leftMback 9
# define rightMfront 10
# define rightMback 11
# define frontL 2
# define backL 4
# define horn 7
int mSpeed = 255;
char data;
void setup() {
pinMode(leftMfront, OUTPUT);
pinMode(leftMback, OUTPUT);
pinMode(rightMfront, OUTPUT);
pinMode(rightMback, OUTPUT);
pinMode(frontL, OUTPUT);
pinMode(backL, OUTPUT);
pinMode(horn, OUTPUT);
Serial.begin(9600);
}
/*
* T-Robotics| 2023
* Contact - mail.trobotics@gmail.com
* +94718134650
*/
void loop() {
if (Serial.available()) {
data = Serial.read();
Serial.println(data);
if (data == 'F') {
goFront();
}
else if (data == 'B') {
goBack();
}
else if (data == 'R') {
goRight();
}
else if (data == 'L') {
goLeft();
}
else if (data == 'G') {
forwardLeft();
}
else if (data == 'I') {
forwardRight();
}
else if (data == 'H') {
backLeft();
}
else if (data == 'j') {
backRight();
}
else if (data == 'S') {
Stop();
}
else if (data == '1') {
mSpeed = 100;
}
else if (data == '2') {
mSpeed = 110;
}
else if (data == '3') {
mSpeed = 130;
}
else if (data == '4') {
mSpeed = 150;
}
else if (data == '5') {
mSpeed = 170;
}
else if (data == '6') {
mSpeed = 190;
}
else if (data == '7') {
mSpeed = 210;
}
else if (data == '8') {
mSpeed = 220;
}
else if (data == '9') {
mSpeed == 230;
}
else if (data == 'q') {
mSpeed == 250;
}
else if (data == 'W') {
analogWrite(2, HIGH);
}
else if (data == 'w') {
analogWrite(2, LOW);
}
else if (data == 'V') {
analogWrite(4, HIGH);
}
else if (data == 'v') {
analogWrite(4, LOW);
}
else if (data == 'X') {
analogWrite(7, HIGH);
}
else if (data == 'x') {
analogWrite(7, LOW);
}
}
}
void goFront() {
analogWrite(leftMfront, mSpeed);
analogWrite(leftMback, 0);
analogWrite(rightMfront, mSpeed);
analogWrite(rightMback, 0);
}
void goBack() {
analogWrite(leftMfront, 0);
analogWrite(leftMback, mSpeed);
analogWrite(rightMfront, 0);
analogWrite(rightMback, mSpeed);
}
void goRight() {
analogWrite(leftMfront, mSpeed);
analogWrite(leftMback, 0);
analogWrite(rightMfront, 0);
analogWrite(rightMback, 0);
}
void goLeft() {
analogWrite(leftMfront, 0);
analogWrite(leftMback, 0);
analogWrite(rightMfront, mSpeed);
analogWrite(rightMback, 0);
}
void forwardLeft(){
analogWrite(leftMfront,mSpeed * 1/3);
analogWrite(leftMback, 0);
analogWrite(rightMfront, mSpeed);
analogWrite(rightMback, 0);
}
void forwardRight(){
analogWrite(leftMfront, mSpeed);
analogWrite(leftMback, 0);
analogWrite(rightMfront, mSpeed * 1 / 3);
analogWrite(rightMback, 0);
}
void backLeft(){
analogWrite(leftMfront, 0);
analogWrite(leftMback, mSpeed * 1 / 3);
analogWrite(rightMfront, 0);
analogWrite(rightMback, mSpeed);
}
void backRight(){
analogWrite(leftMfront, 0);
analogWrite(leftMback, mSpeed);
analogWrite(rightMfront, 0);
analogWrite(rightMback, mSpeed * 1 / 3);
}
void Stop() {
analogWrite(leftMfront, 0);
analogWrite(leftMback, 0);
analogWrite(rightMfront, 0);
analogWrite(rightMback, 0);
}
Schematic and Layout
Jul 09,2023
531 views
Arduino Control Bluetooth Car Controller
2 Layers PCB 68.45 x 66.93 mm FR-4, 1.6 mm, 1, HASL with lead, Blue Solder Mask, White silkscreen
531
0
0
Published: Jul 09,2023
Download Gerber file 2
Purchase
Donation Received ($)
PCBWay Donate 10% cost To Author
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
Copy this HTML into your page to embed a link to order this shared project
Copy
Under the
Attribution-ShareAlike (CC BY-SA)
License.
- Comments(0)
- Likes(0)
Upload photo
You can only upload 5 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000
It looks like you have not written anything. Please add a comment and try again.
You can upload up to 5 images!
Image size should not exceed 2MB!
File format not supported!
View More
View More
VOTING
0 votes
- 0 USER VOTES
0.00
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Design
1/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Usability
2/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Creativity
3/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Content
4/4
More by Engineer
You may also like
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
131 0 0 -
DIY Laser Power Meter with Arduino
205 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
178 0 2 -