1

I'm working on a charged particle detector consisting of a plastic scintillator and a SiPM to create an electrical signal and I'm using an arduino with an ADC to detect these pulses.

I'd like to create a circuit which can emulate the pulse from the detector at home while I leave the detector in the lab, while I develop the arduino oscilloscope.

Ideally, I'd like to create two pulses as I described in the title, with 1-2 microseconds between them and be able to vary that time.

It's easy enough to make a periodic signal with these properties but what's a good way to create just one or two pulses?

jsotola
  • 1,554
  • 2
  • 12
  • 20
Milfod
  • 11
  • 1

3 Answers3

1

Assuming you use a 16 MHz AVR-based Arduino, you can achieve this sort of short pulses if:

  • you use direct port manipulation
  • you account for the fact that changing an output this way takes two CPU cycles
  • you create the delays with _delay_us(), which is declared in <util/delay.h>
  • you disable interrupts during the pulses

Here is an example function that does this on pin 2 (PD2 on the AVR microcontroller):

// Send a 0.5 µs pulse on pin 2 = PD2.
void send_short_pulse()
{
    noInterrupts();
    PORTD |= _bit(PD2);  // set the output HIGH
    _delay_us(0.375);
    PORTD &= ~_bit(PD2);  // set the output LOW, this takes 0.125 µs
    interrupts();
}

As noted by Atsushi Yokoyama, you will have to condition the signal outside the Arduino.

hcheung
  • 1,933
  • 8
  • 15
Edgar Bonet
  • 45,094
  • 4
  • 42
  • 81
0

If you need timing control around 0.5 microseconds, I think it can be achieved even with an Arduino Uno-class board by using a busy wait, as discussed on the following website. (But in practice, monitoring the generated pulse with an oscilloscope would be the best way to confirm.)

Reference: Very short delays - Arduino Forum

As for the 50mV amplitude, standard Arduino boards do not have a DAC (Digital-to-Analog Converter) port that can be controlled with such short pulses, so it may not be possible directly. However, if output impedance is not a problem, you could step down a 5V output to 50mV using a resistor voltage divider (e.g., 1/100 ratio). If impedance is an issue, you will need a buffer circuit, such as a transistor or an op-amp.

Hope this helps!

0

If you want to make your life easy, and avoid the hassle of manipulating ports etc, go to a more advanced (32-bit) board. Either some Arduino Nano 33 or a Teensy4.

Also note that ADCs are much slower than microseconds, so creating the pulse can be done easily, but detecting it is more complex. The Teensy has a fast comparator that probably can do the trick for you. It's a fantastic beast, faster and cheaper than Nano33 AFAIK, and Paul Stoffegren offers support, so you won't regret going that direction.

Christophe
  • 21
  • 4