The Minion Car

Using 2 minions we created a computer controlled RC-Car.

One minion was loaded up with the Send/Recieve code from our previous post. It allowed us to send charactors from the serial monitor to the other minion.

The second minion was wired into the RC-Car.

We took apart the RC-Car to find out where the control points for each of the H-bridges were and wired the arduino into each of the 4 pins (plus gnd and power). This let us take over the control of the RC-Car using the existing motor control circuitry.

From there we just had to write the code that would listen to the radio until it received the steering commands.

 ”w” for forward

“s” for reverse,

“a” for left

“d” for right

” ” to turn off fwd, rvs and clear steering

 
#include

#define myNodeID 30 //node ID of Rx (range 0-30)
#define network 210 //network group (can be in the range 1-250).
#define freq RF12_915MHZ //Freq of RF12B can be RF12_433MHZ, RF12_868MHZ or RF12_915MHZ. Match freq to module

typedef struct { int c1,c2 ; } Payload; // create structure - a neat way of packaging data for RF comms
Payload rxPacket;

const int Rx_NodeID=10; //emonTx node ID

const int fwd =6;
const int rvs =5;
const int lft =4;
const int rgt =7;

void setup() {
 pinMode(fwd,OUTPUT);
 pinMode(rvs,OUTPUT);
 pinMode(lft,OUTPUT);
 pinMode(rgt,OUTPUT);
 turnOff();
 rf12_initialize(myNodeID,freq,network); //Initialize RFM12 with settings defined above

}

void loop() {
 checkRadio();
}//end of void LOOP()

void turnOff()
{
 digitalWrite(fwd,LOW);
 digitalWrite(rvs,LOW);
 digitalWrite(lft,LOW);
 digitalWrite(rgt,LOW);
}

void checkRadio()
{
 if (rf12_recvDone())
 {
 if (rf12_crc == 0 && (rf12_hdr & RF12_HDR_CTL) == 0)
 {
 int node_id = (rf12_hdr & 0x1F); //extract nodeID from payload
 if (node_id == Rx_NodeID)
 { //check data is coming from node with the corrct ID
 rxPacket=*(Payload*) rf12_data; // Extract the data from the payload
 char temp1=rxPacket.c1;
 char temp2=rxPacket.c2;

if(temp1=='w' || temp2 =='w' )
 {
 turnOff();
 digitalWrite(fwd,HIGH);
 }
 if(temp1=='s' || temp2 =='s' )
 {
 turnOff();
 digitalWrite(rvs,HIGH);
 }
 if(temp1=='a' || temp2 =='a' )
 {
 digitalWrite(rgt,LOW);
 digitalWrite(lft,HIGH);
 }
 if(temp1=='d' || temp2 =='d' )
 {
 digitalWrite(lft,LOW);
 digitalWrite(rgt,HIGH);
 }
 if(temp1==' ' || temp2 ==' ' )
 {
 turnOff();
 }
 }
 }
}
}

We used the Arduino IDE Serial Monitor for original testing but the problem was you had to hit send or enter after hitting the charactor. This make it really slow to put the steering commands in. So for the drive test we switched over to Putty. Putty is a terminal emulator program that allows us to open up the serial port and send raw typed data across. As you can tell from the video below it made all the difference in the driving.

8 Responses to The Minion Car

  1. Hi, Nate. Minion looks interesting. Let me know if you’d like to chat. Am looking for possible collaborations on hardware, as well as looking for talented designers etc to write for our magazines and websites.

  2. ArduinoRadioHappy says:

    Hey guys, great project! I am following the kickstarter campaign and it looks like you are going to make your goal. Just keep posting updates to keep people in the loop. Yes, I know that is a pain when you are so busy but it is well worth it. It is all about how current the content is.

    The reason why I am posting is to ask if there are any plans for using the RFM22B radio chip. It is far superior and the cost is just a bit more. Having both the 433 Mhz and 833 Mhz options would be fantastic!

    I am always looking for a great, low cost solution that does not require so many expensive parts and break-out boards (like you described in your excellent video).

    Keep up the great work and I look forward to your whole line of great, inexpensive, self-contained radio solutions that live in the arduino universe.

    • Nate says:

      We were originally looking at using the RFM22b. It has a lot of great features and the range is amazing. We settled on the RFM12B mainly because most projects don’t need that kind of distance. But that doesn’t mean we aren’t looking into it for a future project.
      Working on a large update right now, I should post before Sat midterms allowing :D .
      Thanks for your support
      Nate

  3. Wonderful site. A lot of useful information here. Iˇm sending it to a few buddies ans also sharing in delicious. And obviously, thank you on your effort!

  4. Bob says:

    Is it possible to either add one board to a standard RC controller or modify an RC controller to work using the same frequency?

    Thanks

    Bob

    • Nate says:

      Most RC controllers don’t work in that frequency, the most common being 47mhz and 29mhz. So it wouldn’t work with having just on in either the controller or the car. You could put a minion in the controller and one in the car to completely replace the current radio system in it.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>