How do you connect a JRK 21v3 with the Arduino Nano?

Linked below are some images for the Arduino Nano setup. The Arduino provides several digital and analog outputs. It also has options to supply 5 volt power with very low current to LEDs and other sensors. I’ve connected the common power and ground terminals to the Arduino supply (this what all the wires are doing right on the bread board).

I’ve hooked up the JRK 21v3 motor controller to the breadboard to easily allow wire connections from the Arduino and I’ve connected it to an external 9.6 volt RC battery pack. In order to get the motor (connected to A and B at the moment) to work, how would I connect the Arduino to the motor controller? What terminals should I use on the motor controller to allow for a digital or analog input signal from the Arduino? Is there a way to use the same programming logic as the MShield by LadyAda?

Please supply pictures or describe in detail. I’ve already burned out one motor controller by not paying attention to what I was doing.

Thank you!

http://i.imgur.com/eghfb.jpg
http://imgur.com/uOo23.jpg
http://imgur.com/2ia9l.jpg
http://imgur.com/A1bMP.jpg

Hello,
I am hesitant to recommend anything until you tell us what you did that burned something out. If we can find the mistakes that you made, it will be a lot less likely that they will happen again!

-Paul

Oh, that’s simple. Don’t connect the arduino power (wires all over the board) to the device when it’s also plugged into the USB port on the computer. This will burn out the motor controller (little transistor next to the USB port). Also, don’t connect a battery pack to the motor controller and the Arduino to the 5v regulated output and the ground. That will burn out the arduino (little diode under the board).

So, now that I know what not to do, can you help me with understanding what to do? I assume it’s as simple as connecting the Arduino ground to one of the GND ports on the motor controller and then connecting a digital port to one of the connections on the controller, but I don’t know which one.

Thank you for your help.

Your second example is quite clear and clearly wrong, but I do not understand this:

Both of your devices have USB ports, so which one was plugged in to USB? And the Arduino Nano page does not show any pin labeled “power”, so what do you mean? And what did you connect it to on the jrk? The “wires all over the board” clarification does not help, unless you are implying that you just randomly shorted out some things.

Anyway, I am scared that you are still missing something that will result in the destruction of another board, but here is what I would do:

It looks like you are already powering both the jrk (from a battery) and the arduino (from usb), and they share a common ground. What are all the wires connected to the +5V line for? Anyway, if you really want to proceed, all you really need to get started is a single wire from some digital output on the arduino to RX on the jrk. Use the SoftwareSerial (or NewSoftwareSerial?) package to transmit commands on this line. After getting that to work, try connecting TX to an arduino input (for commands returning values) and RST to an output (to allow you to reset the board).

-Paul

-Paul

all you really need to get started is a single wire from some digital output on the arduino to RX on the jrk. Use the SoftwareSerial (or NewSoftwareSerial?) package to transmit commands on this line. After getting that to work, try connecting TX to an arduino input (for commands returning values) and RST to an output (to allow you to reset the board).

This is exactly what I needed. Thank you!

For clarification, I didn’t read the instructions before I hooked up the first board because I figured it was similar to the MShield. This was my mistake. This lead me to connecting both the Arduino and the controller to USB at the same time, then trying to figure out how to power the controller with an external power source (the 9V connection). Don’t read too much into that because it was just a stupid mistake on my part.

I’ll try what you mentioned and post back.

I am still really interested in what could have damaged your board. As far as I know, there is no reason you should not be able to have both boards connected to USB and 9V power. Did you not have any connections between the boards, or you do just forget exactly what was connected when you damaged the jrk?

-Paul

Everything’s connected fine per your instructions with the Arduino Duemilanov. The pin connections are below. Arduino on the left, JRK on the right.

Digital pin 13 -> RX
Digital pin 12 -> Status LED
RX -> TX
GND -> GND (common)

The only thing I need now is some assistance with getting the motor to go forward or reverse. I’ve read all sorts of information regarding serial input, but I’m using Linux and the JRK program doesn’t work with Linux. I also have a VM Windows Vista, but Virtualbox doesn’t pass USB control, so I can’t use the JRK program to test the motors.

I have a script which reads from the JRK and transmits some bits to the RX line on the JRK. You can see it below. Again, all I need is a simple framework for making the motor spin one way or the other, I can figure out the rest. I will be excessively grateful if someone knew the correct programming for this.

#include <ctype.h>

#define bit9600Delay 84  
#define halfBit9600Delay 42
#define bit4800Delay 188 
#define halfBit4800Delay 94 

byte rx = 0;
byte tx = 13;
byte SWval;

void setup() {
  pinMode(rx,INPUT);
  pinMode(tx,OUTPUT);
  pinMode(12,OUTPUT);
  digitalWrite(tx,HIGH);
  digitalWrite(12,HIGH); //turn on debugging LED
  Serial.begin(9600);           // set up Serial library at 9600 bps
}

void SWprint(int data)
{
  byte mask;
  //startbit
  digitalWrite(tx,LOW);
  digitalWrite(12,LOW); //turn off debugging LED
  delayMicroseconds(bit9600Delay);
  for (mask = 0x01; mask>0; mask <<= 1) {
    if (data & mask){ // choose bit
     digitalWrite(tx,HIGH); // send 1
     digitalWrite(12,HIGH); //turn on debugging LED
    }
    else{
     digitalWrite(tx,LOW); // send 0
     digitalWrite(12,LOW); //turn off debugging LED
    }
    delayMicroseconds(bit9600Delay);
  }
  //stop bit
  digitalWrite(tx, HIGH);
  digitalWrite(12,HIGH); //turn on debugging LED
  delayMicroseconds(bit9600Delay);
}

void loop()
{
    SWprint('h'); //no reason to use 'h', just something to use.
}