Sunday, June 2, 2019

Project log: Smart robot car (part 1)

I decided it would be fun to do some computer vision + robotics. Why not a smart car?

The first step was to get a car chassis that could be controlled by microcontroller. A quick stop at Amazon and Adafruit got me a chassis complete with motors and wheels and a motor driver.

Assembling the chassis was straightforward, but the next step was controlling the motors using a microcontroller. I'd want wireless control eventually, but first I wanted to work with a familiar MCU. So I pulled out an Elegoo Arduino Nano and wired things up with the help of Adafruit's tutorial:




I had a dual motor controller that could provide ~1A/channel; four wheels/motors, each drawing up to 1A; and a 12V battery pack that could only supply 2A. I wired the wheels on each side up in serial. That should result in the two motors on each side splitting power, so the driver isn't overloaded.

I started off stripping individual wires to size, but when I got to the actual signal wires I decided it was going to be a little messy regardless, and it was temporary anyway. Once the 12V power supply and motor wires were in (had to add in some male-to-female jumpers for those because the wires I added were too short!) it really was a mess.

It was about this time that I decided I should put in an order for a Wemos D1 motor shield, so I'd have the option for simpler wiring later on. It'll take 2-3 weeks to get here, but I've got the Adafruit breakout in the meantime.

With a bit of code stolen from The Blaster I was manually flipping bits to control motor direction in no time. To simplify things a bit for the future, I added a new header with a TB6612 class. This class provides forward(), backward(), short_brake(), and stop() methods that flip the appropriate bits. No PWM support for now.

Next, switching to an ESP8266 or ESP32 for WiFi, so the car can be controlled remotely.

3 comments:

  1. Very good, This information is essential and informative which you have shared here. It is beneficial for beginners to develop their knowledge. It is very gainful information. Thanks for share it. Auto Wreckers

    ReplyDelete
  2. Lucky Casino: Welcome to Las Vegas - Mapyro
    Lucky Casino: Welcome to Las Vegas. Visit our website, 계룡 출장안마 open map. 군포 출장안마 · Enter "winners" 목포 출장샵 and 군포 출장샵 get a 100% match up to 용인 출장마사지 $3,000 in bonuses · Go

    ReplyDelete
  3. TikTok has 1xbet korea triggered so lots of Olaplex's merchandise to go viral that we couldn't pick just one to recommend as a gift — may we advise a set with all of the brand's heavy hitters instead? Every product on this package of shampoo, conditioner, leave-in treatment, and hair oil contains a top-secret blend of amino acids that actually repairs hair from the inside-out. This yr, rumors unfold throughout TikTok that this floral-yet-fruity scent smells exactly like another fragrance in the marketplace that costs greater than twice its worth . The two-piece body-care set features a buttery, cacay oil physique cream in Sol de Janeiro's iconic rounded tub, plus a perfume mist to layer right on high.

    ReplyDelete