moxicat
Posts: 5
Joined: Mon Dec 10, 2012 12:31 am

Need to switch 3v Thanks in advance!

Mon Dec 10, 2012 12:42 am

I am a complete newbie to electronics with back ground is computer science.

I have a manual switch today that when triggered causes a proprietary small microprocessor to do some things on the back-end. I put a volt meter on the switch and when triggered it was 2.84 volts.

I want to replace the manual switch with a switch that I can trigger through a program running on the Raspberry. I realize that the GPIO on the Raspberry is where this is usually done but I need to do it through USB.

I am also located in the US so looking for parts that can be sourced in the US. I planned on using Digikey for the parts.

The application has very limited space and is mobile. So like to keep the solution really small. I originally intended on purchasing the TI MSP420 but I really need the solution smaller.

I am capable of soldering. I will be using Linux on the Raspberry to talk to the USB port.

Unfortunately, since I am so inexperienced I need that exact parts required. Seems obvious I need a mini USB port. I believe I then need a USB IC but not sure which one or the easiest way to wire it to the USB port. Ideally, the USB IC would have two pins that I can solder wire to, send a message to the USB port and it would short the two pins. Not sure if it could be that simple.

Ultimately, I will have four switches that I have to control through software. All to a microprocessor and 2.84v. So not exactly sure how to wire but maybe need 4 sets of 2 pins that I can short? Or can maybe the four different switches share one of the wires? The switches are never pushed at the same time.

Above is phase 1. In phase 2 I need to be able to sense the mechanical switch being pressed. So I would have 2.84v hitting a pin and would like my program to receive an event when this happens.

Really appreciate the help. I really think this will be a really unique application for the Raspberry that will create interest. Majority of this application is software but I need the simple above hardware need.

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Need to switch 3v using USB. Thanks in advance!

Mon Dec 10, 2012 5:04 pm

What are the voltages with the switch OFF?

You need to know the voltages and currents in BOTH states, to determine how to drive it.

There are lots of USB devices from FTDI like FT245 for parallel port from USB also even the SILabs CP2103 with 4 GPIO pins and serial port can be used. Look foir USB serial with GPIO or even USB parallel chips.

Most have Linux drivers or are already distributed in Linux.

Digikey should have the ability to search for USB chips and how to get the datasheets.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

Frank B
Posts: 61
Joined: Fri Sep 14, 2012 8:02 pm
Location: Germany

Re: Need to switch 3v using USB. Thanks in advance!

Mon Dec 10, 2012 9:00 pm

Why do you need USB ?

moxicat
Posts: 5
Joined: Mon Dec 10, 2012 12:31 am

Re: Need to switch 3v using USB. Thanks in advance!

Wed Dec 12, 2012 2:31 pm

The voltage when the switch is open or off is 1.5 on the voltmeter when set to the 20m setting. I am not sure if this is 15 milli-volts or 1.5.

With the multimeter I will need to look up how to check current. Appreciate the help!

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Need to switch 3v using USB. Thanks in advance!

Wed Dec 12, 2012 5:08 pm

Frank B wrote:Why do you need USB ?
That was my thought but mine was not to reason why...
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13092
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Need to switch 3v Thanks in advance!

Wed Dec 12, 2012 5:47 pm

Edited the topic to remove the USB limitation, why do things difficult when you have GPIO's that already can switch a 3 (3,3) volt level.

moxicat
Posts: 5
Joined: Mon Dec 10, 2012 12:31 am

Re: Need to switch 3v via USB Thanks in advance!

Thu Dec 13, 2012 4:58 am

I am targeting the Raspberry for this but I would like portability and that is why I am using USB.

I have taken the current readings and what I found:

- Mechanical switch open there is a current of 0.
- Mechanical switch closed the current is 33 when multimeter is set to 2000 and the funny u symbol. So I believe this is .033A. It is weird that I am getting a reading of .03 when it is set at 20m.

On voltage it is 2.85v when switch is closed
When switch is open it is .2 when set at 200m. So I think this is .002v. Earlier post I gave different numbers for open circuit voltage. But more comfortable with these numbers.

Appreciate any help.

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Need to switch 3v via USB Thanks in advance!

Thu Dec 13, 2012 12:56 pm

moxicat wrote:I am targeting the Raspberry for this but I would like portability and that is why I am using USB.
So make a switch input with parallel output and add USB if you need it later. For Pi or anything else this should be sufficient. USB adds a lot of complexity unless you know how to handle the software on multiple operating systems for USB interupt transactions.
I have taken the current readings and what I found:

- Mechanical switch open there is a current of 0.
- Mechanical switch closed the current is 33 when multimeter is set to 2000 and the funny u symbol. So I believe this is .033A. It is weird that I am getting a reading of .03 when it is set at 20m.
That means you are reading 33uA or 0.033mA or 0.000033A, so when read on 20mA range that is 0.03mA.
On voltage it is 2.85v when switch is closed
When switch is open it is .2 when set at 200m. So I think this is .002v. Earlier post I gave different numbers for open circuit voltage. But more comfortable with these numbers.
So you have a switch that connects to a voltage when ON and 0V when off. Depending on rest of circuit it is in there appears to be a pull down resistor elsewhere.

Personally I would take the switches to a MAX6818 - 8 switch debouncer and latch, that provides an extra output when a swicth has changed. Then on Pi or whatever take the change output to a GPIO and monitor that input either by polling or GPIO interupt methods, when that pin goes low, read the other GPIOs you have connected for as many of the switches as you need.

Alternatively use something like a PCF8574, which with I2C gives similar functionality (but no switch debounce).

I still see no need even for portability in adding a large amount of extra work with USB. USB only makes the hardware interface electrically the same the software still has to be written for ALL the computers it will connect to, and from experience that can be a right support nightmare. Also more layers means more power and computing power and latencies, not helpful in mobile apps.

Remember the connectors and cables for USB take up space as well
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

moxicat
Posts: 5
Joined: Mon Dec 10, 2012 12:31 am

Re: Need to switch 3v Thanks in advance!

Thu Dec 13, 2012 7:14 pm

[/attachment]Appreciate the advice of just using the GPIO. Good with that. So connecting to the GPIO I have a couple of question and have posted a diagram that might help.

In the diagram I have labeled a box A and a box labeled B. In the B box I believe this needs to be a transistor. Exactly what transistor do I need to use? I have labeled a box A. I am not sure if I need something between the Raspberry GPIO pin and the transistor or not. If yes or if more than one component what exactly are the components?

The Neg on the switch I need to switch is not common with the Neg on the Raspberry. Do I connect the two Neg like I have in the diagram?

Are there any additional components I need to make this work? Eventually I need to also sense when the mechanical switch is pushed but want to just get this part working and will then move to what is needed on the other end.

I have had a problem having the graphic display biggest enough to read so I have also attached a more specific graphic with the A and B. Thanks in advance for any help!
Attachments
Raspberry Specific.jpg
Raspberry Specific.jpg (13.85 KiB) Viewed 1712 times
Raspberry2.jpg
Raspberry2.jpg (17.83 KiB) Viewed 1712 times

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Need to switch 3v Thanks in advance!

Thu Dec 13, 2012 10:06 pm

yes connect all negatives together WITHIN reason

The output -ve of the UBEC and the switch should be connected together. Depends on what the propriety IC is doing but I expect its -ve would be better connected to Pi GND/0V.

Needs more details on what the Proprietory IC is doing and controilling.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

moxicat
Posts: 5
Joined: Mon Dec 10, 2012 12:31 am

Re: Need to switch 3v Thanks in advance!

Fri Dec 14, 2012 12:39 am

I don't believe the proprietary IC has any involvement in the circuit I need. What I am doing is simply switching 2.85 volts. I shared that it was an IC more for purposes that I am not switching a heavy amp device like a motor or something.

Basically today I have a mechanical switch that shorts a 2.85 v line which has minimal amperage. I now want to replace the mechanical switch with a transistor that is triggered by a pin on the GPIO on the Raspberry. I need to know what transistor to use and do I need anything between the transistor and the GPIO pin? Do I need anything between the 2.85 volt line and the transistor? Can I connect the negatives from the two power sources for connecting into the transistor?

Any help appreciated. Hoping to purchase parts tomorrow and get this up and running.

User avatar
mattneighbour
Posts: 3
Joined: Sun Sep 09, 2012 9:16 pm
Location: Norfolk, UK
Contact: Website

Re: Need to switch 3v Thanks in advance!

Fri Dec 14, 2012 7:51 pm

This is a pretty simple thing to do, I was revising this at work today. This article gives a good overview:

http://www.eetimes.com/design/industria ... rt-1-of-2-

Alternatively you could keep it really simple by switching the IC's ground return with a regular MOSFET.

Matt

Return to “Automation, sensing and robotics”