We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpElectronics,  Serial Library › switching transistors from processing
Page Index Toggle Pages: 1
switching transistors from processing (Read 1123 times)
switching transistors from processing
Apr 21st, 2009, 7:50pm
 
Sorry if this is a dumb question, but I know nothing about electronics.

I need to close and open switches programatically from processing. Is this something that can be done directly with the serial port API, or do I require the arduino?

Also, if anyone knows off the top of their head which transistors I should get, they just need to switch 5 volt signal, like a momentary switch if they were physically operated.

Thanks,
Snacky
Re: switching transistors from processing
Reply #1 - Apr 22nd, 2009, 8:35am
 
Would you be using the transistors for running a motor or something else that takes a bit of current?

As for the Arduino, while it is not required, it makes it very easy to have multiple outputs from the same serial port. I would recommend going with it if you don't have much experience with electronics.
Re: switching transistors from processing
Reply #2 - Apr 24th, 2009, 2:38am
 
They don't need current, they just switch on an off to emulate a button on the toy. I don't know whether to use PNP or NPN transistors, though.

If you search google for "site:getlofi.com parallel port transistor" you can see what I am attempting.  I can't link directly, unfortunately.

He uses a parallel port, but I'm guessing that is hard to do from Processing/Java. Thus the serial interface.
Re: switching transistors from processing
Reply #3 - Apr 24th, 2009, 9:13am
 
The main difference I know of is the direction of the internal diode.
Maybe this will help:

http://www.kpsec.freeuk.com/trancirc.htm

It really depends on how the hardware you are bending detects a button press. If nothing else, try the same transistors as your example.

If you do use an Arduino, it should be fairly simple to duplicate that circuit. Just use the digital i/o pins as if they were from a parallel port.

There are a few examples on the Arduino site on sending serial data to  the board.
Page Index Toggle Pages: 1