ECG Wave form on oscilloscope with PIC?

Discussion in 'Embedded Systems and Microcontrollers' started by Pinnacle187, May 29, 2016.

  1. Pinnacle187

    Thread Starter New Member

    Apr 28, 2016
    13
    0
    Hello everyone, does anyone have an idea how to display an Electrocardiogram waveform on an oscilloscope using a PIC16F88 or 16F84a. I have a the idea of how the physical conection of the PIC should be, but I have no idea how to display a wave form of funcion on an oscilloscope. This is the image of the waveform...:
    [​IMG]
     
  2. dannyf

    Well-Known Member

    Sep 13, 2015
    1,819
    362
    the basic principle is simple and well known.

    what is it then?
     
  3. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,290
    1,255
    I don't think you need a PIC, but you do need a good amplifier.
     
  4. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,131
    267
    Are you asking for a method of storing and playing back a sampled version of the waveform using a PIC?

    The hardest part will be getting the waveform into a format that can be stored in memory.
    Once you have that sorted, you can set up a timer that paces playback of sequential samples stored in memory, either via a PWM output or a DAC. (digital to analog converter) The waveform can be looped to create a continuous output.
     
    ronv likes this.
  5. Pinnacle187

    Thread Starter New Member

    Apr 28, 2016
    13
    0
    Yeah essencially, I'm "simulating" and ECG (electrocardiograph). Yes, I knew I'd need to use a converter, but i don't know how to store a waveform, I'm a newbie at this.
     
  6. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,951
    387
    Can I also mention safety here. There must be no risk of high (mains) voltages getting to pads connected across someone's heart. The amplifier and PIC can easily be battery powered but unless the 'scope is battery powered it should be isolated from the rest of the circuitry - probably easiest using opto-isolators.
     
  7. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,131
    267
    Do you intend to connect this in any way to a person? or just look at it on the scope?
     
  8. Pinnacle187

    Thread Starter New Member

    Apr 28, 2016
    13
    0
    NO; it's not going to be conected to a person. I simple want to have the waveform on the scope, but I have no idea how.
     
  9. Pinnacle187

    Thread Starter New Member

    Apr 28, 2016
    13
    0
    You are right really, but I only intend to see thewaveform in the scope, and not conect anything to the peron; it's more like simulatine the waveform.
     
  10. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,951
    387
    So the waveform is a list of data points now?
    The '88 has a PWM (use to output an analog voltage) and enough memory to store your waveform in.
     
  11. DickCappels

    Moderator

    Aug 21, 2008
    2,656
    632
    A classic approach that works well is to have a table of values, say 1/250 (a number out of the air) of a cycle. Every so many microseconds, fetch the next sample from the table and output it to a DAC. When you get to the end of the table, start over at the beginning. The start of a cycle would be a good time to send a trigger pulse to the scope. The waveform appears at the output of the DAC.

    See the example in the text file below.
     
    Last edited: May 30, 2016
  12. Pinnacle187

    Thread Starter New Member

    Apr 28, 2016
    13
    0
    Thank's everyone! I finally got it.
    (tried to put a png image here but it won't load)
     
  13. Pinnacle187

    Thread Starter New Member

    Apr 28, 2016
    13
    0
    Thank's everyone! I finally got it.
     
Loading...