0
$\begingroup$

I am looking for a starting point for my project, preferably using popular systems (ones there is a lot of support for). I have an Arduino Uno, a Raspberry Pi, and a lot of willpower :) Anyone here built a project using the systems above?

Observation: I'd like to start with a simple line-following vehicle and build up afterwards.

$\endgroup$
2

7 Answers 7

9
$\begingroup$

The Arduino is really an AVR Atmega328p. The Arduino is a fine off-the-shelf implementation of this microcontroller, but if you make many of them, you can buy the chip for less than $3 each in bulk, and it requires very little circuitry to run on its own -- a crystal and a couple of capacitors to run at 20 Mhz, or not even that if you can run at the built-in 8 MHz resonant oscillator frequency.

It's fine for generating control signals: Servo PWM, step/direction, control for H-bridges, etc.)

It's also OK for running sensors: Ultrasonic time measurement, IR voltage conversion measurement, on/off contactors, etc -- this includes whatever optical sensor you'd use for "line sensing."

There will be a little code space left over after doing these tasks, so the simple control loop of "is the line to the right, left, or center of me -> do the appropriate turn" can be built into that system. However, as soon as you want to do something bigger, like path planning, environmental awareness, memory, SLAM, etc, you will not be able to fit that into the Arduino.

Thus, the best system for your requirements probably includes tying all the physical hardware to the Arduino, and then talking to the Arduino from the Raspberry Pi. The RPi has a modicum of CPU power (700 MHz ARM) and RAM (256-512 MB RAM) and thus can run higher-level control algorithms like path planning, localization, SLAM, etc.

If you go with a bare AVR controller, there are UART outputs on the Raspberry Pi, but the problem is that the RPi is 3.3V and the Arduino Uno is 5V. Either go with a 3.3V Arduino version, or use a voltage divider to step down 5.0V output from the Arduino to the 3.3V input of the Raspberry Pi. I use a 2.2 kOhm high and 3.3 kOhm low resistor and it works fine. You can feed the 3V output from the Raspberry Pi directly into the RXD of the AVR, because it will treat anything at 1.2V or up as "high."

$\endgroup$
4
$\begingroup$

It really depends on the project.

For a line follower robot ( in your case ), using the Atmel's AVR series is the best choice. Specially ATMEGA16 or even ATMEGA32.

Because the line-follower is a small project and the Arduino is too much for it. And the other advantage of Atmega16 is that it is cheap. If it is broken or faulty then you can change it easily. and it also provides PWM for controlling the speed of motors.

So with atmega series you can build the most powerful line-follower . No need to spend money on getting prebuilt boards and ...

$\endgroup$
4
$\begingroup$

I built a line following robot with an Arduino before. It was really simple to do and all we used were color sensors on the bottom inputted in the Arduino, and then of course some motors for the wheels.

But using an Arduino allowed us to have plenty of room for other components we wanted to add on to make our robot do more things.

Also, if you want to see some line following code we used just ask in a comment, but it obviously depends on your setup with the sensors and how you want it to turn at intersections and things like that.

$\endgroup$
2
  • $\begingroup$ Could you do something like this with Arduino? What kind of power drivers you use for more powerful motors? I am not sure how to implement the rotation 360 degree around, just an additional motor or servo? Additional motor probably because then it could rotate around to any direction, which kind of motor? AC? $\endgroup$
    – hhh
    Apr 2, 2013 at 20:55
  • 1
    $\begingroup$ yeah definitely, pretty easily. Don't remember the drivers, but just a normal dc motor. And yeah I'd use a servo probably for the rotation. Turning the cart could be handled by using multiple sets of wheels or by using another servo $\endgroup$
    – Tom Prats
    Apr 3, 2013 at 5:12
3
$\begingroup$

I would suggest using lower end Atmel AVRs for beginning robotics projects. An AVR can take a lot of abuse and can sink and source more current without burning out than the PIC microcontrollers I have used.

If you are going to be building multiple projects, you should consider investing in building your own breakout boards. You can design your own PCB with standard power circuitry, a bunch of headers for I/O and whatever microcontroller you choose. You can get your cost down to around $15 per board for the PCB and then a couple bucks worth of components. This way, you can leave your project intact, instead of having to harvest out the microcontroller for your next project. As a bonus, you will gain valuable experience in PCB design and soldering.

$\endgroup$
3
$\begingroup$

If you want a line-following robot, then something similar to an m3pi would be achievable. Photo-transistors seem to be very effective with a black-on-white track.

As for a microcontroller, Mario Markarian is probably right, it is down to personal preference and the project you are working on. The m3pi uses an mbed and has a lot of IO's to play with. For more advanced robots a raspberry pi or beagleboard work, interfaced with slave microcontroller(s) to provide sensor data and offloading any repetitive computations that could otherwise slow down the pi.

$\endgroup$
1
  • $\begingroup$ Wow. That is definitely the direction I'd like to go in. Thanks, very informative post. $\endgroup$ Oct 23, 2012 at 20:35
3
$\begingroup$

You should use an ARM. Then you can run full linux or android and have access to powerful libraries, high-level functional languages, and a package manager and community. You can use gcc or LLVM, and a modern debugger like gdb.

ARMs used to be too expensive and/or too big, but nowadays you can get an ARM for $5 that's only 13x13 mm. You have to use reflow soldering, but you will anyways if you want to make a professional-quality robot.

http://www.eetimes.com/electronics-products/electronic-product-reviews/processors/4230227/TI-debuts--5-Sitara-AM335x-ARM-processors

All other instructions sets have lost the competition. If you pick something like AVR, you will be forever stuck with inferior toolchains, weaker MIPS/dollar, and a much smaller community.

If you don't want to engineer the whole motherboard, then Gumstix, BeagleBone, BeagleBoard, and Raspberry Pi are all excellent pre-existing ARM-based devkits, and processor vendors also offer a devkit for every processor they make, bringing out at least a display bus and some serial busses.

$\endgroup$
3
  • $\begingroup$ "All other instructions sets have lost the competition. If you pick something like AVR, you will be forever stuck with inferior toolchains, weaker MIPS/dollar, and a much smaller community." Could you provide some authorative source for this? This sounds a bit like marketing, disclose if you work for TI. AVR lives well in things such as Arduinos with hobbyists at least. Or am I mistaken? $\endgroup$
    – hhh
    Apr 2, 2013 at 20:47
  • 1
    $\begingroup$ I do not work for TI or any chip designer. The reason I'm so adamant about this is that I'm recently out of school and in the robotics classes they teach arcane microcontrollers and then in actual side projects students just use ARM because it's better... Schools need to get with the times here. $\endgroup$ Apr 4, 2013 at 10:47
  • $\begingroup$ Is the reason schools tend to use AVR more on the line that is far cheaper and more suitable for hobbyist projects? Open-sourced PCB to tinker around such as Arduino or other reasons? The user Crake mentions that "AVR can take a lot of abuse and can sink and source more current without burning out than the PIC microcontrollers". You may have some good point but more open-source spirit can be an essential reason for academic use. $\endgroup$
    – hhh
    Apr 5, 2013 at 3:38
1
$\begingroup$

If you want to go further than using microcontrollers you could run ROS on you Raspberry Pi.

I have build several robots and a couple of other projects using a RoboCard (site in Danish, but can be translated). The RoboCard is build around an ATMega, so that certainly is a viable route.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.