Fabri Creator
PERU • + Follow
Edit Project
Description
Carro Todo Terreno Arduino
Carro "Todo Terreno" :) Tutorial completo: https://youtu.be/BqBb3FfbrHk
Materiales:
(12) tornillo M3-25mm cabeza Allen cónica
(13) tuerca M3
(6) tornillo M6-25mm cabeza Allen cónica
(8) tornillo M3-10mm cabeza Allen cónica
(3) tornillo M3-10mm cabeza hexagonal
(1) tornillo M3-16mm cabeza hexagonal
(1) arandela M3
(2) ligas
Componentes:
(1) Arduino Nano
(2) L293D puente H
(1) L7805CV regulador de voltaje 5VDC
(1) L7809CV regulador de voltaje 9VDC
(1) Módulo Bluetooth HC06 esclavo
(1) HC-SR04 Sensor de ultrasonido
(6) Motor reductor 3-6V + Llantas
Code
Arduino
#define motorPin1 7 // Pin de control del motor 1
#define motorPin2 8 // Pin de control del motor 2
#define motorPin3 2 // Pin de control del motor 3
#define motorPin4 4 // Pin de control del motor 4
#define TRIGGER_PIN 11 // Pin de disparo del sensor ultrasónico
#define ECHO_PIN 10 // Pin de eco del sensor ultrasónico
bool rotating = false;
bool ultrasonicEnabled = false;
void setup() {
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
Serial.begin(9600);
pinMode(TRIGGER_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
}
void loop() {
if (Serial.available() > 0) {
char command = Serial.read();
if (command == 'F') {
forward();
}
else if (command == 'G') {
backward();
}
else if (command == 'L') {
turnLeft();
}
else if (command == 'R') {
turnRight();
}
else if (command == 'S') {
stop();
}
else if (command == 'X') {
rotate();
ultrasonicEnabled = true;
}
else if (command == 'Y') {
stopMotors();
ultrasonicEnabled = false;
}
}
if (ultrasonicEnabled) {
long duration, distance;
digitalWrite(TRIGGER_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIGGER_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIGGER_PIN, LOW);
duration = pulseIn(ECHO_PIN, HIGH);
distance = (duration / 2) / 29.1;
if (distance < 30) {
stop();
backward();
delay(500);
stop();
delay(200);
turnLeft();
delay(500);
stop();
forward();
}
}
}
void forward() {
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
}
void backward() {
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
}
void turnLeft() {
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
}
void turnRight() {
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
}
void stop() {
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
}
void rotate() {
if (!rotating) {
rotating = true;
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
delay(200);
stop();
delay(200);
backward();
delay(500);
stop();
rotating = false;
forward();
}
}
void stopMotors() {
stop();
}
Jul 04,2023
1,249 views
Carro Todo Terreno Arduino
Carro todo terreno impreso en 3D y impulsado por arduino.
Diseño 3D: https://cults3d.com/:1304569
Tutorial: https://youtu.be/BqBb3FfbrHk
1249
4
0
Published: Jul 04,2023
Download Gerber file 19
Purchase
Donation Received ($)
PCBWay Donate 10% cost To Author
File Last Updated: 2023/12/31 (GMT+8)
File update record
2023-12-3113:42:39
Gerber file is updated.
2023-07-1111:16:06
CAD or technical drawing file is updated.
2023-07-0501:58:08
Parts List (BOM) is updated.
2023-07-0501:58:08
CAD or technical drawing file is updated.
2023-07-0501:54:55
Parts List (BOM) is updated.
*PCBWay community is a shared platform and we are not responsible for any design issues.
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(4)
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000
Remove
It looks like you have not written anything. Please add a comment and try again.
View More
- Engineer Jan 08,2024
- Fabri Creator Dec 31,2023
- Engineer Jul 24,2023
- Engineer Jul 06,2023
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 Fabri Creator
You may also like
-
Open Source Very Large Stick - Freejoy & MMjoy2 breakout board
494 0 0 -
RF Control training board for students based on ESP32 C3
666 0 2 -
Aquarius+ Computer, Standard PCB
879 0 4 -
KINETIC COASTERS with a TWIST! Laser or 3D Print some DIY Magic
600 0 1 -
RPI - 8 IO PLC With ATTiny85 Watch Dog
527 0 1 -
Nintendo Famicom HVC-001 Controller Shells
621 0 1 -
COMMODORE 128 DIAGNOSTIC REV.785260 KEYBOARD DONGLE
584 0 4 -
COMMODORE 128 15KHz DISPLAY ADAPTER (C128 80 COLUMN ADAPTER)
793 1 6 -