OWI Robot Arm Controlled by Arduino bit

If all you have is the Arduino ku4, then your optiona are limited.

I saw the kit as an entry point to my project.

I plan to use the Cloud kit or the wireless bits to control the Arduino bit remotely.

The Arduino bit will then send control signals to a robot claw. The robot claw has five motors that I need to control. I have built a relay control board that will accept eight inputs and will control eight relays.

As I see the control problem right now, I need two relays for each motor. So I will need another relay board.

So, what does the Arduino bit do? it will accept a command that specifies 1) which motor, 2) which direction, and 3) turn duration.

The Arduino will process the request and pass a control command to a relay control processor, which could be another Arduino board or some other processor.

I have the bits I need, the robot claws built and I understand the control process. The 8 input relay board has been built and tested.

What is next?

  1. Use an Arduino board through the relay board to control one motor in both directions.
  2. Use the Arduino bit to control step one.
  3. Determine movement limits for each motor. Make those limits part of the Arduino bit program.
  4. Add relay control for the fifth motor.
  5. Make it all work without remote control.
  6. Add remote control.

This sounds interesting, @br1wr2el3. Do you think you could post a teaser picture here of your work in progress?

On the right in black and yellow is the robot arm, fully extended.
To the left is an eight connection piece that I inserted between the arm and the Controller (Yellow and Black) in the background.

This is my test rig for the relay board that will use the Arduino bit to control the Robot Arm.

In the foreground is the eight channel relay board that I am testing for use with the Robot arm.

Behind (above) it is a breadboard with eight push buttons , one for each relay.

It is currently wired to use inputs 1-7 and relay 1.

This is to conserve pins,

As of now, I can press a button and trigger the relay. The relay will appear to remain triggered as long as I press the switch.

I am using an Arduino Uno for testing.

The loop scans the eight push buttons and stores their state in an array.

A for loop then works through the array and triggers the relay if a particular button was pressed. After a short delay to allow the relay to energize, the relay is turned off.

At the end of this sequence the loop begins again.

Note: This is getting a little more complicated than intended.

The relay board requies two (but would prefer three) power inputs:

9v to power the input sensors (would prefer an external 12v)
5v to power the Arduino Uno
12v to power the relays. They will work with 9v but not as well.

I get 5v from the PC USB powering the Uno plus 9v from a battery input to the Uno board.
I get the final 12v from an external power supply.

Alternative: I found a 12 pin Arduino compatible board that should power the motors directly without the need for the relay board.

This will simplify the design, but I have the order the board.

So, for now I will continue with the current setup for testing and proof of concept.

@JackANDJude do these posts help?

Yes, I’m reading along. I’m curious about the 12v input sensors. How would you protect the Arduino from getting over 5 volts? Where will the littleBits fit into your design?

I think I can answer your first question Jude. Use a secondary power supply for the external devices. Here’s a servo motor at 12 volts, while running the littleBits Arduino from a battery powered p1 Bit:

Ah… Interesting. :book:

This one goes to anchovy (11).

1 Like

:smiley: Thanks Jude. 11 indeed or in arduino speak:

anchovy = 1023 * 11 / 10;
1 Like

@JackANDJude: The 12v I puts are largely isolated from the Arduino module.

With an Arduino Uno I can input 12v to the module. With the Arduino bit my main concern will be if I have a problem with ground (GND) connections.

I was able to control the entire I/O board with only four Arduno ports ( a combination of input and outputs).

This puts control in reach of the Arduino bit.

Right now I have two programs, one reads eight input buttons to control four motors left and right…

The other controls the relays that make the actual connection.

I should have a single program that does both tasks shortly.

Then it is a matter of moving it all to littlebits.

Hi Bruce (@br1wr2el3)

[quote=“br1wr2el3, post:18, topic:14623, full:true”]
… With the Arduino bit my main concern will be if I have a problem with ground (GND) connections.

There is a “secret” GND connector on the Arduino Bit - right next to the d13 hole. It’s marked with a tiny minus sign:

NOTE (4/28/2015): This is the wrong orientation. See below.

It’s my understanding that the ICSP holes are:

…GND --> O O <-- RESET

Digital Pin 16 / MOSI --> O O <-- Digital Pin 15 / SCK

…VCC --> O O <-- Digital Pin 14 / MISO

1 Like

Your numbering scheme looks correct Jude. Mine was upside down, which I got from this thread. I should have looked here instead. Thanks for catching me! If I turn my head sideways, the ‘minus sign’ becomes a one, and it all makes sense.

Thank you @chris101, @JackANDJude for the update. I was thinking of using the bit that comes in the Hardware Kit for developing or adapting a project for use with Littlebits.

@JackANDJude in the testing I have done so far, that does not seem to be a problem. But I have seen problems (not with Littlebits so far) if there is no common ground reference.

Project update: The I/O board that I am currently working with uses two ICs that change serial data to parallel and parallel data to serial data.

I found a program for one of the chips and was able to use that to work with the second chip.

Happy result: I have an Arduino bit that is controlling the I/O board! (Pictures to follow). I added (soldered) the extra pins so I can use six more GPIO pins on the board.

  1. While the input output setup that I have been using (eight push buttons connecting 12v to the inputs) works with the Arduino bit, it is bulky and not easy to use.
  2. I have been waking up at 2:30 a.m. so I have had some thinking time. And sleep depravation.

What I realized was that I don’t need those eight push buttons, even though they work.

I have not formalized my new plan, but here is a rough description:

  1. Use a wiper bit (or the button alternative) to select which of the four motors I want to control.
  2. Use a second, similar bit, to select right / left direction for the motor. I want to avoid the possibility that the same motor could be told to go in both directions at the same time.
  3. Send these two bits worth of data to the Arduino bit for processing into the needed eight bit data value that is needed to control the output relays.

Alternate plan:
Use the keyboard bit to select both the motor and direction, and let the Arduino bit ensure that no conflicting commands are sent to the motors.

To use the keyboard bit I need to know what the data looks like that comes from pressing a key, and how that is affected by the octave control. I also want to know how to trigger the trigger so the Ardunio bit would know that new data was available.

I am thinking of having positive feed back from the Arduino bit to a number bit to verify that the correct motor had been selected. Two number bits, or one number and two LED bits would provide information about which motor and which direction had been selected.

Your idea of using the keyboard bit as a motor control interface is snazzy! :slight_smile:

Project Update - next steps

I am eager to use the wireless transmitter/receiver pair to separate the control part of this project from the actual robot arm. I am not sure how I could use the cloud bit for this unless it would provide a store/forward system for the information.

If I forget getting feedback from the Arduino bit, the wireless pair would work well.

  1. I can still provide the visual feedback, but it would come from the inputs, not from the Arduino bit.
  2. I only need two channels of information from the control station to the robot arm station, so the wireless pair should work well.
  3. I already have the bits so using them is tempting.
  4. Getting information back from the Arduino bit doesn’t work wirelessly since you can’t have two transmitter bits in the same area.

More information on inputs:
If I use the dimmer or slider bits, I would use the full range of motion rather than require the user to dial in exactly a 1, 2, 3, or 4. I would like the feedback to be 1, 2, 3, or 4. The threshold bit might work, but I would need three of them and I only have one.

@JackANDJude Thank you

Progress has been made with the help of @chris101 and @JackANDJude

Last night I was able to:

  1. Connect the Arduino bit to my I/O board, successfully.
  2. Connect the keyboard bit to my Arduino bit.
  3. Connect a bargraph and two LED bits to the Arduino bit to indicate which motor and which direction had been selected. This needs improvement, but it is not a high priority.

The my program let me press a key on the keyboard to activate one of the relays on the relay board. This eliminated the eight small pushbuttons that I had attached to the I/O board. The buttons worked, but it was messy with wires running everywhere.

After a fair amount of time and testing, I discovered some interesting things about the keyboard.

  1. The ‘note’ that is sent when you press a key is not always the same. It will be close +/- 5 beats, but not consistent.
  2. The note frequencies (values) do not match the frequencies of a typical piano keyboard.

Since I wanted my program to react in a specific way to each key press, I needed a way to group similar values as one action.

I finally settled on switch/case. One case (key) might look like:

case 63:
case 64:
case 65:
case 66:
case 67:
Take some action;

So, any of these five note values will trigger the same action.

to keep matters simple I will use only the lowest octave range setting on the keyboard. It would not be that difficult to use any of them, but that is for a future update.

Once everything is in place I had two problems:

Getting the correct power value in the right places
The relays were activating randomly. There was a lot of chatter when the program started up.

I finally connected the 5v GND from the I/O board to the GND pin on the Arduino bit. All the chatter on startup went away and no random relay activations were noted. Thank you @chris101

I think I can reduce the external power source requirement to a single 12V 2.5 amp power plug. I will add a voltage regulator to get the 5v for the I/O board. The power bit will accept up to 12v so that is a single source. Once the program is loaded on the Arduino bit I should not need the USB connection to the PC.

The next test is to actually connect the wires from the I/O board to the robot arm. I have done this for one relay, but not all eight.

Left to be done:

  1. Determine how to monitor the position of each motor so I “can’t” try to move a motor too far in one direction. Set right left boundary values for each motor.

All the I/O board does is provide a pulse of electricity to a motor. There is no number (position) associated with that pulse.

  1. Add a program controlled switch to turn the light on. The robot arm has an LED light mounted above the gripper.

  2. Add a two relay I/O board to control the fifth motor on the arm.

Right now I use two relays for each motor, one for each direction of movement. Since there are five motors (need 10 relays) and the I/O board only has eight relays, I am two short.

I bought a new board that will control up to twelve servos, but that is not the same as motors. I am looking at a long-term servo solution, but that is not now.

There are unused keys on the keyboard for the light and the extra relays, so it should be a “simple” matter to get these last steps working.

  1. Break the physical project into two parts and connect then with the wireless bits.

That must mean that I am 90% finished with this project. :wink: