3.10. Adding electronics

This section gives tips for how additional electronics can be connected to the Balboa 32U4 control board.

Free I/O pins

If you want your additional devices to send or receive information from the AVR, you will need to connect them to one or more of the AVR’s I/O pins. The pin assignment table in Section 3.9 lists all of these pins and how they are used. Many of the I/O pins are already being used for some other purpose on the board, but there are 8 free I/O pins: 0, 1, 5, 12, A0, A2, A3, and A4 (accessible on the expansion headers on the four edges of the board, along with pins 2 and 3). Any of the free I/O lines can be used as basic digital inputs or outputs; each pin also has some special capabilities.

Pin 0 (PD2) and pin 1 (PD3) are the RX and TX lines of the AVR’s TTL serial port.

Pin 5 (PC6) is a hardware PWM output and is usable with the Arduino analogWrite() function. Pin 12 (A11/PD6) can also be used as a PWM output, but it is not supported by analogWrite(), and using pin 12 for PWM might conflict with uses of pin 6 (which controls the buzzer by default) as these two pins are complementary outputs of Timer4 channel D.

Pins 12 (A11/PD6), A0 (18/PF7), A2 (20/PF5), A3 (21/PF4), and A4 (22/PF1) can be used as analog inputs.

Freeing up more I/O pins

If you are not using an LCD on Balboa and the free I/O pins are not sufficient for connecting the devices you want to connect, you can gain access to a few more I/O pins on the LCD connector.

With no LCD, pin 11 (PB7) and pin 4 (A6/PD4) are free. Both pins can be used for digital input and output. In addition, pin 11 can be used as a PWM output and a pin change interrupt and pin 4 can be used as an analog input.

If you do not have an LCD connected, you can use the LCD contrast potentiometer for other purposes. The output of the potentiometer is a 0 V to 5 V signal which is accessible on the LCD connector. It can be connected to any free analog input if you want to read it from the AVR, or it might be useful to connect it to the other electronics that you are adding.

Be careful about connecting electronics to pin 13 (PC7), pin 17 (PB0), and pin 30 (PD5) on the LCD connector. These pins are used to control the LEDs on Balboa 32U4. All three of these pins are controlled as outputs by the bootloader. Pin 17 (PB0) and pin 30 (PD5) are used as RX and TX indicators, so if you are sending or receiving data over USB then the Arduino USB code will drive those pins in its interrupt service routines while your sketch is running.

I²C devices

It should be possible to attach additional I²C slave devices to the control board’s I²C bus as long as the additional devices’ slave addresses do not conflict with those of the inertial sensors. The LSM6DS33 uses 7-bit address 1101011, while the LIS3MDL uses 7-bit address 0011110. The ATmega32U4’s I²C pins (2 and 3) operate at 5 V. If you are connecting a 3.3 V device, you can connect it to the 3.3 V side of the bus instead (accessible through Raspberry Pi GPIO pins 2, for SDA, and 3, for SCL, even if a Raspberry Pi is not connected). Separate level shifters might be necessary to interface with devices that use other voltages.

If you do not want to use the inertial sensors on the I²C bus, you can cut the surface-mount jumpers labeled “IMU SDA Jmp” and “IMU SCL Jmp”. (Note that this will remove Balboa’s ability to balance!) This frees up pin 2 (PD1) and pin 3 (PD0) for limited use as digital inputs and outputs as long as a Raspberry Pi is not attached to the control board. Note that the AVR’s I²C pins will remain connected to the on-board I²C level shifters and will therefore still be pulled up to 5 V.

Power

The control board’s power nodes are accessible in several areas on the board. If you power additional devices from VSW, then they will be powered whenever the control board’s power is in ON, and they will receive whatever voltage the batteries are outputting. If you power them from VREG, they will get 5 V power whenever the batteries are installed and the power is on (but they cannot be powered from USB). If you power them from a 5V pin, then they will receive 5V power whenever the control board’s logic components are powered. If you power them from 3V3, they will receive 3.3V power whenever the control board’s logic components are powered. For more information about these power nodes and how much current they can provide, see Section 3.6.

It is also possible to add your own power switch to control power to Balboa 32U4, as described in Section 3.6.

Ground

You should make sure that all the grounds in your system are connected. The Balboa 32U4 control board’s ground node can be accessed from pins labeled “GND”. It should be connected to the ground node of every other circuit board or device you add to the robot.

Related Products

Balboa 32U4 Balancing Robot Kit (No Motors or Wheels)
Balboa Chassis with Stability Conversion Kit (No Motors, Wheels, or Electronics)
Stability Conversion Kit for Balboa
Bumper Cage Kit for Balboa
Balboa 32U4 Control Board
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors