The Sparkfun level shifter has a low voltage side and a high voltage side, and supports 2 channels of data. a simple voltage divider won't work for this as it's not bidirectional, and we need the 3.3v TX data to be raised to the 5V on the Arduino. We're only going to use one channel for this demonstration. It needs to be powered from the BB's 3.3v on the LV side, and from the Arduino's 5V on the HV side. There also needs to be a common Ground connection between the BB and Arduino or the data can be corrupted on the wire. I'm using the bread board's blue rail as the common ground, and both rails are connected together. I also have 5V on both red rails because the minimal Arduino needs it.
I've included a Fritzing showing what this might look like with a normal Arduino.
Start with everything powered off, just in case.
First, lets put power to the level shifter:
- Connect both GND pins to the ground,
- Connect the HV pin to the bread board 5V rail
- the LV pin will get connected to the BB later
Next, connect the BeagleBone:
- P9 pin 1 (GND) to the breadboard ground rail
- P9 pin 3 (3.3v) to the level shifter LV pin
- P9 pin 21 (Serial2 TX) to one of the level shifters low side TX pin (TXI)
- P9 pin 22 (Serial2 RX) to one of the level shifters low side RX pin (RXO)
- in the photo, ignore the wire going to the Arduno's reset pin, that's for a later Instructible.
Finally, connect the Ardunio. we're making what's known as a "null modem cable" in PC land. The BB's TX data needs to end up on the Arduino's RX pin:
- D0 (RX) to level shifters high side TX pin (TXO).
- D1 (TX) to level shifters high side RX pin (RXI)
- LED on pin 13 as you normally would
NOTE: If you have a 3.3V Arduino, you can connect the BB and Ardunio together directly, without the level shifter.
NOTE2: I've found communication to be more reliable if the RX and TX wires are twisted around each other like this
. The twisting causes EMF interference to be reduced.
Power up the Arduino and the LED should start blinking as before.
Boot up the BB and move to the next step