Hi All
I have a question about how to best determine the maximum and minimum trough values of a waveform when there is no negative voltage component (i think the term is DC coupled?).
My Application: I'm building a function generator that outputs a signal between +- 12 V and I want to have a way my microcontroller can read the max and minimum voltage values.
I've attached my circuit below, and to summarise it the DDS waveform is amplified and offset by some op-amps which are controlled by two Pots, the output signal is then scaled to between 0V and 3.3V for my microcontroller (ESP32) with some more op-amps. I was hoping to just use the ADC directly however the sampling rate of the ADC isn't going to be high enough (output signal up to 12Mhz) so I thought I would use a peak detector to capture and hold the max voltage (circuit also below), however since I want to display Pk-Pk voltage I will need to capture the lower voltage too. Because my scaled output signal is all +voltage I don't know how I can capture the lowest part of the waveform?
I know its possible to build a -ve peak detector however I don't believe the ADC on my micro can deal with negative voltages, I guess I could invert the negative part but I thought I would see if anyone here knew how to detect the losest part of a +ve waveform.
I'm open to any other ways I might achieve reading the pk-pk voltage, but also very curious about how to read minimum voltages.
Cheers
I have a question about how to best determine the maximum and minimum trough values of a waveform when there is no negative voltage component (i think the term is DC coupled?).
My Application: I'm building a function generator that outputs a signal between +- 12 V and I want to have a way my microcontroller can read the max and minimum voltage values.
I've attached my circuit below, and to summarise it the DDS waveform is amplified and offset by some op-amps which are controlled by two Pots, the output signal is then scaled to between 0V and 3.3V for my microcontroller (ESP32) with some more op-amps. I was hoping to just use the ADC directly however the sampling rate of the ADC isn't going to be high enough (output signal up to 12Mhz) so I thought I would use a peak detector to capture and hold the max voltage (circuit also below), however since I want to display Pk-Pk voltage I will need to capture the lower voltage too. Because my scaled output signal is all +voltage I don't know how I can capture the lowest part of the waveform?
I know its possible to build a -ve peak detector however I don't believe the ADC on my micro can deal with negative voltages, I guess I could invert the negative part but I thought I would see if anyone here knew how to detect the losest part of a +ve waveform.
I'm open to any other ways I might achieve reading the pk-pk voltage, but also very curious about how to read minimum voltages.
Cheers
Attachments
-
17.5 KB Views: 17
-
8.6 KB Views: 16