Pages: [1]   Go Down
Author Topic: X-Ray PIN diode TTL signal  (Read 2266 times)
0 Members and 1 Guest are viewing this topic.
Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Bom dia!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello!

im new to arduino but im already used to programming in C++ and Visual Basic.
Im working with a X-Ray PIN diode detector in a synchrotron radiation laboratory.

The device im using is http://www.xenocs.com/files/Product_Data_sheet_LD/ACC-05_X-ray_Pindiode_detector_system-02-LD.pdf

I can read the X-Ray intensity thru the Fout plug, which is a TTL signal with frequency that ranges from 0-500kHz (That is proportional to the photon flux on the diode). I have a arduino UNO R3 board.

I want the arduino board to make an average of the TTL frequency over 1/10 second and write the information on the serial.
I have read here that the maximum sampling rate of arduino UNO is about 125kHz, which is way below the 500kHz cap frequency of the detector.

anyone know if this is true? can i read the 500kHz signal with arduino uno?

sorry for bad english hehe =] thank you for your attention.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26293
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://interface.khm.de/index.php/lab/experiments/arduino-frequency-counter-library/

(First Google hit)
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2073
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

>I have read here that the maximum sampling rate of arduino UNO is about 125kHz
That is for ADC - as you work with TTL signal you do not need the ADC to consider - just measure the frequency of that TTL signal..
Logged

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Bom dia!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


thanks

but im avoiding using other hardware than arduino. i tried connecting the TTL source to arduino with a simple code, but it started failing with frequencies higher than 1kHz.

i used a similar code to this one (this one has a bug, but the one i used was working fine <1kHz)
Code:
int pino = 13;
int t0;
int tf;
int delta;
int counter;
int TTL = HIGH;
float freq;

void setup() {
  Serial.begin(9600);
  pinMode(pino,INPUT);
}
void loop() {
 
  t0 = millis();
  TTL = digitalRead(pino);
 
  while ((millis()-t0) > delta) {
    if (digitalRead(pino) != TTL){
      if (TTL == HIGH){TTL = LOW;}
      else {TTL = HIGH;}
    counter = counter + 1; 
    }
   
  }
  freq = counter/(2*(delta / 1000));
  Serial.println(freq);
 
}

im wondering about using a few flip-flops to reduce the output frequency.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26293
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you want it to work above 1kHz, you'll need to use micros, not millis

Quote
im avoiding using other hardware than arduino.
Did you look at the link I posted?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1]   Go Up
Jump to: