/arduino-car

A small uni project: A arduino connected to a sonar sensor, bluetooth module and two motors driving a small robot car forwards and backwards while monitoring the environment.

Primary LanguageC++

Screenshot of Car Control Webapp

Arduino Car

A simple remote-controlled car with built-in crash avoidance.

My Arduino Car

You can find a small chaotic demo on YouTube. 🙈

Features

This simple Arduino car comes with the following features:

  • Website to connect to and control the car via bluetooth (app folder).
    • Website is deployed to Cloudflare Workers (via wrangler).
    • Website implements the Web Bluetooth API to connect to the car (Note: Does not work on all browsers and devices).
  • Arduino Uno connected to:
    • Bluetooth Module for remote control.
    • Two Motors for the car (four motors installed but only two connected).
    • A sonar sensor to detect obstacles (distance) in the front.
    • A passive buzzer to warn for a crash (based on distance).
    • A debug LED that signals the status of the car.
  • Arduino Uno Sketch implements a execution loop including (sketch folder):
    • Check for command from the website (Bluetooth).
    • Check for obstacles in front.
    • Execute next command based on the two checks.

My Arduino Car

TODO LIST

  • Develop website:
    • Add ESLint/Prettier Setup [X]
    • Set up Tailwind CSS [X]
    • Add Cool Font [X]
    • Add Connect Button [X]
    • Integrate with Bluetooth API (GATT connect and write) [X]
    • Add Car Controls to Website [X]
  • Deploy website to Cloudflare Workers [X]
  • Develop Arduino Sketch (embedded code):
    • Add Bluetooth Logic [X]
    • Add Active Buzzer Logic [X]
    • Add Crash Detection Logic (Sonar) [X]
    • Add Motor Control Logic [X]
    • Add Debug LED Logic [X]
  • Develop Car [X]
    • Assemble car chassis [X]
    • Connect motors to arduino [X]
    • Connect sonar to arduino [X]
    • Connect buzzer to arduino [X]
    • Connect debug LED to arduino [X]

My Arduino Car

Limitations

  • Only supports back, forwards, and stop movement.
  • Batteries to heavy for the car, so it needs a little boost to get going.
  • Only two out of four motors are connected due to broken wiring (cheap car).

Setting up the Bluetooth connection

Note: Not all browsers support the Web Bluetooth API.

  1. Connect Bluetooth Device to your PC (might require a passcode depending on Bluetooth module - AT+PIN command - set to 123456 through Arduino)

  2. Click "Connect"-Button in web app

References: