How would you make a heart rate simulator that would plug into an oscilloscope? - Page 1
Forum section: electronics / beginners

author: Beamin
author_rank: Super Contributor
timestamp: March 08, 2019, 01:59:38 pm
content: I was watching a old TV show where a person was in the hospital or something and the heart rate monitor was just an analog scope. But they did go through the trouble to make the trace look real. How could you build that using analog parts?You want a flat line to peak up, go down, go up a little bit and ring, then go flat for a second before repeating. The whole thing could be a ring if you could control the signal enough. I'm guessing you would have a signal that only goes to 0V at the very bottom. The flat line part of the "heart beat" would be at say 2V on a scale of 0-5 volts. Of course adjusting the scale of the scope is the easy part. Could you do this using a 555 timer, some caps, and some coils to make it ring? Or would this be way too complex and finicky using analog circuits?Beep Beep Beep BEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEP Time of death is thirteen forty eight hours.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: March 08, 2019, 02:27:50 pm
content: You can have one 555 oscillate at the heart rate, and then a handfull of 555's cascaded, which trigger each otther.Then each 555 can have some resistors / capacitors / diodes to generate a flank that is one part of the ECG.https://en.wikipedia.org/wiki/ElectrocardiographyYou can probably substitute the cascaded 555's for a single 4017, but with 555's you have independent control of each timing period.Either way ti will take some fiddling to get it to work.You can also simply buy a ECG simulator, including buttons for simulating a bunch of different heart conditions.Or:For something that somwhat resemles a heart rate on a scope you can hack something together, but for more accurate signal a uC with DAC becomes attractive rapidly. (Or use an AWG.).

author: Zenith
author_rank: Frequent Contributor
timestamp: March 08, 2019, 02:38:32 pm
content: No doubt it could be done with a 555 timer or two and a few extra bits and pieces.It could also be done with an arbitrary function generator, or several function generators with something to control them, which could be a load of TTL . All this has been around since at least the 70s.There were audio synthesizers in the 60s which I'm sure could have done it.The easiest way to do it for a prop in an old TV show, would have been tape record an hour or so of someone connected to a heart monitor. That would be doing it with analogue parts.

author: rstofer
author_rank: Super Contributor
timestamp: March 08, 2019, 02:55:11 pm
content: Some Arbitrary Function Generators, like the Siglent SDG2082X (and similar models), have this waveform built in.In fact, it has 15 ECG waveforms, plus 9 others.

author: nali
author_rank: Frequent Contributor
timestamp: March 08, 2019, 03:18:07 pm
content: Depends how old the show was, but as Zenith says above probably just recorded. ECG/EKG recorders have been about for quite a while - I was working on some about 30 years ago which used a slowed-down audio cassette tape in a portable recorder.https://en.wikipedia.org/wiki/Holter_monitor

author: ArthurDent
author_rank: Super Contributor
timestamp: March 08, 2019, 07:22:25 pm
content: A few decades ago I got a strange handmade unit in a surplus lot that I bought. It was simply a small slow speed A.C. motor with a few different lobed cams you could place between a light source and a photo detector. The cams were cut so as the motor turned the cams, the output of the photo detector would display an EEG or some other trace on a scope. Somewhat limited but it was simple and it worked for demonstrations back then.

author: JoeO
author_rank: Frequent Contributor
timestamp: March 09, 2019, 03:19:53 am
content: FY3200S will do it for you.https://youtu.be/QhHWjUvPjQY?t=507

author: atmfjstc
author_rank: Regular Contributor
timestamp: March 09, 2019, 05:11:31 pm
content: With frequency and accuracy requirements this low (it just has to look convincing on camera), even using digital electronics is overkill. As someone else said, they probably used a tape recorder, if not, you can generate this kind of waveform with a couple of transistors (or tubes) and some R/L/C components thrown in. One could even have a bit of fun trying to go for the absolute minimum the part count.As for how to do this today, the lowest-cost solution I can think of is to just grab a .wav of an ECG off the Internet and play it through your soundcard.

author: Beamin
author_rank: Super Contributor
timestamp: March 09, 2019, 09:12:23 pm
content: The purpose isn't to make it look real it's to learn how to manipulate voltages and slow oscillators built from very simple parts with the most complex being a 555. The cam/light idea sounds novel but I'm more into electronics then mechanical bits. It will also give me practice with my scope as I never did get to play with it much since I bought it. Plus it has the occasional dreaded fan noise that goes on and off since its an older Tek, usually a light tap or angle adjust makes it go away.What kind of LC circuits? uf sized Electrolytic caps and hand wound toroid style inductors? Would one 555 control a group each of which makes one part of the trace? Or would it be better to cascade them? I really don't know where to start.

author: tautech
author_rank: Super Contributor
timestamp: March 09, 2019, 09:26:51 pm
content: Quote from: rstofer on March 08, 2019, 02:55:11 pmThe somewhat cheaper SDG1032X can do these too and along with a scope that can do Pass/Fail masks with their logic level BNC Fail output it would be quite simple to do..........just align it to a clock to get the time when it fails the mask test.

author: janoc
author_rank: Super Contributor
timestamp: March 09, 2019, 09:46:34 pm
content: Probably a phone with a pre-recorded audio file and connected to the scope using the headphone jack would be the simplest and fastest way to do it (tape recorder in the past but these days people are more likely to have a phone than a working tape deck!).

author: trophosphere
author_rank: Frequent Contributor
timestamp: March 09, 2019, 11:19:08 pm
content: Here you go:Frank's ECG Simulator

author: IanB
author_rank: Super Contributor
timestamp: March 10, 2019, 12:24:49 am
content: Quote from: Beamin on March 09, 2019, 09:12:23 pmThe way I would approach it would be to build an analog model of the system. The way the heart works is fairly well documented. There is a pacemaker that sets out the basic rhythm like a metronome. Signals propagate out from the pacemaker and trigger other events in a cascade that generates the various parts of the waveform (P, Q, R, S, T). Roughly speaking, the triggered events are things which charge up slowly and discharge rapidly when triggered. These could be modeled perhaps with capacitors that have charging and discharging circuits. The various parts are all superimposed to produce the final waveform.

author: Beamin
author_rank: Super Contributor
timestamp: March 14, 2019, 11:18:41 pm
content: Quote from: trophosphere on March 09, 2019, 11:19:08 pmThat's exactly what I was looking for. I didn't think the IC could have powered those caps but I always think you need to add transistors for amplification. If you wanted LEDs to go off with each pulse then the IC would need amplification at each "step" of the wave? How many mA can an IC put out and do you need to current limit it like an LED? IF you did this with 555 timers would you need to cascade them?

author: Rick Law
author_rank: Super Contributor
timestamp: March 16, 2019, 01:40:18 am
content: If the output is all that is important, this looks like an easy job for an Arduino to handle.One may need a capacitor to smooth the rise/fall, besides that, how the "patient is doing" can easily be programmed in your Arduino - you can make your custom "death scenario" : from a very excited state, to erratic movement, to flat line, then come back with a few random beats, then flat line again... then ... RIP!I like a random single/double/triple beats after a random 10's of second pause, you know, to keep the relatives hopeful, then quiet... Just as they begin to count their inheritance, it beats normal again. Grandpa is back... You'll have to wait a bit longer for your Gran Torino after all.

author: Beamin
author_rank: Super Contributor
timestamp: May 07, 2019, 04:37:46 pm
content: Quote from: Rick Law on March 16, 2019, 01:40:18 amI find it interesting that about half the people seem to think this needs to be a product or device that does something useful. A lot of my threads have responses like this. It was the opposite , it was so I could learn ways to use analog components to manipulate signals. In other words not cheat and just use an Arduino. Making a flashing LED using code and an Arduino, is NOT learning electronics and not that much fun. Code can be tedius when you don't know the syntax which is always what gets me at first.

author: Rick Law
author_rank: Super Contributor
timestamp: May 07, 2019, 10:39:12 pm
content: Quote from: Beamin on May 07, 2019, 04:37:46 pmWell, Beamin... Communication is a rat's nest... I wish you quoted someone else. As you picked mine, so I feel I should answer...I did caught your statement"How could you build that using analog parts?" in the OP. I was not sure you really mean getting fun/educationout of buildingor fun/educationout of playing with the resulting gadget. My suggestion is premised on "if the output is all that is important" - if you are aiming at playing with the resulting gadget producing the simulated heartbeats, that would be a quick way of doing it.I suppose most of the "missed" replies fall into the same category - unsure about what you are aiming for, took a guess, and missed.Why I wish you quoted another one: your point is "I find it interesting that about half the people seem to think this needs to be a product or device that does something useful." Simulation by MCU or by simulation by analog components are equally useless for real measurement... So I took a guess in what you mean instead of what you said and wrote this reply accordingly...

author: rstofer
author_rank: Super Contributor
timestamp: May 07, 2019, 11:08:19 pm
content: Quote from: trophosphere on March 09, 2019, 11:19:08 pmThere are some RC circuits hanging around the edges smoothing out bumps but that simulator is effectively digital. The 4521 is a 24 stage frequency divider and the 4017 is a quad and-or-select gate.A clever implementation. Even using an Arduino would still require all the RC networks so there isn't much to be gained by using one.That simulator turns up near the top of a Google search 'ecg simulator diy'