Posted on

Arduino – Spare Parts Robot Car Prototype

Arduino Robot Car

Last night I was pretty bored, so I decided to build a simple robot car. I’ve only put a few hours of work into it so far, but it drives and steers! Sort of.

This slideshow requires JavaScript.

 

 

Parts used:

1x Arduino Nano

1x LiPo Battery

2x TIP120 Transistor

1x Servo Motor

1x DC Motor Gearbox

2x 2k Resistors

1x Breadboard

4x Wheels

 

The TIP120 transistor was only used because I had a bag of them within arms reach. The TIP120 works fine for this application, but it is inefficient and has lots of drawbacks. A FQP30n06l is much better for this application.

 

Schematic:

Schematic View of Car Circuit
Schematic View of Car Circuit

Code:

Literally all this code does is make the car accelerate gradually and wiggle the steering.

#include <Servo.h>
Servo steering;
int driveMotor = 3; //Digital 3 used for TIP120 on drive motor
int steerMotor = 6; //Digital 6 used for TIP120 on steering servo
void setup() {
    steering.attach(9); //Attach the Servo motor to digital PWM pin 9
}

void loop() {
    analogWrite(steerMotor, 255); //Turns the TIP120 on for the steering servo
    steering.write(90); //Sets the steering to 90 deg
    delay(250); //Waits a bit, for the servo to get to place
    analogWrite(steerMotor, 0); //Turns off the TIP120 to the servo
    analogWrite(driveMotor, 255); //Turns on the drive motor

    for (int i=80; i<=255; i++){  
        delay(25);
        analogWrite(driveMotor, i); //Gradually accelerates by switching TIP120, starting at 80/255
    }
    
    delay(250);
    analogWrite(driveMotor, 0); //Turns off the drive motor
    analogWrite(steerMotor, 255); //Turns the TIP120 on for the steering servo
    steering.write(45); //Sets the steering to 45 deg
    delay(250); //Waits a bit, for the servo to get to place
    steering.write(135); //Sets the steering to 135 deg
    delay(500); //Waits a bit, for the servo to get to place
    analogWrite(steerMotor, 0); //Turns off the TIP120 for the steering servo
}

Design:

The body of the vehicle is a 94:1 gearbox and the DC motor that drive the rear wheels. I attached a breadboard to the top of the gearbox to hold the circuitry. The servo motor responsible for steering is mounted on the front of the gearbox, and a 3D printed bracket holds the front wheels to the servo horn. It’s a pretty poor steering system, to be honest. I used zip ties and double-sided tape to keep everything stuck together.

Frame Design
Frame Design

The front wheels are some old attempts at Emmets Bearings that I found in my failed print bin. They spin well, but are awfully ugly. I designed the rear wheels myself using 3DS Max.

Rear Wheel Design
Rear Wheel Design

The obvious next step is to add a dedicated supply for the Arduino, so that the car is completely independent. It also needs basic wireless control; I’ll likely use IR. It also needs an actual frame and some proper wiring… and a lot more. It’s a work in progress.

 

 

 

 

Posted on

ProGrow Update #3 – Growth, Batteries and Mold

ProGrow Update #3

The ProGrow has been exploding with growth over the past few days. Some of the blades are over 6″ now, despite Ozzies constant attempts to eat all of it. The soil started to develop a very small amount of harmless white mold. I assume the mold is due to the consistently high moisture levels. I treated the mold by adding a trace amount of potassium bicarbonate and cinnamon to the soil, and to the water. The mold vanished in less than two days and the grass seems to appreciate it. I also reduced the frequency of automated watering to once every 6 hours at the most, and changed the moisture threshold that turns on the pump. This should help reduce the moisture levels of the soil, to discourage further mold growth.

ProGrow Update #3 - Batteries and Stuff
ProGrow Update #3 – Batteries and Stuff

 

Batteries

I tested the 18650’s that I had laying around, and only two of the batteries were still functional. The other two seemed to be almost completely discharged and are most likely at the end of their life. I’m going to use these two to create the new battery pack for the system. I still need to test the Macbook battery that I have to see if it’s a potential solution, but I prefer the 18650s due to their profile. I’m still waiting on the charging modules from Aliexpress, and it could still be a while. Once the charging modules arrive, I’ll charge up the batteries and do proper measurements to get an idea of their health.

18650 Batteries
18650 Batteries

 

I am considering moving the system from an Arduino UNO to an Arduino Nano. I believe that it would let me reduce the footprint of the project as well as reduce idle power consumption. I’ve received my SD card module in the mail and intend to implement it into the ProGrow as the next step. I am going to remove the RGB indicator LED in order to free up GPIOs for the SD Card. Ozzie seems to like hanging out right next to the ProGrow. It’s like a grass buffet for him!

Ozzie chillin' next to the ProGrow
Ozzie chillin’ next to the ProGrow
Posted on

ProGro Update #2 – USB Battery Bank

ProGrow Update #2 – Battery Bank

ProGrow with USB battery bank
ProGrow with USB battery bank

 

I’ve upgraded the system to include a USB battery bank. I’m using a cheap 4400mAh battery at the moment, but intend to upgrade it to a better system. I have a bunch of spare 18650’s and a MacBook battery that I could use, and I’ve ordered some charging and voltage step-up/step-down modules from Aliexpress to build a custom charger. I’m also going to invest in some solar panels to make the system recharge during the day, but I will need to find out my current draw and other things before I buy them. Right now the system requires too much power to have a realistic solar panel recharging system.

ProGrow Powered On
ProGrow Powered On

 

I ran into some initial difficulties using the battery bank to power the Arduino. The bank is designed for charging phones, it has an automatic shutoff feature if the output current is very low. During normal operation of the ProGrow, the battery shuts off after approximately 10 seconds if current draw is under 50mA. I had to make the automatic sampling time ~5 seconds, so that the LED display would turn on and draw enough current to keep the battery active. From 1/4 charge, the battery bank was able to power the system in its current state for ~18 hours. Not bad for a first run I suppose, but future versions will be much better. I’ll have to make a better battery bank and find out my current draw before I continue.