Measuring Microcurrent over a Transformer with Arduino

Irving

Joined Jan 30, 2016
3,845
Yes, its unnecessary. Here's a somewhat sanitised schematic of a commercially available unit that generates constant-current biphasic pulses. Everything to the right of the isolating barrier set up by U1, U4 - U8 is floating. U1 and U5 generate isolated 15v supplies, one referenced below +HV, the other above HV_GND.

The HV is isolated by the relay until its energised by raising HV_ON to logic 1 turning Q1 on. Once the HV is on, Q5 shorts the electrodes until its turned off by raising Safety_off to logic 1. U4 is a linear diode isolator with 2 matched photo diodes; U2 sets up a current in the LED that results in a current in both photodiodes generating a voltage across R6 that matches the DAC input and U3 matches the the current through R2 to the voltage across R3 thus translating the DAC voltage to a constant current through Q2. So a step change on the DAC input results in a step change at Q2/C1 junction, charging C1 and transmitting the current to the electrodes. At the appropriate pulse width the DAC is turned off and Q2 shuts off the current. LO-Pulse is then raised to logic 1 turning on Q4 which then discharges C1, generating an identical negative charge pulse. The cycle can then be repeated. Once finished, DAC volts are set to zero and Safety_off and HV_ON are both returned to logic 0, turning Q5 on and Q1 off so shorting the electrodes and isolating the HV. R8 discharges C1 over the course of several milliseconds in the event of a failure, and R9/R13/Q3 detect if the compliance voltage across the electrodes rises above 100v or so which suggests an electrode connection has dropped off and raises the OC_electrode signal.

1626022196435.png
 

Thread Starter

danielantonic

Joined Sep 22, 2019
68
I think I have a simple voltage controlled current source that could work for my application. Would something like this work for my application? I've only played with BJTs, etc. so I'm new to MOSFETS - I guess they are akin to a "variable" transistor...?

I also found that other FSM devices only use a maximum of 30V, and since I have 23V and +/-18V supplies already, I do have access to that sort of voltage with a minimum change in components.

As always, thank you in advance for your feedback - loving this forum!
 

Attachments

Ian0

Joined Aug 7, 2020
9,680
I'm new to MOSFETS
They're not so different to bipolars. The main difference is that no current flows between gate and source like it does between base and emitter. Otherwise they are the same - the drain (collector) current is controlled by the voltage between gate (base) and source (emitter). The operating range of the gate (base) voltage is generally a bit higher.
 

Irving

Joined Jan 30, 2016
3,845
Thanks for getting back to me - this is going to take me a bit of time to take in as I haven't dealt with many of these components before
Well, as I said, this is a commercial unit capable of biphasic pulses up to 100mA for nerve stimulation or as low as 200uA for 'therapeutic pain relief'. But it meets all class 3 directives for human-connected equipment as regards safety and isolation.

I think I have a simple voltage controlled current source that could work for my application. Would something like this work for my application? I've only played with BJTs, etc. so I'm new to MOSFETS - I guess they are akin to a "variable" transistor...?

I also found that other FSM devices only use a maximum of 30V, and since I have 23V and +/-18V supplies already, I do have access to that sort of voltage with a minimum change in components.

As always, thank you in advance for your feedback - loving this forum!
That will work a a controlled current source. Its important to reverse the charge - one way current sets up charges in the cells that exceed certain biopotentials which can adversely impact on the cells' functioning, even killing them.

At 30v you are talking microamps; the therapeutic effect of very low currents it a matter of some debate. Here is an article from 'Electrotherapy' about TENS units with links to research papers.

FSM? Flying Spagghetti Monster? Foot Sensual Massage? I don't recognise the acronym in this context...
 

Thread Starter

danielantonic

Joined Sep 22, 2019
68
FSM? Flying Spagghetti Monster? Foot Sensual Massage? I don't recognise the acronym in this context...
Sorry, yes is is short for Frequency Specific Microcurrent - essentially a TENS setup but only supplying 100-600uA so voltage only needs to be 30-60V max. Some of the papers regarding it propose it helps cell metabolism/ATP production, but all I know first hand is it helps stop Rouleaux blood formation and relieves pain associated with Fibromyalgia.

That will work a a controlled current source. Its important to reverse the charge - one way current sets up charges in the cells that exceed certain biopotentials which can adversely impact on the cells' functioning, even killing them.
Ah right - even though the signal from the AD633 is biphasic, the 30V source needs to switch between +/-30V ...?

What I'd like ideally is to add a similar circuit to this so that the biphasic +/- 4.5V from the AD633 is amplified and then attenuated to provide a constant current, however in my design, the DAC that controls the current also controls the phase (it has 2.5V applied to pin 2 of the AD633 to make a biphasic output). I reaaaaaaaaaly don't want to do another redesign, but I am open to suggestions.
Thanks in advance!
 

Irving

Joined Jan 30, 2016
3,845
As you have it now it can only be biphasic at the skin if you capacitive couple it as per my previous circuit.

One alternative, witha single-ended driver like that is to have split supplies with the reference electrode connected to the centre tap so the live electrode can swing + & - relative to the reference. However the difficulty with that is the zero 'idle' position requires the driver to sit at 1/2 supply rather than 'off' making safety arrangements tricky.

Other solutions would be:
  • an opamp on dual-supplies capable of a high voltage output directly driving the live electrode; or
  • drive p- (low side) and n-channel (high side) MOSFETs as source followers with suitable gate biassing and the sense resistor in the reference electrode connection; or
  • dual opamps driving both p- (high side) and n-channel (low side) MOSFETs as constant-current sources with a suitable gate biassing and dual sense resistors between source and supply rail.

(I would draw something but stuck on my phone for now, I will sketch it out later if I get a chance)
 
Last edited:

Thread Starter

danielantonic

Joined Sep 22, 2019
68
As you have it now it can only be biphasic at the skin if you capacitive couple it as per my previous circuit.
I'm unfamiliar with that term sorry - could you clarify what capacitive couple means please?

One alternative, witha single-ended driver like that is to have split supplies with the reference electrode connected to the centre tap so the live electrode can swing + & - relative to the reference. However the difficulty with that is the zero 'idle' position requires the driver to sit at 1/2 supply rather than 'off' making safety arrangements tricky.

Other solutions would be:
  • an opamp on dual-supplies capable of a high voltage output directly driving the live electrode; or
  • drive p- (low side) and n-channel (high side) MOSFETs as source followers with suitable gate biassing and the sense resistor in the reference electrode connection; or
  • dual opamps driving both p- (high side) and n-channel (low side) MOSFETs as constant-current sources with a suitable gate biassing and dual sense resistors between source and supply rail.

(I would draw something but stuck on my phone for now, I will sketch it out later if I get a chance)
So any way that I go, I will need to boost the voltage up as a separate supply. I've attached a schematic of my power supply and function generator (outputs a DC signal wave 0-18V that feeds the AD633s). I have only used 2x 7660 charge pumps in my actual build as I was aiming for -20V, but I have room to add the third and get up to the desired -30V range, problem is the DC-DC module only outputs 23V max - maybe I can do away with that module altogether?

Note - D1 from the DC module just drops the voltage a bit as that feeds the Arduino and 7660s and some wall warts put out a little too much juice, so that 12V line is probably more around 11.4V to keep it in spec.

I'm starting to think it might be better to design a new PSU to take in 12V from batteries/wall wart and boost it to +/-40V and regulate it down to required levels, have a 12V line for the Arduino, +/-18V for the AD633s/LM358, +5V for the AD9833 function generator and +/-30V for op-amps to the patient...

Then from there its using MOSFETS to have a constant current supply... right?

Sorry for the barrage of questions - I'm still learning analog electronics and there is a lot to take in!
 

Attachments

Thread Starter

danielantonic

Joined Sep 22, 2019
68
Yes, its unnecessary. Here's a somewhat sanitised schematic of a commercially available unit that generates constant-current biphasic pulses. Everything to the right of the isolating barrier set up by U1, U4 - U8 is floating. U1 and U5 generate isolated 15v supplies, one referenced below +HV, the other above HV_GND.

The HV is isolated by the relay until its energised by raising HV_ON to logic 1 turning Q1 on. Once the HV is on, Q5 shorts the electrodes until its turned off by raising Safety_off to logic 1. U4 is a linear diode isolator with 2 matched photo diodes; U2 sets up a current in the LED that results in a current in both photodiodes generating a voltage across R6 that matches the DAC input and U3 matches the the current through R2 to the voltage across R3 thus translating the DAC voltage to a constant current through Q2. So a step change on the DAC input results in a step change at Q2/C1 junction, charging C1 and transmitting the current to the electrodes. At the appropriate pulse width the DAC is turned off and Q2 shuts off the current. LO-Pulse is then raised to logic 1 turning on Q4 which then discharges C1, generating an identical negative charge pulse. The cycle can then be repeated. Once finished, DAC volts are set to zero and Safety_off and HV_ON are both returned to logic 0, turning Q5 on and Q1 off so shorting the electrodes and isolating the HV. R8 discharges C1 over the course of several milliseconds in the event of a failure, and R9/R13/Q3 detect if the compliance voltage across the electrodes rises above 100v or so which suggests an electrode connection has dropped off and raises the OC_electrode signal.

View attachment 243208
I finally had a chance to go through the schematic and look up the bits I wasn't familiar with, but to make sure I do understand the schematic, I have a few questions if you don't mind answering/confirming them please :)



Regarding U1 and U5 - I have heard of DC-DC Converters but they are an expensive module and I haven't seen what is inside them. I guess an oscillator/transformer/rectifier...?

What voltage is +HV? Since this is a TENS schematic, I assume 100V+?

By logic 1, do you mean +5V, TTL levels?

DAC_IN – I assume this accepts the regular 0-5V from DACs…?

DC_Electrodes – would this be a DC waveform? What voltage p-p would this be?

LO-Pulse – set to logic 1 to send a positive waveform, set to 0 for a negative...? So If I have a 420Hz waveform being generated, I can send a positive signal to the electrodes for say 4 seconds, and then change LO-Pulse and send a negative version of the waveform for 4 seconds...?

Safety_off – needs to be logic 1 for circuit to operate…?

How is the HV generated separately from 15V? Wouldn’t it be getting its power from the same supply as the 15V (via batteries/mains)?

Can the HV Voltage be anything greater than 15V, or is this circuit designed for HV in a certain range?

I assume U2 can be a generic OP Amp, but U3 will need to be a different one rated at the HV voltage, alogn with everything else on the HV side?

Since this only shows 1 channel, to make this available on 5 channels, I would replicate everything except for the relay, Q1, U1 (I can keep the HV source shared between the channels)…?
 

Irving

Joined Jan 30, 2016
3,845
I finally had a chance to go through the schematic and look up the bits I wasn't familiar with, but to make sure I do understand the schematic, I have a few questions if you don't mind answering/confirming them please :)
No problem & apologies for delay in responding

Regarding U1 and U5 - I have heard of DC-DC Converters but they are an expensive module and I haven't seen what is inside them. I guess an oscillator/transformer/rectifier...

Pretty much. Medical grade units with 5kv isolation rather than 1.5kv/2.5kv industrial grade even more so. But safety must be designed in from the start.

What voltage is +HV? Since this is a TENS schematic, I assume 100V+?

Whatever you need it to be, about 5 - 10v above the compliance voltage for your highest current and skin resistance

By logic 1, do you mean +5V, TTL levels?

Or 3v, I think that works for both, I but it's a minor tweak if not.

DAC_IN – I assume this accepts the regular 0-5V from DACs…?

I believe that is configured for 0 - 2.5v but is a minor tweak to change input gain

DC_Electrodes – would this be a DC waveform? What voltage p-p would this be?

Its biphasic and constant current so voltage will be whatever skin resistance dictates. The output capacitor is sized so that the voltage remains fairly constant, within 10% over the width of the +ve phase of the pulse.

LO-Pulse – set to logic 1 to send a positive waveform, set to 0 for a negative...? So If I have a 420Hz waveform being generated, I can send a positive signal to the electrodes for say 4 seconds, and then change LO-Pulse and send a negative version of the waveform for 4 seconds...?

No, this is a one pulse at a time circuit. You turn safety_off and DAC on to send the +ve pulse and charging the output capacitor. Then you turn DAC off to finish the +ve pulse, then you turn LO_pulse on for the same length of time to discharge the capacitor and generate the -ve pulse.

Safety_off – needs to be logic 1 for circuit to operate…?

Yes

How is the HV generated separately from 15V? Wouldn’t it be getting its power from the same supply as the 15V (via batteries/mains)?

It's a separate supply not shown in the schematic, but generated from whatever source is available.

Can the HV Voltage be anything greater than 15V, or is this circuit designed for HV in a certain range?

As already stated above it's whatever Max current and skin resistance dictate plus 15v or so, typically 60 -120v

I assume U2 can be a generic OP Amp, but U3 will need to be a different one rated at the HV voltage, alogn with everything else on the HV side?

U2 and U3 should be the same. U3 doesnt need to be HV as although it's referenced to the +HV rail it operates in its own 15v world powered by U1. C1 needs to be 400v rated but, other than where stated, I don't think anything else needs special attention.

Since this only shows 1 channel, to make this available on 5 channels, I would replicate everything except for the relay, Q1, U1 (I can keep the HV source shared between the channels)…?

Yes, relay & Q1 & HV can be shared, everything else is channel specific. I suppose U1 could be shared but then it would need to rated at 5x the output current + a bit to ensure no crosstalk between channels. I'd need to think on that more. The original system has individual modular and interchangeable cards. The HV supply needs to be rated at 5+ times the maximum peak output current.
 

Thread Starter

danielantonic

Joined Sep 22, 2019
68
DC_Electrodes – would this be a DC waveform? What voltage p-p would this be?

Its biphasic and constant current so voltage will be whatever skin resistance dictates. The output capacitor is sized so that the voltage remains fairly constant, within 10% over the width of the +ve phase of the pulse.

LO-Pulse – set to logic 1 to send a positive waveform, set to 0 for a negative...? So If I have a 420Hz waveform being generated, I can send a positive signal to the electrodes for say 4 seconds, and then change LO-Pulse and send a negative version of the waveform for 4 seconds...?

No, this is a one pulse at a time circuit. You turn safety_off and DAC on to send the +ve pulse and charging the output capacitor. Then you turn DAC off to finish the +ve pulse, then you turn LO_pulse on for the same length of time to discharge the capacitor and generate the -ve pulse.
Thanks for that - glad I'm mostly on the right track!

Just another couple of questions:

DAC_IN - so this isn't a set voltage, but actually generates the signal/waveform? The arduino isn't fast enough which is why I have a function generator/LM358 to make a 0-18V DC signal (sine/square/triangle wave at a freq 10-10kHz). Keep in mind, I want my final biphasic output at my electrodes to look like the red graph in my video here - http://www.dcnsolutions.net/FSM/20191114_105749.mp4

I think I am missing something, as I'm not clear on what DC_Electrodes does. Here is a table showing some of the logic levels/signal type - can you please let me know where I'm going wrong/fill in the blanks?


DAC_INx11
DC_Electrodesx??
LO_Pulsex01
Safety_off011
Output Electrodes0Capacitor chargesCapacitor discharges
 
Last edited:

Irving

Joined Jan 30, 2016
3,845
Thanks for that - glad I'm mostly on the right track!

Just another couple of questions:

DAC_IN - so this isn't a set voltage, but actually generates the signal/waveform? The arduino isn't fast enough which is why I have a function generator/LM358 to make a 0-18V DC signal (sine/square/triangle wave at a freq 10-10kHz). Keep in mind, I want my final biphasic output at my electrodes to look like the red graph in my video here - http://www.dcnsolutions.net/FSM/20191114_105749.mp4

I think I am missing something, as I'm not clear on what DC_Electrodes does. Here is a table showing some of the logic levels/signal type - can you please let me know where I'm going wrong/fill in the blanks?


DAC_INx11
DC_Electrodesx??
LO_Pulsex01
Safety_off011
Output Electrodes0Capacitor chargesCapacitor discharges
AH I get you DC_Electrodes is actually OC_Electrodes (OC meaning Open Circuit). Basically if voltage across electrodes climbs to more than the desired max constant current x max expected skin resistance for example 1mA across 100k = 100v then its probable that electrode is not connected or has dropped off. If so, this feed back to the MCU is a warning...

I need to go review that site and that waveform - thats definitely not biphasic and would require both +ve and -ve drivers. Its not one i've seen from any lab/hospital theraputic device i've used or researched....
 

Thread Starter

danielantonic

Joined Sep 22, 2019
68
AH I get you DC_Electrodes is actually OC_Electrodes (OC meaning Open Circuit). Basically if voltage across electrodes climbs to more than the desired max constant current x max expected skin resistance for example 1mA across 100k = 100v then its probable that electrode is not connected or has dropped off. If so, this feed back to the MCU is a warning...

I need to go review that site and that waveform - thats definitely not biphasic and would require both +ve and -ve drivers. Its not one i've seen from any lab/hospital theraputic device i've used or researched....
Thanks mate!!
 

Irving

Joined Jan 30, 2016
3,845
OK, going back to the beginning, I just grocked that DCNsolutions is your site (doh!) not the supplier of that kit. Do you have a model #/manufacturer?

I ran that waveform by one of my colleagues who is tech director for a company that design & make custom stimulators/TENS units for specialist pain management. He wasn't exactly complementary, though admittedly its quite hard to see what's actually going on. One of his concerns was the lack of obvious charge balancing at the individual pulse level, however with the spec of 32v 1mA max his view is that this would at best generate a tingle but the actual level of penetration to deep nerve tissue would be minimal and the therapeutic effect would be more a placebo than active.

Now, I'm not going to pass judgement on the efficacy of your device. The Hasomed Rehamove stimulator I own and use daily can be used for pain management (including deep neuropathic pain), though its main purpose is for muscle stimulation, and supports 8 channels at:
  • Frequency 1-50 Hz
  • Pulse width 10-500 μs
  • Amplitude 1-130 mA

Now, a little more research dug up this article, from 1989, based on a patent for a TENS unit, which includes the following waveform which is similar to the ones you posted:

1627302539555.png

The description of the waveform sounds similar to yours...

"The improved transcutaneous electrical nerve stimulator according to the present design is categorically a microcurrent TENS which operates using a unique wave form. The instrument is constructed such that it will operate from about 25 microamps up to about 900 microamps current during therapeutic use with a peak current of the order of 6 milliamps.

Typically the current is applied through a pair of electrodes in the form of a high frequency, monophasic, burst of a D.C. carrier signal (e.g., at lest 10,000 Hz to 19,000 Hz)that is chopped or modulated at a relatively lower frequency (e.g., from about 0.3 Hz up to 10,000 Hz). The burst of the modulated carrier signal are typically from about 0.05 seconds to about 10 seconds in duration with about one second in duration being preferred.

Preferably, successive bursts are inverted relative to the previous burst by reversing the polarity at the electrodes thus simulating a biphasic wave form, yet the carrier is a monophasic D.C. signal. Preferably, the modulating frequency is selected from pairs of frequencies which exhibit specific therapeutic action (e.g., 292 Hz and 9.125 Hz).
"

That device uses 32v rails and produces a nominal 1mA (6mA max). Though the design implements a constant current monophasic pulse train, it becomes effectively biphasic as its presented alternately at the two electrodes, which is a simple solution using an analog switch.

Here's an idea how it could be done - Q1 - Q4 create an H-bridge. If Q1 is on through DRV_Phase1 being logic1, DAC_IN sets the current waveform into electrode1 and a logic1 on EN_Phase1 grounds electrode2 through Q4. Similarly DRV_Phase2 and EN_Phase2 apply the DAC_IN set current to electrode2 via Q2 with electrode1 grounded through Q3, thus providing the reverse polarity. Turning both DRV_ inputs 'off' and setting both EN_ inputs 'on' grounds both electrodes as the 'safe' position.

1627324706216.png
 

Thread Starter

danielantonic

Joined Sep 22, 2019
68
Sorry about the delay! I just started another project so I've been flat out!

The device is a CellRegulogie5 from Biobedded Systems GmbH (http://proceptsystem.biobedded.de/pdf/CellRegulogie5_HandbuchVers01.pdf - it is in German, but you should be able to understand the stats on page 9)

The idea is that lower microcurrents help with ATP production (https://frequencyspecific.com/papers-2/). My own experiments seem to show treatments help with breaking down Rouleaux formations in blood (at a bare minimum, its been a fun project to build)

That 1989 article you found seems to line up pretty close to what this machine does.

Interesting you suggest an H-bridge - the other project I just started is using a Raspberry Pi to control motors via an H bridge to allow control of the higher voltage circuit - funny how I just learn of a concept in one project and it pops up in another!

I was browsing RS Components and I found this medically approved adapter:
https://au.rs-online.com/web/p/ac-dc-adapters/0436721

If I was to use this as my power source in, would that make all the optocouplers redundant? Or if I used a LiPo battery, could I bypass them? Just trying to simplify the circuit (and not have to redesign it again), but will still err on the side of caution to be safe of course :)

Last of all regarding the power source, if I have a 12V DC source (either battery or wall wart), to get the +/-30V rails, would it be easiest to make an AC sine wave generator with a 555 timer, feed it through a step up transformer and rectify?
 

Irving

Joined Jan 30, 2016
3,845
I was browsing RS Components and I found this medically approved adapter:
https://au.rs-online.com/web/p/ac-dc-adapters/0436721

If I was to use this as my power source in, would that make all the optocouplers redundant? Or if I used a LiPo battery, could I bypass them? Just trying to simplify the circuit (and not have to redesign it again), but will still err on the side of caution to be safe of course
If the power source meets the required isolation standards, normally 5kV isolation, then yes, you can avoid the other galvanic isolation measures; however AU$83 for a 10W PSU is a big cost. That's why many of these devices are battery powered - it simplifies so much.

Last of all regarding the power source, if I have a 12V DC source (either battery or wall wart), to get the +/-30V rails, would it be easiest to make an AC sine wave generator with a 555 timer, feed it through a step up transformer and rectify?
Dont bother with 555, its not worth messing around, you'll spend shed-loads of time trying to get some form of regulation to work. Use a proper SMPS controller chip, there are many to choose from. I've used the LT1072 for example (datasheet attached), to meet similar needs; here you could use 1 x LT1072 to go from +12v (or lower, e.g +7.2v 2-cell) to +30v for a full H-bridge approach, or 2 x LT1072 to go to +/-30v for a half-bridge, or, with a pulse transformer, 1 x LT1072 to go to +/-30v. I personally favour the 2 x independent +/- transformer-less boost converter approach. One of the reasons for using that chip is that its easy to simulate in LTSpice and validate the design.
 

Attachments

Thread Starter

danielantonic

Joined Sep 22, 2019
68
Thanks for that- SWPS chips are new to me. I'll do some homework on this and post an update when I have a new battery powered design made. Thank you all for your help!
 

Thread Starter

danielantonic

Joined Sep 22, 2019
68
If the power source meets the required isolation standards, normally 5kV isolation, then yes, you can avoid the other galvanic isolation measures; however AU$83 for a 10W PSU is a big cost. That's why many of these devices are battery powered - it simplifies so much.


Dont bother with 555, its not worth messing around, you'll spend shed-loads of time trying to get some form of regulation to work. Use a proper SMPS controller chip, there are many to choose from. I've used the LT1072 for example (datasheet attached), to meet similar needs; here you could use 1 x LT1072 to go from +12v (or lower, e.g +7.2v 2-cell) to +30v for a full H-bridge approach, or 2 x LT1072 to go to +/-30v for a half-bridge, or, with a pulse transformer, 1 x LT1072 to go to +/-30v. I personally favour the 2 x independent +/- transformer-less boost converter approach. One of the reasons for using that chip is that its easy to simulate in LTSpice and validate the design.

Ok, I've done some research and I think the following will work:
  • The LiPo/USB charger as shown here: https://www.jaycar.com.au/lbc. This should give me a constant 5V supply
  • A SMPS chip to boost 5V to 30V
  • MCP6004-I/P M - 5V rail to rail op amps to buffer to the Arduino, measure voltage etc. (see below)
  • Infineon IRFZ24NPBF N-Channel MOSFET and Infineon IRF9Z34NPBF P-Channel MOSFET, rated at 55V for the H-Bridge
  • LT1490ACN8 44V Dual rail to rail op amps to drive the Mosfets

I liked the idea of Jasper's electronic load here: http://jasper.sikken.nl/electronicload/index.html. I was thinking of using something similar to this with the MCP6004 op amps so I could set/monitor the current/voltage being sent to the electrodes.

My plan is to get the above components, make the electronic load first/test and experiment with it (change the sense resistor to provide lower current levels etc.). Once I'm familiar with that, I'll use the LT1490ACN8 to amplify (de-amplify?) the constant current of the electronic load down to microcurrent levels and use the Mosfets as an H-bridge
 
Last edited:
Top