Ryanteck Budget Robot

I have a Ryanteck Budget Robot designed for use with a Raspberry Pi. I was wondering how difficult it would be to drive it with an Arduino (Uno/Mega) instead. I have an Infrared Wireless Remote Control Kit For Arduino, (http://www.ebay.co.uk/itm/141228410126? ... EBIDX%3AIT) which I would like to control it. The trouble is, I have no idea of how to go about it. Any advice (constructive) would be appreciated. I have the Ryanteck RTK-000-001 Motor Controller Board Kit for Raspberry Pi which I have built. (RTK-000-001 Documentation Old - Google Docs).

I was advised by the Raspberry Pi forum to remove the header and solder connections between the header connections and the arduino. But where to?

Thanks

Brian

meddyliol:
I was advised by the Raspberry Pi forum to remove the header and solder connections between the header connections and the arduino. But where to?

Yes - it should be possible; according to the information on the purchase page for the board:

https://ryanteck.uk/add-ons/6-ryanteck-rpi-motor-controller-board.html

The pins used to control the motors are:

Broadcom Pins:

Motor 1: 17 & 18
Motor 2: 22 & 23

Board Pin Numbers:

Motor 1: 11 & 12
Motor 2: 15 & 16

So - on the RasPi side, the pins used are 17 and 18 for the first motor, and pins 22 and 23 for the second motor. On the motor controller board, the pins are 11 and 12 for the first motor, and pins 15 and 16 for the second motor.

So - simply hook up the board to the motors and to power (for the motors) as explained in the documentation you have, but instead of plugging in the board to a RasPi - connect wires to the pins on the board (11, 12, 15, 16) to four digital output pins on the Arduino (9, 10, 11, and 12 should be ok to start with).

Then - in your code on the Arduino - you would raise one pin high and the other low (for each motor) to rotate it in one direction, and vice-versa for the other direction, like so (this is for one of the motors; the other would work the same way, just different pins):

int motor1Pin1 = 9;
int motor1Pin2 = 10;

int motor2Pin1 = 11;
int motor2Pin2 = 12;
 
void setup() 
{ 
  pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
} 
 
 
void loop() 
{ 
  digitalWrite(motor1Pin1, LOW); // spin one direction
  digitalWrite(motor1Pin2, HIGH);

  delay(3000); // wait a few seconds

  digitalWrite(motor1Pin2, LOW); // spin in the other direction
  digitalWrite(motor1Pin1, HIGH);

  delay(3000); // wait a few seconds

  digitalWrite(motor1Pin1, LOW); // turn the motor off
  digitalWrite(motor1Pin2, LOW);

  delay(3000); // wait a few seconds
}

This code is untested, but should work if you have everything connected properly - it is basically code similar to that for the RasPi shown in the documentation.