Pages: [1] 2 3   Go Down
Author Topic: how fast can the arduino switch a transistor?  (Read 907 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I need to use my arduino to control some high speed switching valves. The valves work with 24V, so I'm using the arduino to control a TIP122 transistor to open or close them.

The question is: I could need the valves to open/close for 0.001 sec, and it would have to be precise / repeatable. Is it possible? Or do I need to connect it to a pulse signal generator?

So... what's the signal resolution of the arduino? What ports are the best for this application?

Cheers :-)

Logged

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1377
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you get a solenoid valve to open and close that fast ?
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, it's a stupidly expensive one...
Logged

Victoria, Australia
Offline Offline
Edison Member
*
Karma: 46
Posts: 1396
Electronics Engineer/Industrial Control
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, sounds like a fuel injector.

Tom..... smiley
Logged

Everything runs on smoke, let the smoke out, it stops running......VK3DMK

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5378
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The question is: I could need the valves to open/close for 0.001 sec, and it would have to be precise / repeatable. Is it possible? Or do I need to connect it to a pulse signal generator?

Arduinos can do that, no problem, but the number of pins with hardware pulse generators is limited.

How many do you need to control?

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

0
Offline Offline
Shannon Member
****
Karma: 201
Posts: 11744
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1ms is eternity!  16000 instructions execute in that time.
Logged

[ I won't respond to messages, use the forum please ]

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26570
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Open & close for 1000uS? Use blink without delay, any IO pin can handle that.
Something like this. Declare all the variables, add pinMode for output pin, etc.
Then in loop:
Code:
void loop(){
//all time related variables unsigned long
currentMicros = micros(); // capture the "time"

if ( start signal for pulse is detected ){ // what kicks things off?
pulseCreation = 1;
previousMicros = currentMicros;
PORTD = PORTD | 0b00000100; // port manipulation, set D2 high for example
}
// check if it's time to turn the pulse off
 if (pulseCreation == 1){
 elapsedMicros = currentMicros - previousMicros;
   if (elapsedMicros>=1000uS){  // 100uS is a variable name too
   // 1000 to 1004uS typical
   PORTD = PORTD & 0b11111011; // clear D2 low
   pulseCreation = 0;
  }
 }
} // end loop
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5378
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Open & close for 1000uS? Use blink without delay

That depends on how precise you need it (which hasn't been specified yet, just "precise").

If it has to be 0.001000 sec. then blink without delay won't cut it.



Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks to all of you so far. Regarding "how precise", I have to say that 0.001 secs +- the least possible... the valves are used for a special chemical procedure, sadly not fuel injection  smiley smiley smiley
 
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26570
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe not .001000 everytime, but in the range .001004 to .001012
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Warning: overly pedantic and generally useless comment follows.

Doesn't everybody mean "accurate" instead of "precise".

Sorry for that but it was bugging me.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26570
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, perhaps ...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Shannon Member
****
Karma: 201
Posts: 11744
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you want really accurate turn off times forget using a darlington.  Use a logic-level MOSFET
instead with repeatable switching times of a few 100ns.  The TIP122 datasheet doesn't even
list its switching times!
Logged

[ I won't respond to messages, use the forum please ]

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26570
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Depends on the Manufacturer:
http://www.st.com/web/en/resource/technical/document/datasheet/CD00000911.pdf
See Figures 12-13-14-15
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
God Member
*****
Karma: 28
Posts: 895
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

question :

the OP wants to control a 'stupidly expensive' device at and be as accurate with the operational time as possible.

can the program go into other operations that effect operation of the device ?

Would it be safe to say we have established that the Arduino has the ability to get close.... if there are no other parts of the program that might effect this operation.

to that end, assuming that the process is of high enough importance to warrant a stupidly expensive device, would a separate circuit offer more accuracy and precision ?

(Bob, I did not know you had a sense of humor !  )
Logged

Pages: [1] 2 3   Go Up
Jump to: