Cap Touch from a touch pHAT


#1

Ahoy! I may have misread and made the wrong purchase. I was hoping to use the Pimoroni touch pHAT to run alligator clips and some other touch-sensitive material along the interior of a Yoda doll, then detect touches to various regions and have Yoda respond (using the “Little Creature” voice at: https://www.acapela-group.com/demos/ ).

I’ve got my pHAT all soldered up & it works nicely for things in the tutorial, but did I assume incorrectly, and in fact this can’t be used for cap touch other than the buttons on the pHAT itself? If there is a way for the pHAT to work “CircuitPlayground-style”, kindly point me in the right direction.

If not, I also purchased an explorer pHAT. It doesn’t look like this has any cap touch out of the box, but could I wire it up to something like this:


and sort of retain the Pi Zero WH form factor + get the CircuitPlayground pad-style Cap Touch I’m looking for?

Also: I installed the libraries in the tutorial, but I have been using python3, but noticed when going through the tutorial at: https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-touch-phat
some of the code throws errors (e.g.

@touchphat.on_touch(["Back"`, `"A"`, `"B"`, `"C"`, `"D"`, `"Enter"])

thought it was just the ’ marks, removed them, but python3 didn’t like the syntax without the single quotes, above. I Control-D’d out, ran the code as python, and this seemed to work.

  1. Am I reading something wrong in the tutorial, or are the single quotes just some sort of artifact that shouldn’t have come through Chrome.
  2. Am I correct that the tutorial doesn’t work for python3, just python? Is there a python3 version?

Sorry for the very n00bish questions. I’m green in python & electronics, although I do build iOS apps in Swift.
Thanks!
John


#2

I don’t own a touch pHat but from the looks of it, it wasn’t designed to extend the touch pads with wires etc. It might be doable if you can remove the masking to get to a bar copper pad, but that is a do so at your own risk proposition. You will void any warranty etc doing it. And it “might” not work at all after doing it?
I own several explorer pHats, no touch pads on those though. You only get those on the explorer Hat from what I can see. And they look to be the same deal as the ones on the touch pHat. I don’t see any through holes etc to attach leads or alligator clips.


#3

I’m thinking this is probably what you want.


#4

as you know[maybe] alphanumeric i have that one ,it works great with alligator clips ,hard to install for a novice ,as you know i’m one of those too,lol adafruit switched to circuitPyhton,and[ i formated my sdcard by mistake} with it all setup ,and i’m having issues getting it reinstalled ,adafruit excamples wont work ,but code i had from a user on Instrucables works fine … next week i going to have another go at it …


#5

Advantages and disadvantages to Circuit Python. Advantages are you can run it on just about anything they sell, Single Board Computer and or Micro Controller. Disadvantages are it appears its just enough different from regular Python that you run into issues like your having.
I haven’t used it very much so far, just on my BBC Micro Bits. And haven’t touched those in a while now. I think that may have been Micro Python though not Circuit Python?
If I can use it with my Arduinos it may come in handy.


#6

installing it was a copy past nightmare for me, took 2 formats and start overs what else is new right ! ,lol
if you ever want to play around with the hat just let me know …


#7

Maybe I better clarify, “it” in the above statement was referring to Circuit Python. Not the touch hat. ;)
The Arduino IDE programs in C not Python. Its C or C+ can’t remeber exactly which one. If I could use Circuit Python instead it might be easier, maybe? ;)


#8

i know,was just wanting someone with more knowledge to try installing the circuit python for me lol
next week im going to format the sdcard and try again …

just so many dang steps .


#9

Start a new thread (so we don’t clutter up this one) on that board / issue and I’ll see what I can source up. ;)
Put a link to it here as well as the OP might end up buying that same board.


#10

they don’t use the same link they did when i bought the hat,now they tell you to go here https://learn.adafruit.com/adafruit-mpr121-12-key-capacitive-touch-sensor-breakout-tutorial/overview

i will try again from scratch next week if i don’t succeeded i’ll star new thread here


#11

The other way to go about it is to Google for a Python library for the chip used on the board. I had to do that for the Si1145 breakout I bought at Adafruit. They didn’t have any Python code, just the Arduino code. I found a GitHub page for the Si1145 were somebody ported the Arduino code over to Python. I don’t have the skills to do that myself.


#12

Thanks. I was going to buy the Adafruit breakout, but then found a Crickit for Pi in a lab drawer & used the touch-sensors in that. Got some results from running mp3 audio through mpg123 and python.


Now to link his phrases to an iOS app to trigger him remotely so he can seem to “converse” with passers-by.
I’m still cobbling together electronics knowledge, and don’t know enough to perform surgery on his servos, but hopefully I’ll get there.
Thx for the advice!
John


#13

wow great work i like it a lot ,cool caricatures


#14

Nice work I must say. Forgot all about the cricket hat for the Pi. It’s on my I really want one list.
That has a lot of features on top of the four touch inputs. Speaker out and motor and servo drivers.
Servos are a lot easier when you have dedicated chip to drive them like what’s on the cricket.
Usually there are three wires, V+, ground and signal.
Adafruit and Pimoroni have a Learn section that might help you out.
https://learn.pimoroni.com/
https://learn.adafruit.com/