Go Down

Topic: how fast can the arduino switch a transistor? (Read 1 time) previous topic - next topic

nekran82

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 :-)


jackrae

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

nekran82


TomGeorge

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

fungus


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?

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

MarkT

1ms is eternity!  16000 instructions execute in that time.
[ I won't respond to messages, use the forum please ]

CrossRoads

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: [Select]

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
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.

fungus


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.



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

nekran82

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  :) :) :)

CrossRoads

Maybe not .001000 everytime, but in the range .001004 to .001012
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.

bwat

Warning: overly pedantic and generally useless comment follows.

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

Sorry for that but it was bugging me.

CrossRoads

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.

MarkT

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!
[ I won't respond to messages, use the forum please ]

CrossRoads

Depends on the Manufacturer:
http://www.st.com/web/en/resource/technical/document/datasheet/CD00000911.pdf
See Figures 12-13-14-15
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.

dave-in-nj

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 !  )

Go Up