Author Topic: USB selector via transitors  (Read 731 times)

0 Members and 1 Guest are viewing this topic.

Offline andrewlaphamTopic starter

  • Contributor
  • Posts: 48
USB selector via transitors
« on: May 03, 2020, 01:27:42 pm »
Ive been playing around with a cheap car stereo i got from aliexpress and was thinking of expanding on its stock USB playback. The idea is to use the existing buttons on the headunit that select radio memory, cut their traces and feed them into an arduino that selects from multiple USB drives hidden inside the case. This way i can have a fast way of changing through my music genres and styles.
I was hoping this could be achieved by just using simple transistors on the positive rail of each USB disk?
So all the disk drives would be wired into the back of the USB port and the transitors would be breaking the connection to each 5v rail until one of them is pulled high via the microcontroller.
Would this work?
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1147
  • Country: lt
Re: USB selector via transitors
« Reply #1 on: May 03, 2020, 01:41:55 pm »
No, because ESD diodes will be effectively shorting the data lines if you have unpowered devices on the bus.
 

Offline andrewlaphamTopic starter

  • Contributor
  • Posts: 48
Re: USB selector via transitors
« Reply #2 on: May 03, 2020, 02:28:52 pm »
What if i connected 5v and GND straight through and only swiched the D+,D-?
« Last Edit: May 03, 2020, 02:37:56 pm by andrewlapham »
 

Offline OwO

  • Super Contributor
  • ***
  • Posts: 1250
  • Country: cn
  • RF Engineer.
Re: USB selector via transitors
« Reply #3 on: May 03, 2020, 02:39:02 pm »
You have to switch the D+ and D- pins but you might be able to get away with leaving everything powered on. RF switches might do the job but beware that unselected ports get shorted to ground.
Email: OwOwOwOwO123@outlook.com
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4662
  • Country: dk
Re: USB selector via transitors
« Reply #4 on: May 03, 2020, 02:43:56 pm »
You have to switch the D+ and D- pins but you might be able to get away with leaving everything powered on. RF switches might do the job but beware that unselected ports get shorted to ground.

that depends on what kind of rf switch
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1147
  • Country: lt
Re: USB selector via transitors
« Reply #5 on: May 03, 2020, 02:51:42 pm »
Out of interest I measured my SanDisk ultra usb 3.0. Data lines clamp at 0.8V while injecting 1mA of current. So, no, you can not switch just +5.
« Last Edit: May 03, 2020, 02:53:32 pm by Manul »
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3860
  • Country: de
Re: USB selector via transitors
« Reply #6 on: May 03, 2020, 02:56:55 pm »
Why not use something that is actually designed for the purpose?

https://eu.mouser.com/Semiconductors/Switch-ICs/USB-Switch-ICs/_/N-7590j?P=1ynzmed

E.g. ISL54225 (2:1 multiplexer) or MAX4899AE  (4:1 multiplexer) sound just like what you need.

If you want more than 4 devices I would rather start thinking about a different solution - implement a mass storage device using a microcontroller that will permit you to swap between music collections (I guess the idea is to swap between them quickly without going through the clunky radio menu) and will pull data from one or multiple memory sticks/cards attached via a regular USB hub.

Definitely a better solution than trying to physically switch the USB lines (which could end up even corrupting your USB sticks if you switch at the wrong moment).
 

Offline andrewlaphamTopic starter

  • Contributor
  • Posts: 48
Re: USB selector via transitors
« Reply #7 on: May 04, 2020, 01:05:15 am »
Ok ive completely shifted gears and gone with an RPI with a voice assistant that pulls music from a local source.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf