Teensy 4.0 external USB to panel

frohr

Well-known member
Hi,
I have Teensy 4.0, it is project for measurement. I will print box on 3d printer. But micro sub to too weak for me. I need USB A female as connection to computer.
I need do it as small as possible.
Use this connectors and solder 4 wires?

micro-usb.png

USB-A-FEMALE.png

Or is better, more professional solution?
Thanks
 
For a connection to a computer you need a USB type B connector, type A is a USB host connector.
You need this:

15463-Panel_Mount_USB_B_to_Micro_B_Cable_-_6in.-01.jpg

Paul
 
Last edited:
But I am not sure where is difference. There are 4 wires 5V, GND, D+, D-. If I connect it from micro USB to USB A or USB B, it must work, or am I wrong? For me is better use "more starndard" USB, like cables for mobiles. Now I use micro USB connector with soldered wires to have smaller angle / bending of cable. If I use direct micro usb connector or 90° connector, it takes min 15-20mm of space.
 
Indeed it is just 4 wires. But the USB speed is 480 Mbit/sec. So if the data wires are more than about an inch (a few cm) in length, use wire that is specifically meant for high speed USB communication.
 
Might also be worthwhile to consider the USB standard regarding connector gender.

I need USB A female as connection to computer.

According to the USB 2.0 standard, USB A female is supposed to be USB host role, or downstream ports on USB hubs.

USB A male is supposed to be USB device role, or the 1 upstream port on a USB hub.

However, in recent years plenty of consumer products have broken these USB rules and just used USB A female for everything connected to a PCB and USB A male for everything on a cable. The result is a lot of cables like this, which were never meant to exist under the USB standard, are indeed widely sold.

usbatoa.jpg

If you disregard the USB standard about connector gender and USB roles (host / device / hub), electrically it will work. Millions of mass market products, especially the extra USB hubs built into the cheapest no-name PC monitors, do work this way.

But you should be aware the USB A female connector is supposed to mean the functionality is USB host which you would plug in a device like a keyboard or mouse or Teensy in device mode. If people other than you will make use of your design, you might at least think about somehow labeling or documenting the port isn't actually USB host.
 
It is just for me. I am sending data via usb to Python.


Code:
 if (Serial.available() > 0) {
    inChar = Serial.read();
      if (inChar == 'r') {                                 // if received char r, send buffer 30k samples
        for(int i=0; i<BUFFER_SIZE; i++) {
          byte *b = (byte *)&val[i];
          Serial.write(b[0]);
          Serial.write(b[1]);
          Serial.write(b[2]);
          Serial.write(b[3]);
          }
        }  
      if (inChar == 't') {        // check if received char is t = test if analyzer
        Serial.println("@");     // return confirmation char = yes, it is analyzer
      }
    }
  
}

Now I use Windows tablet and I like for example this cable bacause space...

usb cable.jpeg

So because I want use USB A female.
 
Back
Top