0
\$\begingroup\$

I have a constant current circuit using an op amp circuit. I am implementing a current of 21 mA to drive a laser. Spec of laser: https://www.thorlabs.com/thorproduct.cfm?partnumber=L650P007 I would like to measure the noise in the current and do FFT and other analysis. I need to measure it at every 20 ms to analyze the noise from the AC mains. Is there any method I could use to do that? I have already tried with following:

  • Fluke 8845 DMM
  • NI Virtual bench
  • Arduino UNO

20ms is not possible. Does anyone have any idea regarding this?

This is the current measurement over time at every 120ms. The maximum I could get was at every 120ms:

enter image description here

Code I used for Fluke measurement:

import time
import serial
import matplotlib.pyplot as plt

# Configure the serial port settings
port = 'COM6'  
baud_rate = 9600  
timeout = 1  

# Open the serial port
ser = serial.Serial(port, baud_rate, timeout=timeout)

ser.write(b"SYST:REM\r\n")  # Put the instrument in remote mode

duration = 1200  # Duration in seconds
interval = 0.020  # Interval between current measurements in seconds (20 ms)

timestamps = []
currents = []

# Specify the file path and name to save the data
file_path = "CXXXXXX/Current/data.txt"

# Open the file in write mode
file = open(file_path, "w")

start_time = time.time()
end_time = start_time + duration

while time.time() < end_time:
    # Trigger a current measurement
    command = "MEASure:CURRent:DC? 1\r\n"
    ser.write(command.encode())

    # Read response
    response = ser.readline().decode().strip()
    current = float(response)

    current_time = time.time() - start_time
    timestamps.append(current_time)
    currents.append(current)

    # Write the current and time values to the file
    file.write(f"{current_time:.3f}s, {current}A\n")
    file.flush()  # Flush the buffer to ensure immediate writing to the file

    print(f"Time: {current_time:.3f}s, Current: {current}A")

    time.sleep(interval)  # Wait for the desired interval before the next measurement

# Close the serial connection
ser.close()

```
\$\endgroup\$
8
  • 1
    \$\begingroup\$ The arduino should be able to measure at that rate (technically it can measure about every 0.1msec)- try posting your code \$\endgroup\$
    – BeB00
    Commented Jul 18, 2023 at 17:20
  • \$\begingroup\$ I tried with arduino uno and a current sensor. But it was't measuring at every 20ms, even though the code was for every 20ms \$\endgroup\$
    – Teena
    Commented Jul 18, 2023 at 17:50
  • 1
    \$\begingroup\$ Post your code, and then we can look at it and see what's wrong. The arduino hardware can measure much faster than that, and so your code must be the problem \$\endgroup\$
    – BeB00
    Commented Jul 18, 2023 at 17:52
  • \$\begingroup\$ A multimeter set to 1 PLC of integration time will do this automatically. So can your Fluke very certainly. If you are measuring a constant current source, you should use a rather stable measurement device, otherwise you will mainly see 1/f noise from your measurement device. Therefore, I would advice against the Arduino. \$\endgroup\$
    – tobalt
    Commented Jul 18, 2023 at 18:22
  • \$\begingroup\$ @tobalt It says meter data is sampled every 125ms for Fluke 8845A DMM. Even I tried with NI virtual bench also. But that also didn't work. Do you know any DMM which will work to measure samples at 20ms? \$\endgroup\$
    – Teena
    Commented Jul 18, 2023 at 18:45

1 Answer 1

0
\$\begingroup\$

The way how you design your code to communicate with the multimeter, it will use "software" timing, i.e. the sample distance will be given by how fast your software communicates to the device and how fast that device's internal communication frontend will make changes happen to its core.

If you want deterministic sample timing, you need hardware timing, i.e. set up the device to integrate each reading for 1 PLC or 20 ms and throw these readings into its output data buffer. The device will then typically trigger itself from an internal clock source.

Then at whatever intervals you wish, read what is available in the buffer, e.g. each second you can read ~50 points.

This is universal and not limited to the DMM.

\$\endgroup\$
3
  • \$\begingroup\$ I din know this before. Thanks a lot for this information. I will use the SCPI commands to set the trigger of the internal clock as 20ms. Thanks again \$\endgroup\$
    – Teena
    Commented Jul 19, 2023 at 10:43
  • \$\begingroup\$ Could you please elaborate on how this can be done? I tried with so many options and it din work. I am not able to change it in the multimeter manually. I tried using Python program, but I couldn't achieve the result. If you have any example programs, it would be a great help. \$\endgroup\$
    – Teena
    Commented Jul 26, 2023 at 5:02
  • \$\begingroup\$ @Teena I don't know. I don't have any of these multimeters. But setting them up to run with an internally clocked integration time and then requesting a bunch of points from them is expectedly core functionality. If you can't find it in the user guide, then at least Fluke I guess will respond to a support query \$\endgroup\$
    – tobalt
    Commented Jul 26, 2023 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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