Project showcase
Homework 8: Final Vehicle

Homework 8: Final Vehicle

The second project draws to a close.

  • 2,701 views
  • 1 comment
  • 3 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
L298 motor controller
×1
Tens70
9V battery (generic)
×1
AA battery
×4
lollipop sticks
×1
Epoxy
×1
orange arcylic
×1
09939 01
Rotary potentiometer (generic)
×1
push button switch
×2
Mfr 25frf52 1k sml
Resistor 1k ohm
×2
DC motor (generic)
×2
rubber wheel
×2
Rhxvhx2dhljmbtloxexc
Arduino Proto Shield
×1
solid core wire
×1
stranded wire
×1

Necessary tools and machines

Lasercutter
Laser cutter (generic)
09507 01
Soldering iron (generic)
Wire cutter

About this project

This homework was to complete the vehicle project as it was in the last project, but without a solderless breadboard and a "leash" that can hold up the vehicle.

Process

The things I wanted to fix from the last iterations were the vehicle's weight distribution, speed; the leash's length; and the flexibility of the caster wheel.

Regarding the weight: the last iteration had the battery packs placed at the back of the vehicle, so to fix it, I had all the heavy pieces on the same axis as the wheel. My solution there was then to place the Arduino and battery pack side by side, with the H bridge placed behind the Arduino. It made the vehicle wider, but it worked well.

The speed turned out to be some anomaly of my last iteration: with no code change, the wheels' speed now reflects the coding I intended. 

I got the leash from a fellow classmate, and to make sure the leash didn't snap upon being held, I threaded it through a bar so that the weight would be placed on a reinforced part of the body. It works well!

The caster wheel's only problem last time was that it was stuff, and that was a result of how I used adhesives and, in the last minute, thickened the body. Since this iteration's body was made with the thickness in mind, the caster wheel was placed better. I found that not using glue and using the natural thickness of the lollipop stick seems good enough to keep it in place without making the caster wheel stiff.

In miscellaneous revisions, I rounded the edges, as suggested in class. I redesigned the body so that the battery packs were more secure by making three layers, a design choice I saw other people make in their last iteration. I also made putting the Arudnio and H bridge on the body easier for myself by using cable ties. As opposed to the last iteration, the motors were attached via double-sided tape, which is holding up much better than I thought it would.

This time around, I also made sure to test the device step-by-step (since it would probably be way more punishing if I didn't and found I made a mistake somewhere along the way). I also ran it up a make-shift ramp, just to make sure the weight distribution worked like I imagined it would.

Results

After some initial hiccups, the soldering of all the pieces went pretty smoothly. I didn't encounter any major problems, other than waiting for CITRIS hours.

The vehicle moves pretty well, and I even seem to have better control of the vehicle. Soldering seems to make all the difference.

Conclusion

Hopefully I can sign up for an Electronics Hands-On workshop in Jacobs, but as it seems, I can't make it to any of them in the near future. If I had, then I could've finished this project earlier.

Code

CodeC/C++
const int LEFT_IN = 3;
const int LEFT_OUT = 5;
const int RIGHT_OUT = 6;
const int RIGHT_IN = 9;

const int POTENTIOMETER = 0;
const int BACKWARD_SWITCH = 11;
const int FORWARD_SWITCH = 12;

void setup()  {
  Serial.begin(9600);
  pinMode(POTENTIOMETER, INPUT);
  pinMode(BACKWARD_SWITCH, INPUT);
  pinMode(FORWARD_SWITCH, INPUT);
}

void loop() {
  int val = analogRead(POTENTIOMETER);
  int left_val = 255;
  int right_val = 255;
  if (val < 475) {
    left_val = (val >= 150) ? map(val, 150, 475, 0, 255) : 0;
  } else if (val > 525) {
    right_val = (val <= 850) ? 255 - map(val, 525, 850, 0, 255) : 0;
  }
  if (digitalRead(FORWARD_SWITCH) == HIGH) {
    move_wheel(LEFT_IN, LEFT_OUT, left_val, true, true);
    move_wheel(RIGHT_IN, RIGHT_OUT, right_val, true, false);
  } else if (digitalRead(BACKWARD_SWITCH) == HIGH) {
    move_wheel(LEFT_IN, LEFT_OUT, left_val, false, true);
    move_wheel(RIGHT_IN, RIGHT_OUT, right_val, false, false);
  } else {
    move_wheel(LEFT_IN, LEFT_OUT, 0, true, true);
    move_wheel(RIGHT_IN, RIGHT_OUT, 0, true, false);
  }
}

void move_wheel(int in, int out, int val, boolean forward, boolean left) {
  Serial.print((left) ? "left" : "right");
  Serial.print(": ");
  Serial.print((forward) ? val : -val);
  Serial.print("\n");
  
  analogWrite(in, (forward) ? val : 0);
  analogWrite(out, (forward) ? 0 : val);
  
  return;
}

Schematics

Cut Diagram
Hw8
Circuitry
Circuitry

Comments

Author

New pic
Eric Chen
  • 3 projects
  • 1 follower

Published on

November 15, 2015

Members who respect this project

Merlin arch 4fnrmpnf6jPhotoDefault
See similar projects
you might like

Similar projects you might like

BE∆ST: Bluetooth Vehicle Final Designed Chassis

Project showcase by Matthew Chiang

  • 3,442 views
  • 0 comments
  • 19 respects

Final Project

by Andres Duarte

  • 7,739 views
  • 0 comments
  • 17 respects

Android Guided Vehicle

Project in progress by bharath.s

  • 3,545 views
  • 0 comments
  • 7 respects

Bluetooth Controlled Vehicle

Project showcase by Amy Zou

  • 1,348 views
  • 0 comments
  • 2 respects

WiFi Robot

Project tutorial by Kartik

  • 3,766 views
  • 1 comment
  • 12 respects

sC00p-4-b1l1tY Meter

Project showcase by Team sC00p-4-b1l1tY

  • 967 views
  • 2 comments
  • 4 respects
Add projectSign up / Login