Super new to this.

Attached the Adafruit 16-Channel PWM / Servo HAT for Raspberry Pi to my Pi 3. All solder connections look good. Booted up the Pi, ran through the tutorial. After tutorial, the hat was detected on the proper channels (0x40 and 0x70, shown from sudo i2cdetect -y 1). Thought I was good, so went to the next step and downloaded the library and ran the servo test. Terminal reported something about no connection (rebooted many times, don't remember the exact message) (Yes, there is a servo connected, on the first set of pins).

So, went back and followed the instructions again, and performed the manual checks recommended. Everything seemed good. Rebooted the Pi3. Now i2cdetect can't find the hat.

uname -a returns that I am running raspberrypi 4.4.50-v7+ #970 SMP

tl;dr, i2cdetect showed the hat on the proper channels, now it's gone.



The I2C bus is implemented on pins 3 and 5 of the Pi (GPIO 2 and 3, see https://pinout.xyz/).

You need to concentrate your efforts to make sure there are no shorts or similar defects on those pins.

You could try the following test to see if the base I2C GPIO appear to be functioning.

Enter the following commands in a terminal window (prompt $ assumed).

You should get the response 0 1 1 1 for each of GPIO 2 and 3. This tests each GPIO can be set high and low.

It then sets the GPIO back into I2C mode (mode ALT0).

$ sudo pigpiod # start pigpio daemon

$ pigs w 2 0 r 2 w 2 1 r 2 m 2 r pud 2 d r 2 pud 2 o r 2

$ pigs w 3 0 r 3 w 3 1 r 3 m 3 r pud 3 d r 3 pud 3 o r 3

$ pigs m 2 0 m 3 0

By the way you don't need to use a PWM HAT for servos. The Pi can generate servo signals (e.g. pigs s 4 2100 will send 2100 µs servo pulses to GPIO4).

  • 1
    I have read that the Pi can power 1 servo, but I have two servos and two DC motors that I'm going to run off the PWM hat, so thats why I went that route. I ran the code you wrote and received the same responses. So from what you wrote, my understanding is that this means the pins can be properly set to 1 or 0. Meaning the connection is good. The pi still can't detect the hat. Apr 8 '17 at 21:10
  • I think I discovered the problem. I'm running the pi off a cell phone battery, and the charger hadn't been turned 'on.' Once I pressed the button on the charger, a green light on the pi started flashing steadily and now the hat can be discovered. Apr 8 '17 at 21:15
  • @MaconLeighton In effect you are using the HAT as a convenient place to feed in power for the servos/DC motors. That's fair enough. A HAT can also make the wiring simpler.
    – joan
    Apr 8 '17 at 21:36

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.