Adding hardware

If I just want to use the line following feature on the 3pi robot, could I add at least 5 hardware components, or use 5 I/O pins?

Hello.

Section 10.c of the 3pi user’s guide explains the available I/O in detail. The short answer is that you can probably get there, depending on your exact requirements, especially if you are willing to give up the LCD.

- Ben

thank you Ben. Well I need the line detection feature, but I need to add about 4 components, 2 of which will be analog inputs, but I need the LCD and we’re ordering the expansion kit.

ADC6 and ADC7 can be made available by removing jumpers on 3pi, but doing so means you give up the ability for the 3pi to monitor its own battery voltage and you lose the user trimpot. These are dedicated analog inputs (they cannot be used as digital I/Os). Aside from these, there are three more I/O lines that you can easily use: PD0 (doubles as serial receive), PD1 (doubles as serial transmit), and PC5 (IR emitter control when jumper is in place). Note that there is a user LED between PD1 and ground, so that could interfere with devices connected to that pin.

- Ben

thank you again Ben! Well it seems as if I am going to have to purchase the expansion kit. I am thinking about purchasing the “Arduino Uno” or the “Baby Orangutan B-328” for adding more inputs and to set up for serial communication with the 3pi. Do you think this may work?

It is certainly possible to use the 3pi as a serial slave controlled by a Baby Orangutan or an Arduino. The Baby Orangutan is smaller than the Arduino Uno, so it might be easier to fit on the expansion board.

- Ben

Sorry for bringing up an old post but does anyone see a reason why more I/O could not be added using the following break out board? sparkfun.com/products/9056. I was thinking that if you give up the battery detection feature and the Trim pot and place it those features on this breakout board instead then you can gain several more ports.

Hello,

I think there are only three available digital I/Os on the 3pi, unless you give up the LCD or carefully share LCD pins, and you need four to operate that board. If you want a lot more I/O, it would be much better to add a serial device or microcontroller.

-Paul

Yeah, you can use that board without four outputs, if you don’t need to address 16 devices. Just ground any selector pins that are unused.

I’m working on a project right now that uses two 4 channel multiplexers. One is connected to PB5 and ground, so only supports two devices. This one routes my uart tx and rx pins to either an external device (usb programmer/com port), or the selectors of the next mux. If I drive PB5 high, I can then address the four devices connected to the second mux. This way I keep my com port access, but have the option of disabling tx/rx to use those lines to select which analog device to sample.

–Louie

I have a baby-Q running as Master to a 3pi :smiley:

Hi,
I have been using the LCD data lines as they are not disturbing the work of the lcd as long as the control lines are not in the wrong state and it’s working fine for me. Is there something wrong with doing so that I haven’t though about?

Hello.

As long as you account for the fact that there are also pushbuttons on three of those lines and an LED on the fourth, and if your connections can tolerate the AVR and LCD periodically driving those lines, it should be ok. If you connect something to those lines that also drives them, you should use a current-limiting resistor in series to prevent damaging an I/O should it be trying to drive to a different voltage.

Also, make sure you don’t connect anything to PD7 that will draw more than a few milliamps if the LCD drives that line high. PD7 is the LCD’s busy flag, and the LCD drives it high while it is busy. If you connect something to this pin that prevents the LCD from being able to drive it high (such as an LED with a small current-limiting resistor), the LCD won’t be able to communicate to the MCU when it is busy, and the LCD routines will stop working properly.

- Ben