Skip to content

An Arduino-powered smart car controlled via an L298N motor driver. This project demonstrates precise movement control, including forward/backward motion and left/right turns with calculated delays. Perfect for beginners learning robotics and motor control! πŸ”₯

License

Notifications You must be signed in to change notification settings

codewithcc/Smart-Car-using-Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Smart Car using Arduino

Arduino Smart Car Arduino License

A simple Arduino-based smart car controlled via an L298N motor driver. This project includes functions for moving the car forward, backward, turning left/right, and stopping.

Hardware Components

  • Arduino Board (Uno/Nano)
  • L298N Motor Driver
  • DC Motors (x2)
  • Chassis & Wheels
  • Power Supply (Battery)

Pin Configuration

L298N Pin Arduino Pin
IN1 3
IN2 5
IN3 6
IN4 9

Features

  • Forward Movement: Moves the car forward by a specified distance (cm).
  • Backward Movement: Moves the car backward by a specified distance (cm).
  • Left/Right Turn: Rotates the car by a specified angle (degrees).
  • Stop Function: Immediately stops all motor movements.

Functions

  • stopCar() – Stops all motors.
  • forward(d) – Moves the car forward by distance d (cm).
  • backward(d) – Moves the car backward by distance d (cm).
  • turnRight(deg) – Turns the car right by deg degrees.
  • turnLeft(deg) – Turns the car left by deg degrees.

Setup & Execution

  1. Upload the code to the Arduino board.
  2. The car performs a 360Β° left turn once in the loop().
  3. Adjust dt (delay time) and itr (iteration count) as needed.

Formulas Used

  • Forward/Backward Delay:
    delay = (distance / speed) * 1000
    (Speed: ~132.8 cm/s forward, ~130.083 cm/s backward)

  • Turning Delay:
    delay = (degrees / rotation_rate) * 1000
    (Rotation Rate: ~395Β°/s left, ~411Β°/s right)

License

This project is open-source under the MIT License.


Happy Building! πŸš—πŸ’¨

About

An Arduino-powered smart car controlled via an L298N motor driver. This project demonstrates precise movement control, including forward/backward motion and left/right turns with calculated delays. Perfect for beginners learning robotics and motor control! πŸ”₯

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages