0
\$\begingroup\$

I'm trying to connect buttons and a Joystick that are on one board with an ESP32 on another board.

I'm trying to keep it as simple as possible and just connect a pin to ground to tell me when a button is pressed or adjust the voltage being fed back to a pin to show the position of the joystick.

I feel that the USB-C connector is a good choice because it is small and well made with enough pins for my uses (I'm using 3 digital and 2 analog pins on the ESP32 as well as GND, 3.3v)

How would I go about connecting both sides of the USB-c to allow me to do that? Unfortunately I have only been able to get my own signals through the SBU1 pin and the D+/D- pins with a USB2.0 cable. When using a USB3 cable I am unable to use D+/D- nor Tx/Rx nor Tx1/Rx1

Any help would be much appreciated!

Here is everything wired up: enter image description here

I'm only getting feedback on IO25 from S1.

\$\endgroup\$
10
  • \$\begingroup\$ Can you post schematics of what you have done so far? \$\endgroup\$
    – Lior Bilia
    Feb 15 at 21:51
  • 2
    \$\begingroup\$ USB3 cable only connects one set of USB2 data pins on wire so it is the job of you as the connector user to connect the receptacle so that both orientations of the cable work. You might also ask yourself if it is a good idea to use a known connector for a random purpose. The moment you or someone else plugs in a phone or charger to a cable connected to a random device using random pins for random purposes might regret it if a charger or phone or your circuit gets damaged. \$\endgroup\$
    – Justme
    Feb 15 at 22:20
  • 2
    \$\begingroup\$ Unless you have a very good reason for using a connector that already has a standard use and pinout, you are probably going to make more headaches than you are going to solve. You need 7 pins; an 8-position IDC 0.1" header would be just fine, a DB9 would work as well and there are plenty of other connectors out there. Like @Justme said, USB-C has power on there already so you risk damage if someone plugs a charger or something else into it. \$\endgroup\$
    – vir
    Feb 15 at 22:23
  • 1
    \$\begingroup\$ Minimum Vbus on USB-C is 5V. You have it connected to 3V3, which has an absolute maximum rating of 3.6V. If someone plugs something that is supplying power on that pin into the USB-C connector, you will instantly destroy your module. \$\endgroup\$
    – vir
    Feb 15 at 22:31
  • 3
    \$\begingroup\$ If it's for a consumer product, then definitely try to avoid USB-C since it's becoming a de-facto standard for power delivery. Without knowing your limitations, any suggestions would just be guesses at this point and specific product recommendations are off topic, but I suggest picking a connector family that the average consumer isn't likely to have lying around. M8 or industrial mini type II could work. \$\endgroup\$
    – vir
    Feb 15 at 22:55

1 Answer 1

3
\$\begingroup\$

It should be pretty obvious that using a standard USB connector for something that's not only not USB (neither data nor charging/power) but that will in fact be destroyed if connected to an actual USB charger or host device, is a very bad idea. It's a bad idea even for a home/DIY project, but you mentioned in the comments that this is intended to be a consumer product. People will be plugging these things into chargers and host devices.

What would you think about a car that had an "easy fill port" for windshield wiper fluid, on the side of the car toward the rear, in the exact shape of a standard gasoline filler port? Same idea.


That said, for educational purposes only, the reason it's not working for you is probably because not all pins on a USB Type-C to USB 3.1 Standard-A Cable are actually connected:

enter image description here

I drew this up graphically in Paint:

enter image description here

Depending on the orientation of the cable when it's plugged in, and the contacts exposed by your receptacle, you may not have access to the signals marked with a red X. You can look in the specification for other cable variants such as the USB Type-C to USB 2.0 Standard-A Cable. Also note the power-only variants, in which even less is connected.

\$\endgroup\$

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.