Arduino Pulse Generator

Share your spectra and discuss their features here
Post Reply
User avatar
Sesselmann
Posts: 1374
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Arduino Pulse Generator

Post by Sesselmann » 23 Oct 2022, 11:44

Boys and Girls....

When I build spectrometers I often use a pulser to test and preset the volume and shape adjustments. I built one several years ago and it only has one peak and I would have preferred something with multiple peaks. After a lot of messing around with zener diodes, transistors and dividers, the solution ended up being a completely unmodified Arduino with a few lines of code.

Simply connect a BNC cable from the signal input on the GS-USB-PRO to ground and pin 6 on the Arduino.

Note, if you want to connect the pulser to the SHV connector you will need a high voltage 1 nF coupling capacitor inline.

Unlike PMT's the pulser produces a positive pulse and the GS inverts it, so the Threshold needs to be negative.

Code and image below..


Steven

Code: Select all

// Arduino Pulse Generator
// Gammaspectacular.com
// program generates a 1 kHz pulse on pin 6 with increasing duty cycle

#define dwon(port, pin) (port |= _BV(pin))
#define dwoff(port, pin) (port &= ~(_BV(pin)))

int p6 = 6;
int t = 1000;
int i = 0;

void setup() {
  pinMode(p6, OUTPUT);
}

void loop() {
  while (i <= 50) {
   
    if (i > 45) i = 2;

    dwon(PORTD, 6);
    delayMicroseconds(i);
    dwoff(PORTD, 6);
    delayMicroseconds(t);

    i = i+5 ;
  }

}
Pulser
Pulser

RobertD
Posts: 49
Joined: 09 Jan 2023, 22:41
Location: Germany / Bavaria
Contact:

Re: Arduino Pulse Generator

Post by RobertD » 18 Jan 2023, 19:47

Thanks a lot for the sketch, Steven!
A lot better for fine tuning equipment than using fixed width pulses.

Robert
Robert

Post Reply

Who is online

Users browsing this forum: No registered users and 73 guests