Make It : Robotics Starter Kit

Hi all,

http://www.radioshack.com/make-it-robotics-starter-kit/2770168.html

Fair warning, not only am I trying to teach my son about electronics / robotics, I’m also trying to learn more myself…

I bought this product from my local radio shack. It’s designed as a robot with some circuitry to control the motors and sensors on a PCB, implemented as an Arduino shield. I thought it’d be cool to use a Raspberry Pi instead.

The shield itself is powered by 2x AA battery four packs combined together to provide 12v DC to the PCB. It is apparently designed to also power an Arduino since there’s no other power connection.

What I’m not sure about is whether this would be expected to power a Pi. I’m assuming a Pi is considerably more power hungry than an Arduino. I can tell you just with the shield properly connected per the instructions, the Raspberry Pi is not being powered through the Arduberry.

I guess my question is: is there a way to make this work? I noticed instructions for connecting external power (basically adding some components). Would this be necessary? Or would it be better for me to either connect it via the 5v pin -> RPi MicroUSB port, or to have a separate power source (would it be as easy as a four pack connected to a MicroUSB cable? I know that’s 6v vs. 5v but is that in tolerance?)

Thanks in advance for assistance. I have basic knowledge of electrical things (I can solder stuff together and use a multimeter), but it’s probably safest to assume I’m a beginner.

Dion

Hey Dion,
Sounds like a cool hacking project! None of us have one or have worked with one, so we could only offer some general guidelines.

You’ll need to power the Raspbery Pi. Probably with a portable power pack? This seems to have a circuit on it that’s under-powered for powering the Pi (which can take up to 2 Amps, which is a lot of power).

You probably don’t want to connect the Arduberry 5V rail to the robots, it could damage the Pi or the Arduberry. But do connect the ground if yo’re going to communicate between the two of them.

How can this be controlled? Does it look for I2C commands or Serial commands? Just curious.

You might also consider this, the GoPiGo, which is a robot for the Raspberry Pi, with battery power built in already.

Best,

John

Thanks for the speedy response!

I was mostly hoping to not add weight, but I thought powering it separately was going to be required. There’s space on the robot for me to add another battery pack and I’m sure I can find something that goes from batteries to a MicroUSB plug (I figure I can probably solder, but I want to keep the RPi as pristine as I can).

For the controlling piece, I’m not familiar with the APIs yet. My immediate plan is just to SSH into the device and use the Arduino examples that come with the kit and adapt it. I’ve been programming C/C++ for about 30 years, so I don’t think I’ll have a problem figuring that piece out. I realize 802.11 is not the best long term option - I’ve got a bluetooth 4.0 dongle coming, as well as an XBox 360 controller receiver, I’ll play around with both of those.

Right now my son is really excited to learn more about this stuff, and I’m also learning more about electronics too, so it’s a win win.

Thanks for the help. And I’ll take a look at that link you sent…

Dion

No problem! Good luck. I’m glad I didn’t discourage you! Just be careful with hooking batteries up directly to the Pi. It’s pretty sensitive to voltages (high and low) and high voltages can destroy it.

Good luck!

I’ll keep that in mind. I actually remember reading that some place - I think it was a project in the MagPi, and the answer was to use a capacitor (?) to even things out?

In any case, it occurred to me I’m overthinking it. They have power banks specifically for powering portable USB devices - I assume if I use one of those I’m good.

Nice thing about the Raspberry Pi is if I fry one, they’re so inexpensive for getting another - We currently have three (2 B’s, 1 Raspberry Pi 2).

Oh, that reminds me… since the PCB on this is apparently sending power downward to the Arduberry, is it a problem connecting power to the Pi which I’m guessing will send the power upwward?

OK, so it works-ish. I’m not able to get it to run around in circles like it’s supposed to, but both wheels are operating independently, and the IR sensor appears to work (at least the robot operates differently when I put it up to light vice when I cover it. At this point I’m not sure how much of it are things like the condition of the batteries (I’m not sure what state they started in, but they seem depleted now). I may have killed a multimeter too (which I didn’t think was easily possible).

I very quickly went through the powerbank I got for the Pi. I might need to get something bigger - I guess it makes sense… 2600mAH means milliamps/hour right? If the Pi draws ~2amps, I guess that means an hour and some change, right?

Anyway, I’ll try again with some fresh batteries, and maybe play around with the sensors some.

It was fun though - and clearly the Pi/Arduberry/Robot connection is a viable concept. And I put a VNC server up, so a truly mobile Pi. Once I get this working I’ll add a camera to it :slight_smile:

Hey,
The Pi alone with WiFi usually takes ~400mA of current so just make sure that the motors are not drawing current from the battery pack for the Pi.

Also, do share your project with us. We have an Instructables contest running too http://www.dexterindustries.com/forum/?topic=pie-day-contest, so you can post your project there and you might end up winning some awesome goodies.

-Karan

Oh I definitely will. At this point it (mostly) looks like the Radio Shack kit, so I would feel funny about putting it in a contest. I guess in retrospect as a beginner I probably should have just bought an Arduino. I already had the Pi, though, so I thought it’d be trivial to replace it. WAY back in the day, (I’m 45, this was when I was in my early teens), my Dad worked for a company that produced analog-digital converters, so I worked with a variety of sensors, but almost exclusively on the software end. So I’m using this just to expand my horizons, and I’ve already learned a lot.

My plan once I have it going in circles is to evolve it - my youngest has lots of ideas on that. For sure I’d like to add a camera. Still looking at network technology (802.11 for range vs BT4.0 for power). I’d ideally like to have everything on the Pi vs. going through Arduberry, etc.

I’m really happy I found your site - and thanks for all the assistance!

Dion

OK, got it working :slight_smile: I think it was a combination of the amount of light I had, one of my batteries was bad, and possibly the connection between the components, but it’s mostly going in circles now. It doesn’t go all the way, but there’s a blog post that mentions the issue and how to fix it.

Since you asked, I took a couple happy snaps… Time to start experimenting now :slight_smile:

Hey,
It’s really nice to hear that your project is going well. No problems with it being a Radio Shack Kit, the fact that you have a good robotics project going with the Raspberry Pi does increase your chances a lot to win something in the contest and it always a good learning experience and I don;t think you have anything to lose. Do keep us posted on what all you end up doing with the Robot with your boys.

-Karan

OK, looking to go forward with this. I think I have a pretty good handle on what the shield does, and the arduino interface to it.

Originally I was thinking of essentially running the motors and sensors directly from the Pi. After looking into it, I don’t think that’s practical. I would essentially be recreating the PCB that comes with the kit. I thought about wiring the shield to the Pi, but Arduino is 5v, the Rasperry Pi 3.3v.

So I’m planning on continuing on essentially as is, adding a couple more motors to the shield to make it more mobile. I’m also going to add an XBox receiver to it (I’m debating just mounting it as-is, or breaking out the hardware itself), and I have a camera coming that looks like a set of eyes http://www.amazon.com/gp/product/B00N9YWLHE/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1 .

Ideally, I’d like to control everything from a single app, and that’s where my next question is. I know the Arduino model is to create a sketch that’s compiled and uploaded to the board which then executes - to use the term loosely) offline.

Is there a way to directly read/control the shield from the Raspberry Pi? I’m not sure how sandboxed the Arduberry is. Ideally I’d like to write a C app (I’m not familiar with Python yet) that runs a message loop off the controller, and sends commands directly to the motor. The camera I’ll read just using the standard Raspberry Pi utils.

Thanks!

Dion

Hey Dion,
All that you mentioned that you are trying to do with the robot kit, the GoPiGo already does it so I can explain you how we do it and you can either use the same or modify our source code too.

The GoPiGo uses a level conversion chip to do the voltage level conversion so that we can communicate with the Atmega 328 on the GoPiGo.

Now to directly communicate with the GoPiGo from C or Python programs, we have written a firmware for the GoPiGo which uses I2C to receive commands and send data back. So the python program just tells the GoPiGo to move forward and it starts moving.

We also had an example where we had a Web server running on the the pi. The webpage had a joystick which was used to send the commands back to the Pi and the Pi sent them to the GoPiGo. It also streams video directly in the browser.

Do take a look at the GoPiGo example projects here http://www.dexterindustries.com/GoPiGo/projects/python-examples-for-the-raspberry-pi/ and try to adapt them for your use.

-Karan

I will most definitely look at those. Just to let you know, you’re awesome. I’m going to check here first for cool stuff before other sites just because I appreciate your customer service a lot. Almost any other place would say “Not our product, go figure it out. Oh have a nice day.”

If I’m reading this source correctly, I think all communication with the shield is done serially over digital pins one and two. It’s got what appears to be a microcontroller on the shield itself (DC6688F2SCN). I think I can just put a voltage converter on those two pins with something like this and just use serial communications like back in my old RS232 days :slight_smile:

I really like the idea of using a webserver… I think I’ll do it.

MAN I wish I had a voltage converter now… :slight_smile:

Dion

Hey Dion,
Thanks for the compliments. We try to help everyone in the best way we can because in the end all of us are hobbyists and the least we can do is help each other (it also gives us an opportunity to show them our products, and maybe get some future customers too, so a win-win for everyone).

That voltage level convertor looks good, but I would suggest you to buy https://www.adafruit.com/products/395 and https://www.adafruit.com/products/757 . One is the same as the Sparkfun one and works well for I2C. The other one work well for SPI and Serial and we have been using something similar for a while now.

-Karan

Thanks for the tip! I don’t need much encouragement to buy stuff from Adafruit. Pretty much I think if your CEO has pink hair, your company is epic. I already ordered from SparkFun though, so we’ll see who comes first. I really wish I could work on this this weekend though. I’m in Hawaii, and getting electronics stuff is a little tricky.

More to follow when I’m able to program. Right now I’m thinking of making a mini Arduino API wrapper (basically the serial stuff) so I don’t need to modify the original sources…

Do you know anyone who’s made a submarine? As a longer term project I think that’d be cool :slight_smile:

Hey I know you guys are really tired of hearing it, but you really really rock.

My camera module came in today, so I went ahead and modified my robot. I took out the Arduberry (because I think I’m going to be able to directly connect the Pi to the Robot shield once I get the 3.3<->5v thing. Removing the Arduberry, I was able to better secure the PCBs.

Surprisingly, your Browser Streaming Robot code worked out of the box with my robot. Well I guess it’s not that surprising since the camera configuration is the same, but I figured the lack of GoPiGo hardware would cause something not to work.

So new pictures, and next step is to get the motor working again. That’s got to wait for the voltage shifter though…

Great to see that you are making progress on your project. Even I think that you might run into problems when controlling the robot with the app just because GoPiGo would be wired differently, but you should be able to figure things once you read the source code.

Keep the updates coming.

Best,
Karan

OK, well ups and downs…

Big up - got my voltage shifter from SparkFun. Last I checked on the website it was still packing. Yay :slight_smile:

Big down - I guess brilliantly in a pure evil way… The shield appears to power the Arduino board and expects the Arduino to return the favor and provide it 5v to power it’s Microcontroller… SO… No Arduino (or Arduberry), no 5v, even though it’s coming from the same battery pack, no voltage shifter :slight_smile:

Technically - I should be able to generate both. On the Pi, if I turn on a GPIO pin I get insto-presto 3.3v, and if I grab something from the USB port I got 5v. But I don’t really want to modify the Pi. Alternatively, I can put on the Arduberry, and either connect the power pins with wires, or add the shield and try to communicate on the other side It seems like a waste of the Arduberry to just abuse it for power.

Anyway, I’m going to call it a night… Still having fun, but I’d be having more fun if the PCB generated its own power :slight_smile:

Never mind already - took another look at the GPIO pinout - the Pi does both :slight_smile: