loading
Project Introduction:
I am using Makeblock stuff to make a three wheels drive vehicle. I think this 3WD vehicle can be used as your robot chassis. It is very straight forward and you can easily pick it up from the insturction illustrated in my pictures. Let me show you what I have done.

You can write your own code or just copy mine from the last step.

But if you have any questions, you can leave me a message or just email me @ diracwei@163.com. Don't forget to tell me you love me! lol



Step 1: Step1: Get the 3WD Vehicle Chassis

It is quite simple in this step. You just need several screws and nuts to install these beam together.

Step 2: Step 2: Install the Mebaseboard and Battery.

Put on the battery holder with the battery bracket. Then you can use some plastic rivet to stablize the MeBase Board before put them together. Later on, you can install this battery bracket and MeBase Board to your chassis.

Electronics:
Me Base Shield V2.0

Step 3: Step3: IR Module and Motor Module Installation.

As you can see, you can use some short screw to install these electronics.


Electronics:
2 * Me Motor Driver V2.0
1 * Me Infrared Receiver Decode V2.0

Step 4: Step4 Motor and Wheels Installations.

First, you need to put the DC moter and the motor bracket together. And then you put on the shaft connector before install the tier on. You can make a rotational shaft by connecting the timing pulley slice and the timing pulley (90T). Finally, you can connect tier and the shaft together. But remember, you need to make two wheels in this step.

Electronics:
2 * Me Motor Driver V2.0
1 * Me Infrared Receiver Decode V2.0

Step 5: Step 5: Follow the Picture to Install These Two Wheels to Your Chassis.

One is already done. The other one is ready for installation. All components are place in their position.

Step 6: Step 6: Add Your Direction Control Wheel.

In this step, you are installing your direction control motor and your third wheel.

Step 7: Step 7: Timing Belt Installation

Before put on your belt, you need to adjust the location of your third wheel (from last step) and try to make the belt tight enough to roll with your motor.

After putting on the timing belt, you can connect those wire to your BaseBoard.

In the last picture, I took off the battery holder so you can see my connections. Actually the wire on Port 3 actually belongs to Port 6. You can see it from my code.


Arduino code:
#include <Makeblock.h>
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>

MeDCMotor Motor1(M1); // The motor on your third wheel (with the direction motor)
MeDCMotor Motor2(PORT_2);
MeDCMotor Motor3(PORT_1);

MeDCMotor MotorDirection(M2);// direction motor
MeInfraredReceiver infraredReceiverDecode(PORT_6);
int ThreeMoveSpeed = 200;
int DirectionMoveSpeed = 50;
int MatchSpeed = 70;
boolean leftflag,rightflag;
int minSpeed = 55;
int factor = 23;

void setup()
{
    infraredReceiverDecode.begin();
    Serial.begin(9600);
}

void loop()
{
if(infraredReceiverDecode.buttonState() == 1)
    {
        switch(infraredReceiverDecode.read())
        {
          case IR_BUTTON_PLUS:
              Serial.println("move forward");
               Forward();//control the three motors
               break;
          case IR_BUTTON_MINUS:
               Backward();//control the three motors
               break;
          case IR_BUTTON_NEXT:
               TurnRight();//control the direction motors
               break;
          case IR_BUTTON_PREVIOUS:
               TurnLeft();//control the direction motors
               break;
          case IR_BUTTON_9:
               danceOneRound();
               danceOneRound();
               danceOneRound();
               break;
          case IR_BUTTON_8:
               testMoveRound();
               break;
          case IR_BUTTON_7:
               excursionWheel1();
               break;
          case IR_BUTTON_6:
               RunMotor3Back();
               break;
          case IR_BUTTON_5:
               RunMotor2Back();
               break;
          case IR_BUTTON_4:
               RunMotor1Back();
               break;
         case IR_BUTTON_3:
               RunMotor3Forward();
               break;
         case IR_BUTTON_2:
                RunMotor2Forward();
               break;
         case IR_BUTTON_1:
               RunMotor1Forward();
               break;
           default:
       //    Stop();
           break;
        }
    }
    else
    {
      Stop();
    }
}
void danceOneRound()//drive the three Motors and direction motor to make the car dance
{
  Motor1.run(200);
  Motor2.run(-200);
  Motor3.run(200);
  MotorDirection.run(200);
  delay(700);
  MotorDirection.run(-200);
  delay(700);
}
void shake()
{
   Motor1.run(-250);
   Motor2.run(-180);
   Motor3.run(0);
}
void shake1()
{
   Motor1.run(-40);
   Motor2.run(-250);
   Motor3.run(-40);
}
void testMoveRound()
{
    Motor1.run(-250);
   Motor2.run(-70);
   Motor3.run(0);
}
void excursionWheel1()
{
  Forward();
  delay(2000);
   Motor1.run(-250);
   Motor2.run(-250);
   Motor3.run(0);
  delay(2000);
  Stop();
}
void Forward()//control the three motors
{
  Motor1.run(ThreeMoveSpeed);
  Motor2.run(-ThreeMoveSpeed);
  Motor3.run(-ThreeMoveSpeed);
}
void Backward()//control the three motors
{
  Motor1.run(-ThreeMoveSpeed);
  Motor2.run(ThreeMoveSpeed);
  Motor3.run(ThreeMoveSpeed);
}
void TurnLeft()//control the direction motors
{
  MotorDirection.run(-DirectionMoveSpeed);
}
void TurnRight()//control the direction motors
{
  MotorDirection.run(DirectionMoveSpeed);
}
void RunMotor1Forward()
{
     Motor1.run(0);
    Motor2.run(-ThreeMoveSpeed);
    Motor3.run(-ThreeMoveSpeed);
   
}
void RunMotor2Forward()
{
    Motor1.run(ThreeMoveSpeed);
    Motor2.run(0);
    Motor3.run(-ThreeMoveSpeed);
}
void RunMotor3Forward()
{
    Motor1.run(ThreeMoveSpeed);
    Motor2.run(-ThreeMoveSpeed);
    Motor3.run(0);
}
void RunMotor1Back()
{
    Motor1.run(0);
    Motor2.run(ThreeMoveSpeed);
    Motor3.run(ThreeMoveSpeed);
}
void RunMotor2Back()
{
    Motor1.run(-ThreeMoveSpeed);
    Motor2.run(0);
    Motor3.run(MatchSpeed);
}
void RunMotor3Back()

    Motor1.run(-ThreeMoveSpeed);
    Motor2.run(ThreeMoveSpeed);
    Motor3.run(0);
}


void Stop()
{
  Motor1.run(0);
  Motor2.run(0);
  Motor3.run(0);
  MotorDirection.run(0);
}
void ChangeSpeed(int spd)
{
  ThreeMoveSpeed = spd;
}
<p>HI can you link me the Make Block Items?</p>
<p>赞赞!</p>
<p>I like it!^^</p>
you are soooooooo smart boy
<p>Thanks! :)</p>
it look very hard;;
Lol, not really. You can do it dude! Just follow these steps.
That is really cool. Nice work.
Thank you dude!

About This Instructable

15,747views

155favorites

License:

More by wyw0424:How to make an auto-photographing system [Arduino]. How to make a three wheels vehicle [robot chassis] 
Add instructable to: