I have a spectrometer that is basically a diffraction grating driven by a stepper motor. I am controlling it with an Arduino UNO that sends off a pulse train, each pulse moves the grating by some fixed amount. I keep track of the number of pulses and relate that to the position of the grating. The Arduino remembers the position of the grating the last time I turned it off so that the next time I turn it on, it can be driven from that known position onward.

The problem is that sometimes I forget to turn on the spectrometer and the Arduino would start sending pulses and increasing the position counter without actually moving the grating. The whole system is then messed up.

I could go into the spectrometer and solder two wires in order to get a DC voltage signal. But spectrometer is somewhat expensive and would like to avoid hacking into it. Are there any better ways?

FYI, here is a video of the scanning grating: https://youtu.be/e_cCWV18UQ0

  • \$\begingroup\$ Floppy disks had to calibrate their stepper motors with an Optical interrupter switch, which you could add to the shaft somehow then calibrate every power-on sequence by rotating to home. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Dec 31 '19 at 21:24

You could simply add some current sensing (see: current transformers, or hall effect sensors) to the power cord of the spectrometer.

Also, popular with the "let's screw something onto our household appliance" tinkerers: Check whether some "power on" LED is on; typically, you can do that e.g. with a photodiode taped onto it. By the way, in a pinch, an LED of the same color can act as photodiode, too.

Other options include: microphone in way of the fan (assuming your spectrometer has something like that), followed by a simple RC high-pass filter, opamp or simple transistor amplifier, rectification through a diode.

  • \$\begingroup\$ The current will be quite small, much less than 0.5A. The spectrometer has a neon light on the power switch but no LEDs. I looked at the Hall sensors and most of them seem to be only capable of sensing DC current (?). The motor scans slowly, as can be seen from the video, which is already sped up by 6X. The actual scan is 6 times slower. This is a major motivation for knowing approximately where the grating is, so that I can save some scanning time. \$\endgroup\$ – user1596683 Jan 1 at 5:07
  • \$\begingroup\$ yeah, a 500 mA AC current isn't "small" as in "hard to measure". \$\endgroup\$ – Marcus Müller Jan 1 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.