Hi all,
I am hoping someone could help me with a project I am building and have got stuck at the close to the final hurdle. I am by no means an expert here so sorry if I say something stupid or don't explain the nature of the problem well.
The project is to take digitised versions of patients single lead ECGs, store them on an SD card and then output them accurately as an analogue signal through the use of the Arduino MKR1000 board and the DAC mentioned above. I have all of the early signal work done as well the microcontroller device working, with it taking the digital signal from the SD card , scaling , normalising and outputting it from the DAC. I am now having some issues though as the signal output needs to obviously be the same as (or as close as I can get it within my now limited timeframe) to the original recorded signal that was stored on the SD card.
The issue here is that the output from the DAC is 0 to 2.5 volts but my min voltage is -0.695mV and my max value is 1.05 mV in the real word for one of my signals. The max and min voltages vary slightly from signal to signal but I will work out averages later for the best max and min values to go off. For now though I obviously need to scale and shift the voltage output to between these levels.
I have read how some people do this with voltage dividers and a high pass filter but I would like to use an op amp as from what I have read these are more precise and reliable. I do not have a clue how to do this though and what I am reading online is confusing and making me worry I will go down the wrong route, wasting precious time. Has anyone done something like this before or do they know how to do it ? Any advice is greatly appreciated. Thankyou.
Are you saying that you want to take a 0-2.5V output and transform it to -0.000695V - 0.00105V?
If I'm understanding that correctly, you are well into the region of precision analog measurements.
It's certainly doable, but with all respect, it's not a beginner project. The basic approach is to use a precision opamp to subtract 1.25V from the output so you get +/- 1.25V and from there you can use dividers to get to +/- 1mV.
That's the theory. I think you'll find getting a usable signal much harder than it seems. My first concern is how you're going to measure the output to verify that it's correct.
Thank you for the speedy reply and yes I see your point. Sorry, I should have been more clear. I do not need to do a "perfect" recreation of the original signal its more of a "suitable" recreation. So the recreation signal that I output should still have the same shape as the initial recorded one and fall in the same voltage range but the data points to not need to be in the exact same place with near perfect precision. The goal here is so that you can still obtain the characteristics and trends of the initial signal from my new one , if that makes sense ? Can I ask how you go about using an op amp to do what you say here? I am struggling to make sense of how I set the op amp up to do this as well as which op amp I should purchase. From what I have found so far I think the Texas Instruments OPA2333 seems like a fair choice as its low power so I can run my device from battery as I wish and its supply range is suitable with the mkr1000. Would you agree with that?
It should be fine. It's a low power, relatively low offset voltage op-amp. At the very least, it's a good start.
You'll also need, as @jim-p mentions, positive and negative supplies. So, let's add that. A0305S-1WR3 Mornsun America, LLC | Power Supplies - Board Mount | DigiKey
takes a 3V supply and provides +/-5V outputs. Probably good enough: didn't check any other specs, but ripple voltage may be critical in this application.
So we have an opamp and a power supply, what circuit do you need. You can find basic subtraction circuits online, but here is a good tutorial, with a worksheet, on the design process:
Follow that to subtract a fixed 1.25V from your DAC signal and you will have a bipolar output. From there it's a matter of using resistive voltage dividers to get the signal into the range where you need it.
Thank you so much for the help. I really appreciate it. I have a couple of things which I am unsure about though as I am very much trying to learn as I go here so sorry for all the questions. Are you just trying to alter the offset of the signal with the op amp to shift it to -1.25 to +1.25 and not alter the gain in any way. You then scale the signal down to mV level using the voltage dividers separately. The reason that I ask is I tried to use the tutorial you posted there with the below values and I got a positive m value of 0.000698 and negative b value of -0.000695 meaning I should jump to stage 4 but then when trying to work out the rG value using a 100 kohm rF the numbers that result make no sense and are negative. Is this because the gain value I require is too small for this application hence why you only used the op amp to alter the offset by -1.25? If this is the case it feasible to use cascading op amps to achieve this or do you still think its better to just use the voltage divider to reduce the voltages with one op amp? The values i used for stage one are :
Vref = 2.5 volts
Voutfs (full scale output voltage)= 1.05mV
Voutzs (zero scale output voltage) = -0.695mV
Vinfs( full scale input votlage) = 2.5 v
Vinzs ( zero scale input voltage) = 0 v
Again thankyou for the help and sorry if i am not understanding something obvious here.
That would be my suggestion. It's at a relatively high voltage, so it's probably the easiest part of all this. When you try to attenuate the signal, it's best done by resistors (or perhaps a multiturn potentiometer).
If I were doing this, I'd look for an off the shelf bipolar high resolution precision DAC where all the hard work is done for me, but I can't think of a source off the top of my head.
Ok perfect , thank you so one op amp to shift across 0 from -1.25 to +1.25 powered by DC -DC converter then voltage dividers down the rest of the way to my mv levels. Hope I have got that right . Thank you for the assistance , that is a huge help.
Thank you for the help also jim and yes that could work no bother as the lower and upper limit jumps about from signal to signal so i am just trying to find levels that i can make work best.