1

I'm starting a project for an internet-controlled model vehicle. I have a Raspberry Pi 2 Model B to serve as the core.

I have been researching the components I need and the main 2 that have stood out so far are:

Adafruit FONA 808 Breakout (https://www.adafruit.com/product/2542) for receipt of data using MQTT

Adafruit DC & Stepper Motor HAT (https://www.adafruit.com/products/2348) for powering 2 DC motors

My question is (hopefully) relatively simple - can I "stack" these 2 components so they can be used simultaneously by the Pi's GPIO?

1

Let me answer a somewhat more general question. If what you are stacking are real hats (they have an ID EEPROM), yes. If both hats are using the same bus, say, I2C or SPI, a good designer would either have provided little short/break pads to change the I2C address, or alternate CS pins.

in your case, one of the components is a simple breakout, not a hat, so it's up to you to decide how to connect it. Here are some bits of advice:

  • Use a stacking header for the motor hat (and be careful not to solder it the wrong way up -- not that I know about such things :) ). Then you have pins sticking out which are a lot more convenient to connect to.

  • Use standoffs to keep the hat firmly attached to your Pi.

  • Ordinary GPIO pins on the Pi are NOT 5V tolerant, but the Rx/Tx may be (I don't remember off hand, as I already use a 3.3V FTDI cable) -- if the fona uses 5V logic, either verify that the Pi can tolerate 5V on Rx, or use a level converter.

    • The fona board has an RTS pin, which you may or may not be able to disable on the fona side. I believe there is a way to expose additional UART pins as alt selections on the Pi, but I can't find a reference right now to include. It may be better for everyone involved if you just spend an extra $15 and get an FTDI friend to connect the fona instead of relying on the Pi uart. This will also solve your 3v3/5v problem.

Adding to @recantha's comment, if you switch to an Pi3 at some point, the tty device will no longer be /dev/ttyAMA0.

  • Stacking hats is exactly not intended by the Foundation (see here, quick search shows no current change to the situation). – Ghanima May 9 '16 at 21:16
  • Huh. I learned something today. I've had no problem running two adafruit 12-servo hats (do you know how much noise 24 servos make?!), but that may be a special case. – JayEye May 9 '16 at 22:29
  • Ok, adafruit lists those explicitly as stackable, so we're both right ;) (read: learned something today too). To me it would seem that it works together with the "unstackable" Pi-logic insofar as the identifying EEPROM is only read from one of the hats and the device-tree-thingy works since all hats are identical (no need to differentiate between different boards). – Ghanima May 9 '16 at 22:45
  • Thanks! This is super useful. Will look in to those extra bits. – Sel May 10 '16 at 11:11
0

Looking at the HAT for a moment, it looks like (and I had to squint!) the RX and TX are broken out, as well as 5V, 3V3, GND. That should be enough to connect the FONA board up as well. The motors won't use the TX and RX lines so you won't have conflicts. Make sure you read up on how to disable the Pi's serial terminal as otherwise the TX and RX connection to FONA will be tied up with the terminal instead of sending and receiving commands from the Raspberry Pi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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