Saturday 13 April 2019

switches - How can I convert a 2 prong connector to USB?


I'd like to convert this: http://www.parts-express.com/pe/showdetl.cfm?Partnumber=060-640&utm_source=googleps


to a USB? An ideal solution for me because of cost would be to use an existing usb controller from a usb keyboard. I was hoping someone might help bridge the gap in steps. What is necessary to wire the connector to the usb controller? Any help whatsoever would be much appreciated.



Answer




This calls for an FTDI FT245R. FTDI has become the standard for interfacing USB in a simple way to microcontrollers and other digital I/O.


enter image description here


The FT245R has 8 parallel I/O, so you can connect the switch with a pull-up resistor to one of those.


edit
You asked about this module:


enter image description here


Looks good. You connect the switch as follows:


enter image description here


VCC goes to VCCIO, Vout goes to one of the inputs D0..D7. I wouldn't solder directly to the module, but use a socket like this instead:


enter image description here



That's it. The advantage over the RS232 interface is that you have 8 I/O at your disposition.


The yellow jumper on the board selects between 3.3 V and 5 V for the I/O. This is important if you want to connect to a microcontroller or other external logic, but for the switch it doesn't matter.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...