0

CAPACITIVE TOUCH HAT MPR121 NOT DETECTED IN RASPI 4?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CAPACITIVE TOUCH HAT MPR121 NOT DETECTED IN RASPI 4?

by chorzkie on Sat Mar 13, 2021 8:02 am

Hi everyone,
I'm trying to connect my Adafruit capacitive touch hat MPR121 to my Raspi 4, but still no luck. Anybody has experiences connecting it to Raspi 4?

About wiring, I extend the connection with GPIO extention cable like picture below. I'm quite sure it's correct, the red LED is on, but perhaps I make mistake here?
Image

Then I follow all instructions on this page, https://learn.adafruit.com/circuitpytho ... 3030038-15
All successful, even Blinkatest.py runs well.
Image

Image

However, my Raspi4 seems still not detect it.
Image

Running a simple python code as below results in error.
Code: Select all | TOGGLE FULL SIZE
import time
import board
import busio
import adafruit_mpr121


i2c = busio.I2C(board.SCL, board.SDA)
mpr121 = adafruit_mpr121.MPR121(i2c)

while True:
    if mpr121[0].value:
        print("Pin 0 touched!")


Image

Can anybody please help, what have I missed? Or point my mistake.
Thanks in advance.

chorzkie
 
Posts: 1
Joined: Sat Mar 06, 2021 1:38 pm

Re: CAPACITIVE TOUCH HAT MPR121 NOT DETECTED IN RASPI 4?

by kmm27 on Sun Apr 04, 2021 1:26 am

Sadly I don't have an answer for you, but came here because I'm having the exact same problem! Only, I'm not using the hat, but just directly wiring to the relevant GPIO pins.

kmm27
 
Posts: 5
Joined: Sat Oct 25, 2014 6:12 pm

Re: CAPACITIVE TOUCH HAT MPR121 NOT DETECTED IN RASPI 4?

by kmm27 on Sun Apr 04, 2021 1:34 am

I LIED - I do have a fix :)

My SDA and SCL pins were swapped. I had guessed based on the tutorial images, but either guessed wrong or the docs are off for the latest versions.

kmm27
 
Posts: 5
Joined: Sat Oct 25, 2014 6:12 pm

Re: CAPACITIVE TOUCH HAT MPR121 NOT DETECTED IN RASPI 4?

by danhalbert on Sun Apr 04, 2021 9:35 am

@kmm27 what did you change, wiring or code? If the tutorial is wrong, we would like to fix it, of course.

@chorzkie did you get it working? Looking at your photo, it is not clear that the header pins are soldered to the board; are they? It may be a push-fit but the connections will not be reliable.

danhalbert
 
Posts: 2356
Joined: Tue Aug 08, 2017 12:37 pm

Re: CAPACITIVE TOUCH HAT MPR121 NOT DETECTED IN RASPI 4?

by kmm27 on Wed Apr 07, 2021 2:12 am

I just changed the wiring!

kmm27
 
Posts: 5
Joined: Sat Oct 25, 2014 6:12 pm

Please be positive and constructive with your questions and comments.