Author Topic: Help replicating a medical device  (Read 4790 times)

0 Members and 1 Guest are viewing this topic.

Offline jonchooTopic starter

  • Newbie
  • Posts: 1
  • Country: gb
Help replicating a medical device
« on: October 14, 2019, 11:45:30 am »
(purely for non-profit, personal entertainment purposes of course).
The device in question is called a non-invasive vagus nerve stimulator (nVNS). Commercial models cost a ridiculous amount for what they do (electrically speaking) and some even require the patient to buy "top up cards" every month, or the device bricks itself. Draw your own conclusions about whether that is ethical or not.
Fortunately, as I mentioned, these devices are electronically simple. They are more or less TENS units operating with specific pulse patterns. I have already recreated one such pattern as an audio file using information gathered here : https://www.accessdata.fda.gov/cdrh_docs/reviews/DEN150048.pdf?fbclid=IwAR3moTZ3iikhwRm_k5_MGb8QdiEBnFo5l5zvTXi1KhRzGG6RdcrtQcc1Too
I'd appreciate it if somebody could double check it for me. The wav file is here : http://www.filedropper.com/gammacorewaveformreconstruction
My idea is to play files like this from a smartphone into a device which would recreate the electrical pulses at the correct voltage and current.
My ideas are
1) a simple mono audio amp circuit from ebay. I need help with how to limit/boost the output to the required specs (24v 60mA biphasic), and how I could measure this without a scope.
2) hack the signal into an existing TENS unit (can be bought on ebay for <$30).
3) ??? your idea here ???
What load/instrument configuration could be used to replicate/test the action of such a device on skin (again, I don't have a scope)?
Thanks for reading
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10234
  • Country: nz
Re: Help replicating a medical device
« Reply #1 on: October 14, 2019, 11:52:45 am »
I'm not suggesting you should try what i say below, or that it would be safe to do so.
The TENS hardware might be physically capable of delivering more power than what's safe. So messing around with it might not end well.
It's possible to get nerve damage if you inject the wrong current/pulse patterns.
Also I'm not a doctor.

But.. here's how I might go about doing this, if it was me.

Buy a TENS unit.
Take it apart.
Locate the microcontroller (assuming it has one)
Probe/Monitor how the microcontroller is working to drive the rest of the circuitry.
Remove the micro controller and solder in a new (blank) micro controller of the same type.
Write some code for the microcontroller to drive the TENS unit hardware, except using the new pulse pattern.
This of course assumes that TENS units can output in the right voltage and current ranges, and in the right polarity to match a nVNS.
If not it would need to be further modified.
« Last Edit: October 17, 2019, 04:41:49 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: jonchoo

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13126
Re: Help replicating a medical device
« Reply #2 on: October 14, 2019, 12:46:15 pm »
I'm echoing Psi's IaNaD disclaimer and safety concerns, however:

24V, 60mA biphasic is well within the capabilities of a HV OPAMP, with a simple complimentary emitter follower current booster output stage.   If the supply rails for the OPAMP and output stage are set at +/-26V, and are strictly current limited to 65mA, it would be physically incapable of exceeding the max voltage or current by more than 10%.

Assuming that the output specs are set conservatively, 10% over is unlikely to be significantly more hazardous than the max. specified output.

I hope I don't have to tell you that such experiments should be powered from a fully floating limited energy battery pack, not from any sort of mains adapter!


Doing this sort of development work without a scope will be at *LEAST* ten times harder than with one.  As you are interested in relatively low frequencies even a crappy scope will be better than none at all.  However you *MAY* be able to get by with your PC soundcard line in and Christian Zeitnitz's Soundcard Oscilloscope which, with an appropriate probe, attenuuator and buffer, will at least let you probe around a circuit and check waveforms.  However it CAN'T show you DC offsets as the soundcard input is AC coupled, and if you get the soundcard scope's input circuit design wrong there is a significant risk of blowing up your PC at which point you will wish you'd bought a cheap standalone real scope! 

Also to reduce the risk of becoming the 'scratch monkey'use either a battery powered scope or a laptop running on battery with no other wired connections, so its fully floating if you are performing tests with a live patient.  *DO* *NOT* *EVER* attempt to 'float' (disconnect the ground from) a mains powered scope or use one for tests with a live patient.
« Last Edit: October 14, 2019, 12:58:31 pm by Ian.M »
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: Help replicating a medical device
« Reply #3 on: October 14, 2019, 04:43:05 pm »
Code: [Select]
#include <disclaimer.h>
Locate the microcontroller (assuming it has one)
Probe/Monitor how the microcontroller is working to drive the rest of the circuitry.
In the cheapest TENS units, the micro is an STM8S003 with debug port enabled. The output driver is a small laminated transformer driven by a few transistors. All is powered from a 9V "transistor" battery. Happy SWIMming!
"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 

Offline mzzj

  • Super Contributor
  • ***
  • Posts: 1282
  • Country: fi
Re: Help replicating a medical device
« Reply #4 on: October 14, 2019, 05:11:19 pm »
Tiny audio transformer  and power opamp or PWM modulated H-bridge would handle the power stage easily.  Almost any microcontroller can generate the pulse pattern shown in the patent application.

https://www.ajmc.com/journals/supplement/2017/economic-considerations-in-cluster-headache-and-non-invasive-vagus-nerve-stimulation/costeffectiveness-of-gammacore--noninvasive-vagus-nerve-stimulation--for-acute-treatment-of-episodic-cluster-headache

10000 usd per year?  :-DD
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: Help replicating a medical device
« Reply #5 on: October 14, 2019, 05:44:44 pm »
That's right, mzzj. Welcome to America, where markets have replaced society.
"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 

Offline Audioguru again

  • Regular Contributor
  • *
  • Posts: 115
  • Country: ca
Re: Help replicating a medical device
« Reply #6 on: October 14, 2019, 06:02:08 pm »
On Google it says that the Vagus Nerve controls bodily functions that keep you alive like your heart, breathing and blood pressure. At best you become faint and at worst you DIE!
Why play with it??
 
The following users thanked this post: RJSV

Offline atmfjstc

  • Regular Contributor
  • *
  • Posts: 121
  • Country: ro
Re: Help replicating a medical device
« Reply #7 on: October 14, 2019, 09:54:26 pm »
IANAD, but I'd like to second Audioguru's warning. Having been on the receiving end of a number of nasty episodes atributable to dubious vagus nerve behavior, I can attest that it's something you should be wary of interfering with if you don't know exactly what you are doing. You can definitely faint and in principle even get yourself killed.

I'm no lover of bureaucracy and credentialism, but medical gear goes through a process for a reason. At the very least one needs to ensure that the target of any such experimentation is in excellent health, their vitals are continually monitored, and there is a team on standby to intervene if something goes haywire...
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Help replicating a medical device
« Reply #8 on: October 15, 2019, 05:06:03 am »
On Google it says that the Vagus Nerve controls bodily functions that keep you alive like your heart, breathing and blood pressure. At best you become faint and at worst you DIE! Why play with it??
Fully agree. I would avoid making device which can cause:

Quote
Shortness of breath (dyspnea), hoarseness, or change in voice during treatment
Muscle twitching, discomfort, or pain during stimulation
Change in taste (dysgeusia)
Skin irritation/inflammation
Progression of headache symptoms
Tingling, pricking, or a feeling of “pins and needles”
paresthesia or dysaesthesia
Fainting (syncope), light-headedness, and/or dizziness
Sweating
Fatigue, depressed mood
Tinnitus
Diarrhea
Abnormal heart rhythm

Modifying TENS is wrong idea anyway because they have much higher output voltages (~100V or so), less current capability. Note that +-24V output can be easily made using +12V single supply bridge amplifier:

 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10234
  • Country: nz
Re: Help replicating a medical device
« Reply #9 on: October 17, 2019, 04:49:36 am »
All warnings standing.
If it was me who was being forced to pay through the nose to buy 'top up cards' in order to push buttons on an electrical device
Then you bet your ass i would start building my own version.
I would not do it blindly though, i would have the real unit as well and do side by side comparisons.
Make sure my unit exactly matched the voltage/current/freq of the real unit. etc.
« Last Edit: July 07, 2022, 01:37:13 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: Help replicating a medical device
« Reply #10 on: October 17, 2019, 11:56:22 am »
I think I'd be spending my time working out how to hack the top up card mechanism instead of building a device which could kill me...
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10234
  • Country: nz
Re: Help replicating a medical device
« Reply #11 on: October 17, 2019, 12:10:16 pm »
I think I'd be spending my time working out how to hack the top up card mechanism instead of building a device which could kill me...

yeah, that's a fair point.
But usually when it's a top-up style arrangement you don't actually own the device.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline vctls

  • Newbie
  • Posts: 7
  • Country: fr
Re: Help replicating a medical device
« Reply #12 on: June 19, 2022, 10:07:24 am »
Hi! Sorry for digging up this topic, but I'm trying to do the same and I'd appreciate any help I can get. My electronic skills are somewhat limited.
I managed to get my hands on a used but working device. It is "empty", though. I do have one "refill" card but it is also used, so I have no way to trigger impulsions, at least the normal way.
I will post photos of the PCB and information from the manual if that can improve my chances of replicating it correctly, or maybe make it work without refills.

Edit:
huh, actually, the manual is available on the FDA site as well: https://www.fda.gov/media/139970/download
Not exactly the one I have, but it's more or less the same. There's some information in the "product handling" section, but it doesn't add much to the classification request OP already posted (link without FB tracking ID, btw: https://www.accessdata.fda.gov/cdrh_docs/reviews/DEN150048.pdf ):
Quote
• Maximum Output: 30V (peak), 60mA (peak)
• Load Impedance: 450 to 550 Ohms
• gammaCore Sapphire CV produces an electrical signal consisting of five 5,000-Hz pulses, repeating at a rate of 25 Hz. The waveform of the gammaCore Sapphire CV pulse is approximately a sine wave.
« Last Edit: June 19, 2022, 10:22:32 am by vctls »
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3890
  • Country: nl
Re: Help replicating a medical device
« Reply #13 on: June 19, 2022, 05:25:31 pm »
The hardware is probably cheap, but a part of the price is in the paperwork that claims it works without harm and the stamp or signature at the bottom.

Bot most of it seems to be in exorbitant profit margins.
This link: h t t p s ://pubmed.ncbi.nlm.nih.gov/29144720/ suggests that it costs USD 9510 per year to use the thing.

Forcing  users to buy top up cards for no other reason than to extract more money from them does not conform to my idea of ethical. I'm guessing the most expensive part of the whole thing is the plastic casing around it.

Maybe you can get similar results with one of those dog shock collars from aliexpress or ebay.

For hacking something together, my first thoughts would be to use an audio amplifier IC such as a TDA2030, and combine that with some extra features such as current limiting, an automatic timer cutoff, and some extra "safety features", but then you still do not have the paperwork that should go with it. It seems much more sensible to hack into the existing device and either just circumvent the money extorting part or only use the power stage and replace the signal generator section completely. But none of these methods are very suitable for "beginners" in electronics.
« Last Edit: June 19, 2022, 05:43:59 pm by Doctorandus_P »
 

Offline Teledog

  • Regular Contributor
  • *
  • Posts: 217
  • Country: ca
Re: Help replicating a medical device
« Reply #14 on: June 23, 2022, 12:30:11 am »
Uh,
not sure if this is what you're looking for, but..
https://milovana.com/forum/viewtopic.php?t=23302
 

Offline vctls

  • Newbie
  • Posts: 7
  • Country: fr
Re: Help replicating a medical device
« Reply #15 on: July 18, 2022, 11:34:18 am »
Here are the photos:
https://imgur.com/a/tVidHvU

And by the way, here are the FCC and IC IDs:
TFB-BT2
5969A-BT2

Of course, a lot of the stuff in this device is probably useless. The display, RFID, wireless charging, Bluetooth…
Why is there even Bluetooth on this thing? It's not even mentioned on the manual. It might have something to do with this app:
https://play.google.com/store/apps/details?id=com.macro.ecore.dotAo&hl=en&gl=US
It tried to install it but it just throws some error.
Or maybe it's some programming interface?

I have little hope of actually hacking the chip. I wonder if it would be possible to remove it entirely and replace it with a basic controller that would just send the signal to the amplifier stage.
From the specs, it seems the signal is just a 1ms pulse at 5 000 Hz repeated every 40 ms (something like the attached sound file). That shouldn't be to hard to generate.
Actually, these numbers seem so convenient that I'm left wondering how they came up with them in the first place…
« Last Edit: July 18, 2022, 12:35:30 pm by vctls »
 

Offline vctls

  • Newbie
  • Posts: 7
  • Country: fr
Re: Help replicating a medical device
« Reply #16 on: July 19, 2022, 07:56:47 am »
Modifying TENS is wrong idea anyway because they have much higher output voltages (~100V or so), less current capability. Note that +-24V output can be easily made using +12V single supply bridge amplifier:
I've looked at a few commercially available TENS units on the web, and their voltage and current capabilities seem to be much wider than the ones of this device. Much too wide, actually. I would not want to stick one of those on my neck. Also the output waveform seems to usually be square and not sine.
 

Offline vctls

  • Newbie
  • Posts: 7
  • Country: fr
Re: Help replicating a medical device
« Reply #17 on: July 19, 2022, 08:00:36 am »
Uh,
not sure if this is what you're looking for, but..
https://milovana.com/forum/viewtopic.php?t=23302
Huh… I'm not sure about that. I'd need precise information on what kind of output this will generate. Also, I'm obviously not going to use a power supply.
It may serve as an inspiration, but I'd rather try to copy the circuit of the actual device.
 

Offline lingyuk

  • Newbie
  • Posts: 4
  • Country: au
Re: Help replicating a medical device
« Reply #18 on: November 13, 2022, 10:28:22 pm »
I am also attempting to replicate the Gammacore.

I believe that it should be possible using a regular TENS device, with the settings adjusted correctly.

Can I ask if any of you in this thread managed to successfully replicate Gammacore function?

Attached is the data I've been able to gather so far, and the closest imitation I can manage with my TENS machine.

The maximum output voltage and load impedance of my TENS unit is comparable to the gammacore spec, and I can set the mA to be the same, so it seems safe to me.
« Last Edit: November 13, 2022, 10:31:01 pm by lingyuk »
 

Offline vctls

  • Newbie
  • Posts: 7
  • Country: fr
Re: Help replicating a medical device
« Reply #19 on: November 14, 2022, 07:58:48 am »
Sadly no, I haven't got around to it yet.
I also looked around for comparable TENS units, but what I found was that it's actually quite difficult to get your hands on a "high frequency" TENS. All over the counter units seem to be in the hundred Hz range, while thousand Hz units appear to be prescription only.
As for the wave form, I suspect square waves may be a problem because body impedance might not be the same for high order harmonics, and it might have other effects.

On the other hand, I have no idea how ElectroCore came up with those numbers. I don't know the literature on the subject, but it kinda seems to me that they pulled these specs out of their ass. Their numbers are weirdly convenient. And the studies they cite in the manual are a bit limited, to say the least. It might just work with different current characteristics. The problem is, of course, that you clearly do not want to stick any electrical device to someone's neck and just hope it doesn't give them nerve damage or plainly kills them, so I'd rather not stray to far from the original specs.

I've asked around but haven't got much help yet. I am convinced it can't be that difficult, but then again I'm still not competent enough to do it myself, so maybe I'm completely wrong about this.

Another thought I had is that 5kHz is in the audio range, and there might be some specific audio amps that would match the required characteristics, but most probably not. Also, mains-powered devices are out of the question.
 

Offline lingyuk

  • Newbie
  • Posts: 4
  • Country: au
Re: Help replicating a medical device
« Reply #20 on: November 14, 2022, 01:30:15 pm »
Thanks for your reply.

I was confused about the 5000hz as well, but I think I may have worked it out:

"gammaCore Sapphire CV produces an electrical signal consisting of five 5,000-Hz pulses, repeating at a rate of 25 Hz."
https://www.gammacore.com/wp-content/themes/gammacore-p2/pdf/gammacore-IFU_CV.pdf

That sentence makes no sense, until I realised that they are probably describing "5,000-Hz pulses" - ie: this definition "The period of a wave refers to the time it takes for the sine wave to complete a cycle. It is the inverse of frequency. If the frequency of a wave is 5Hz, then each cycle takes 1/5 of a second to complete. The period of a 5Hz sine wave is 1/5Hz, which equals 0.2 seconds."  https://socratic.org/questions/how-do-you-calculate-the-period-and-frequency

I believe that "5,000-Hz pulses" means pulses that occur at a rate of 5000 per second, ie: 200 microseconds each.

Would you agree?

This makes more sense, as 200 microseconds is a typical pulse width on a TENS device.

Also, there are no machines that I could find even in a clinical setting that can produce 5000 pulses per second, as that would require an unusually short pulse width to fit within 1 second.

25x5 pulses = 125 pulses per second, which is also a typical TENS frequency.

I have a burst function on my machine, which can apply bursts of (I think 10) pulses at 0.5-5hz times per second, but I don't see much difference between spreading the 125 pulses in bursts or not.

Honestly, now it reads to me that they are simply applying a typical TENS frequency and pulse width to the neck. I don't see anything special that they are doing with the gammacore.

The gammacore has an adjustable strength, with a max mA of 60, and my machine lets me adjust from 0-100, so I can just keep it below 60mA.

There are also multiple other vagus nerve products that are being released which are just tens machines, some with an ear clip - as the ear also has vagus nerve involvement (eg: Bauer  et  al.  [24]  used  NEMOS  in  2016  and employed  the pulse  width of  250 μs,  the frequency  of  25  Hz). I've purchased the ear clip for a few dollars online.

I have also located many studies that show different devices and even tens devices used on the neck, and they didn't specify sinewave form. My feeling is that square wave should be comparable.

Also: "The most widely used commercially available taVNS device (NEMOS®, tVNS technologies) delivers current in rhythmic square pulses (Yuan & Silberstein, 2016b)."

Personally, I feel pretty ready to just using my tens machine on my neck / ear and seeing how it goes.

I found studies regarding side effects, and only 0.08% experienced bradycardia, so the risk seems negligible.

The round numbers that they chose makes me think that they didn't really do significant testing to find the perfect frequency and pulse width, so I'm glad that I have my own machine so that I can play with the settings to see what works best.

Also, this: "Despite Hulsey's rigorous approach towards parameter space exploration, a very rigid set of stimulation parameters is commonly used in animal models as well as in human studies. These involve current intensities varying between 0.25 mA - 1mA, pulse frequency ranging between 20-30 Hz, a pulse width of 330 - 500 µs and a duty cycle of 30 s stimulation followed by a 5 min resting phase for 30-60 min (He, Jing, Zhu, et al., 2013; Jiang et al., 2016; Manta et al., 2009; Vázquez-Oliver et al., 2020)"
« Last Edit: November 14, 2022, 02:57:39 pm by lingyuk »
 

Offline lingyuk

  • Newbie
  • Posts: 4
  • Country: au
Re: Help replicating a medical device
« Reply #21 on: November 14, 2022, 01:37:45 pm »
I also found this table from a study showing similar pulse width and frequencies on gammacore and gammacore-like devices:
 

Offline vctls

  • Newbie
  • Posts: 7
  • Country: fr
Re: Help replicating a medical device
« Reply #22 on: November 14, 2022, 04:49:40 pm »
Thank you for all the information.

Yes, the sentence is confusing, but I don't think that's what they mean.
I may be wrong, but I think that what they call “pulses” are just periods. Five 5kHz periods. And those are repeated at 25 Hz.
Which is the same as saying “a 5 kHz 1 ms pulse every 40 ms”.
That's what I put in my previous audio file.
The wave would look something like the attachment.

This is I think phrased more clearly in this review of vagus nerve stimulators: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7199464/#sec-13title
Quote
The remaining stimulation parameters are fixed, delivering 1 ms pulses of 5 kHz sine waves at 25 Hz.

I haven't read the full review yet. There may be some more useful information.

You say you want to test on yourself. Do you suffer from CH? If that's the case I feel for you, it looks really horrible.
Please be careful.
 

Offline lingyuk

  • Newbie
  • Posts: 4
  • Country: au
Re: Help replicating a medical device
« Reply #23 on: November 14, 2022, 05:26:39 pm »
Quote
I think that what they call “pulses” are just periods.

Pulses are defined as a period of continuous electrical energy output.

I have attached the set of definitions which I have gathered.

A guide: https://carex.com/blogs/resources/how-to-use-a-tens-unit

Reading further with the gammacore specs, it is explained that the burst period is 1ms, followed by a 39ms gap. 25hz x 40ms = 1000ms.

The pulse width (duration of each electrical pulse) is 200 microseconds (referred to as a "5000hz pulse". 1second/5000 = 200 microseconds). 5 pulses per burst. 5 pulses = 1ms burst period.

This description that they give seems incorrect regardless, since every other vagal study performed use something close to these settings:

200 microsecond pulse x 25 per second. (Patient increases mA until discomfort point.)

This gives a range of frequency possible settings - 25-125.

I have since found guides for performing TVNS and they all specify 200 microseconds pulse width with a frequency of around 25hz, so it would appear that they arrived at the same conclusions: https://static1.squarespace.com/static/5bc3a7cafb182049bcf6dc63/t/5eb42480ae6f2d0441f007f7/1588864163451/Tens_To_Stimulate_Vagus_Nerve.download.pdf

I would interperet this

Quote
The remaining stimulation parameters are fixed, delivering 1 ms pulses of 5 kHz sine waves at 25 Hz.

As "a burst of multiple 200 microsecond pulses. the burst lasts for 1ms. 25 bursts per second".

Thankfully, this is right in the middle of my TENS capabilities. I have also found multiple studies that used a square-wave TENS unit on the left vagal nerve on the neck (eg: https://www.digitimer.com/product/human-neurophysiology/peripheral-stimulators/ds7a-ds7ah-hv-current-stimulator/). So it seems that my unit can deliver what is required.

The paper "International Consensus Based Review and Recommendations for Minimum Reporting Standards in Research on Transcutaneous Vagus Nerve Stimulation (Version 2020)" lists all of the dozens of studies performed and the machines and settings used, all of which align with this general range. Funnily enough, they also complain about the confusing way that the settings are reported.
« Last Edit: November 14, 2022, 05:58:40 pm by lingyuk »
 
The following users thanked this post: vctls

Offline vctls

  • Newbie
  • Posts: 7
  • Country: fr
Re: Help replicating a medical device
« Reply #24 on: January 30, 2023, 11:42:07 am »
May I ask what your TENS unit is?
Do you think a very basic one like a TENS 7000 would suffice?

I came to think that if this required designing a specific TENS unit, I'd gladly pay for it, or at least contribute, as long as the resulting design is free and open-source, and can be reproduced with reasonable tooling requirements in a fab lab or something.
« Last Edit: January 30, 2023, 12:15:55 pm by vctls »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf