giovannelucas_

Joined Jan 5, 2023
34
Hi Everyone,

I'd like to request help with understanding how to apply an ADC to my circuit.

I have an analogue filtered signal and would like to convert it to a digital signal in order to process it with a computer.

I do not understand why it has two inputs (ADS1251) IN+ and IN-.
What about Vref? What is its purpose and how do I select it? I know it's related to the resolution of the output signal.

Does an ADC need a MCU to control it? Is it related to the SCLK and CLK pins?

Does anyone know of a good book or tutorial that has example circuits of ADCs and how to implement it?

Thank you.

ericgibbs

Joined Jan 29, 2010
18,209
hi gio,
Check out this ADS1251 PDF , it shows the purpose of the +/-Inp and also gives details of the MCU.
E

Attachments

• 598.2 KB Views: 5

giovannelucas_

Joined Jan 5, 2023
34
hi gio,
Check out this ADS1251 PDF , it shows the purpose of the +/-Inp and also gives details of the MCU.
E
View attachment 299590View attachment 299592
Hi Eric,

I read it and sorta of understood it. Not completely. I still do not understand what is the purpose of the IN- input port.
I found the bipolar circuit on the datasheet and also a second circuit. How do I know which is best for digitalizing sensor data?
Do I need a microcontroller to control the SCLK and CLK ports? Or should I use it to collect data via a digital pin and create a CSV file?

Attachments

• 36.3 KB Views: 4

ericgibbs

Joined Jan 29, 2010
18,209
Hi gio,
Look at the circuit you posted.
The input signal is always positive with respect to 0v, so the -IN is at 0V, this means you can only measure with the ADC a positive going signal.
A bipolar voltage signal means the voltage can swing above and below 0V, ie: +/- voltage can be converted by the ADC.

What voltage signals are planning to convert to digital using the ADC?

Do you follow.?

giovannelucas_

Joined Jan 5, 2023
34
I see Eric, thanks for the response.

I plan on digitalizing an ECG signal which is positive and negative, thus I'd need the bipolar circuit correct?

Can I use the bipolar circuit shown in the datasheet?

How do I figure which voltage range to use? The max amplified signal would be around 2.2V.

Would my Vref be 0 then?

ericgibbs

Joined Jan 29, 2010
18,209
hi,
You could use the d/s bipolar circuit, choose the +/-2.5V signal range.
You must have all 3 OPA's in order to shift the Vout to 0V, the signal into the ADC, would be +/-2.2v range from your ECG amplifier.
An ECG usually swings above and below zero volts
Your Vref will be as the circuit shows
Zero Bit pattern will be 000000H

E
@giovannelucas_
Update: do you have a sample heartbeat image of the output of your ECG, to post?

Last edited:

giovannelucas_

Joined Jan 5, 2023
34
What about the CLK and SCLK pins?
I plan on sending the digitalized signal to a UART to USB converter to further process the signal using an Linux Based application.
I'd probably need a MCU to create a csv file on the board, and export it somewhere else, correct?
Does the ADC need a MCU controlling the CLK and SCLK pins? I know there are to set the sampling rate correct?

ericgibbs

Joined Jan 29, 2010
18,209
hi,
You need an MCU programmed to send/receive the data bit string.
E

giovannelucas_

Joined Jan 5, 2023
34
hi,
You could use the d/s bipolar circuit, choose the +/-2.5V signal range.
You must have all 3 OPA's in order to shift the Vout to 0V, the signal into the ADC, would be +/-2.2v range from your ECG amplifier.
An ECG usually swings above and below zero volts
Your Vref will be as the circuit shows
Zero Bit pattern will be 000000H

E
@giovannelucas_
Update: do you have a sample heartbeat image of the output of your ECG, to post?

View attachment 299622
Yes, I used a open-sourced software to plot it. But I had to make changes to the circuit. Unfortunately, I won't be able to test it on a breadboard as the components are mainly SMT. Therefore, I'll have to design it first and send it off to manufacture before testing, hopefully it'll work on the first try. I used an analog input port of an arduino to receive the signal to the computer. I'm trying to substitute the arduino for the ADC and MCU on the board to make it more neat. What's your opinion?

Attachments

• 124 KB Views: 8

ericgibbs

Joined Jan 29, 2010
18,209
Hi @giovannelucas_

I have modelled the OPA, looks OK, tested with a heartbeat wav file.
Note bipolar signal Vin and a 2.5v centre Offset signal on the Va output, and +2.5V on the Vb for the ADC +IN and -IN

E

Last edited:

giovannelucas_

Joined Jan 5, 2023
34
Hi @giovannelucas_

I have modelled the OPA, looks OK, tested with a heartbeat wav file.
Note bipolar signal Vin and a 2.5v centre Offset signal on the Va output, and +2.5V on the Vb for the ADC +IN and -IN

E
View attachment 299637
Nice Eric.
Are you using LTSPICE?
Is the ECG Sim a heart beat simulator circuit? Or do you have to import a wav file in order to simulate it?
I'm pretty new to simulating circuits.
On the datasheet it says the ADC has a serial interface, how can I send the output data through usb?

Last edited:

ericgibbs

Joined Jan 29, 2010
18,209
hi gio,

Are you using LTSPICE?

Is the ECG Sim a heart beat simulator circuit? Or do you have to import a wav file in order to simulate it?
You then input the wav file into your circuit simulation.
In order to set the wav signal amplitude to suit your circuit, a simple preconditioning circuit maybe required.

I'm pretty new to simulating circuits.
LTS has a steep learning curve, but there are many members on AAC who can assist you.

On the datasheet it says the ADC has a serial interface, how can I send the output data through USB?

The serial interface output of the ADC is a 24 Bit sequence, composed of 3, 8 Bit bytes.
You require an MCU to clock the 24 Data Bits out of the ADC, into the MCU
The MCU can also be used to convert the Bit readings to be displayed as a numeric value on an LCD display, or sent to a PC via the MCU's onboard UART.

The Arduino has a series of MCU boards that are suitable, the PC software IDE is a free download.

Hope this helps

E

giovannelucas_

Joined Jan 5, 2023
34
hi gio,

Are you using LTSPICE?

Is the ECG Sim a heart beat simulator circuit? Or do you have to import a wav file in order to simulate it?
You then input the wav file into your circuit simulation.
In order to set the wav signal amplitude to suit your circuit, a simple preconditioning circuit maybe required.

I'm pretty new to simulating circuits.
LTS has a steep learning curve, but there are many members on AAC who can assist you.

On the datasheet it says the ADC has a serial interface, how can I send the output data through USB?

The serial interface output of the ADC is a 24 Bit sequence, composed of 3, 8 Bit bytes.
You require an MCU to clock the 24 Data Bits out of the ADC, into the MCU
The MCU can also be used to convert the Bit readings to be displayed as a numeric value on an LCD display, or sent to a PC via the MCU's onboard UART.

The Arduino has a series of MCU boards that are suitable, the PC software IDE is a free download.

Hope this helps

E
Hi Eric, sorry for the late reply. I was doing some reading on the topic.
I read on the ADS 1251 datasheeet the clock frequency for CLK and SCLK is 8MHz. However, the minimum frequency for ECG is 500Hz. I read also that the clock frequency relates to the time span in which data is transmitted (START and END of byte transmission). Is 500Hz matched with clock frequency or is it a different thing?
I also read about the SCLK which is LOW for data transmission and HIGH for power-down mode. Therefore it should be HIGH based on the graphs you showed before right?
I saw a lot of tutorials about the STM32F4... and was planning to use it as it has UART, I2C and SPI interfaces. Should I use SPI as it has a higher data transfer rate then UART and would probably yield a better resolution for the ECG?

Is SPI the simplest way to send data through USB? Do you have any schematic examples or projects?

I found a USB to SPI converter MCP2210, could I use it in the project?

I was thinking of sending the digital out of the ADC to the MCU through a digital in pin and then use the SPI/USB interface to the computer.

Is there a book I can read on this topic? I'm a little confused about how to set a SPI interface based on a ADC output to a MCU and how to send it through USB to a computer and read it with Arduino IDE or STM32IDE or python.

Last edited:

ericgibbs

Joined Jan 29, 2010
18,209
hi gio,
Are you trying to convert all of a heartbeat pulse to an ADC value, by sampling at a fast rate and then transmit the the ADC count value to a PC via the MCU USB, and do that again for every heartbeat.?

What rate do you want to sample the heartbeat signal?
ie: how many samples per pulse beat.

You must consider the maximum UART Baud rate that you intend to use between the MCU and the PC

E

Last edited:

giovannelucas_

Joined Jan 5, 2023
34
hi gio,
Are you trying to convert all of a heartbeat pulse to an ADC value, by sampling at a fast rate and then transmit the the ADC count value to a PC via the MCU USB, and do that again for every heartbeat.?

E
Yes that’s correct. I want to create a plot of the ecg voltage along time. I read the minimum acceptable rate is 500MHz according to US regulations.

ericgibbs

Joined Jan 29, 2010
18,209
Hi gio,
I don't understand the 500MHz requirement.?
The fastest ADC rate you can sample is shown in the data sheet
~20kHz.

For the UART you could use 115200 Baud, that is approx 11520 8Bit Bytes /sec, but for a 24Bit ADC value that mean 3 Bytes per sample, 11520/3, means roughly 3840 samples/sec, at best.

So if the actual pulse voltage period lasts for say 0.5 Seconds. that's ~ 2000 samples/pulse period.
I would design for 1000 samples, do the sums and see what your calculations show.
E

giovannelucas_

Joined Jan 5, 2023
34
Hi gio,
I don't understand the 500MHz requirement.?
The fastest ADC rate you can sample is shown in the data sheet
~20kHz.

For the UART you could use 115200 Baud, that is approx 11520 8Bit Bytes /sec, but for a 24Bit ADC value that mean 3 Bytes per sample, 11520/3, means roughly 3840 samples/sec, at best.

So if the actual pulse voltage period lasts for say 0.5 Seconds. that's ~ 2000 samples/pulse period.
I would design for 1000 samples, do the sums and see what your calculations show.
E

View attachment 299797
Hi Eric, sorry for the late reply. I've been working on a arduino test board this couple of days.
"ECG recorders include sampling frequencies of more than 100 Hz, up to 500 Hz, or in lab environments up to 1000 Hz."
Sorry, it's not supposed to be 500MHz.
Let's assume I want to use 1000Hz sampling frequency for better resolution.
Would UART be able to handle it?

I plan on incorporating this design into my board to send the UART data via USB to a PC: https://www.pcbway.com/blog/PCB_Design_Tutorial/USB_to_UART_Converter_using_Microchip_MCP2200.html

ericgibbs

Joined Jan 29, 2010
18,209
Hi gio,
The MCP220 d/s shows it can be run at 115200 Baud.
With the basic information, an ADC sampling and UART transfer rate of 1kHz samples should be possible.
Check that the STM MCU and PC programs are written to ensure the sample and transfer/process rate is fast enough to support this rate.

E