Building a good tDCS device – part 2

So basically, to have my super simple and easy to build, yet safe (as can be under the circumstances) brain zapper, I determined the following block components as necessary:

  • Current source
  • Protection against reversed polarity
  • Manual current shunt for start and stop
  • Transient suppression
  • Test points for measuring current and voltage
  • Voltage indicator LED

Current source

I wanted to be able to experiment with various current levels, so I opted for using miltiple CRDs in parallel. Using jumpers to turn them on or off allows me to set the current to 1.0, 1.5 or 2.0 milliAmps.

CRDs are kind of expensive as loose components go, so I wouldn’t necessary do the same for a device that goes into mass production, but that wasn’t the goal here.

Protection against reversed polarity

This one is needed because a CRD acts as a short circuit (well, actually it acts like a forward biased diode) when biased in reverse. Since I was going to build this on a veroboard with an el cheapo pinheader to connect the battery holder, I needed to make sure there won’t be any surprises if I ever connect the thing backwards.

Solution: I just added a diode between the battery and the positive rail. Since I’m using two 9V batteries, the .6 Volts I’m losing there is insignificant.

Manual current shunt for start and stop

If we add a potentiometer the the simple circuit I linked to in my last post, there are two ways we can do it. Either in series with, or parallel to the load (ie. our head).

Manual start/stop configurations

Manual start/stop configurations
a) Potentiometer in series
b) Potentiometer in parallel (shunt)

Now the series configuration is absolute rubbish, the only reason I included it here is to explain what’s wrong with it. We can treat the CRD, for all intents and purposes, as a “smart” resistor that sets its value to whatever is necessary to maintain a specific level of current flow through its terminals.

It is meant to nullify whatever changes might come along in series resistance, and keep the current static, as long as there’s enough voltage to keep things up. So it would end up fighting any series element meant for start or stop. Regardless of the value of the potentiometer I use, the result will always be quite inadequate.

Current curve for potentiometer in series

Potentiometer in series:
This is how the current would change in response to turning the knob. Not so pretty, huh?

The better, and safer way to cut current flow to one’s head is to reroute it, to create an adjustable shunt to ground in parallel with the load. Now this has its own fleas. Due to the nonlinear nature of the current divider equation, I still get most of the current turned on (or off) on the first 10% of the pot’s rotation, and the rest changes naught.

However, “audio taper” potentiometers came to my rescue. They are pots with a nonlinear curve optimized for volume adjustments, to compensate for the logarithmic nature of human perception. In this case, they compensate adequately for the nonlinearity of the current divider law. While not perfectly linear, and subject to change as the resistance of the load changes, it’s good enough.

Current curve for potentiometer in parallel

Potentiometer in parallel:
This is how the current would change in response to turning the knob.

As you can see though on the diagram, we will always lose about 10% of the current with a 50k potentiometer, and an average 3.5k resistance across the electodes (in my experience, using standard 2″ saline sponge electrodes, resistance varies between 1.5 and 4k, so this is a good approximation). Since my CRDs were off by about +10% compared to their nominal value, I decided this might be a good thing even.

Transient suppression

What happens when I connect the trodes to the device after it has been turned on? What happens if the potentiometer malfunctions? If a wire breaks? Well, even though none of these should be dangerous in the strictest sense, they would potentially lead to voltage and current spikes on my brain, which are, in the very least, extremely unpleasant.

The worst case scenario is suddenly connecting up an open circuit. If the loop is broken, the current is zero, and so is the resistance of the CRD. It allows almost the full input voltage onto the terminals. When you first connect up a loop like this, and your head happens to be the last element to be added, you’ll be treated to almost the full 18 Volts for a few moments, and before the CRDs catch up and stop the current, you’ll get transient currents potentially higher than 2mA.

You don’t even have to be an idiot for this to happen. A wire could break, and then by a minute movement, become reconnected, resulting in the above scenario. So what can be done about it? I explained my disdain for “soft start capacitors”. A CRD works by varying voltage in order to keep current stable. A capacitor resists changes in voltage. They are “enemies”, fire and water.

However, an inductor does the exact opposite. It resists changes in current. Just what we need, huh? It’s kind of the electric equivalent of a flywheel. The only problem is that a DC choke large enough to make a noticeable difference is big and heavy – this time I decided to accept the big and heavy, and got a 10H choke, but unfortunately, for a portable device this would be far too much bulk in my opinion.

Note: a choke needs a flyback diode (a diode biased in reverse across its terminals), to make sure it doesn’t create crazy voltages when you take the current away, allowing it to wind down.

I’ll post some oscilloscope screenshots, for now you’ll just have to take my word that without the choke, there was significant ringing, and transient currents up to 4mA upon connecting up a broken loop. With the choke added, the overshoot and ringing were gone, and the current never passed the 2mA threshold.

Test points for measuring current and voltage

Well, I have two multimeters, so I didn’t want to burden the design with any dials or digital meters. Added a 1k precision resistor as a current shunt (making 1V of measured voltage equivalent to 1mA of current), and test points for measuring voltage across the current shunt, across the load, and across the battery terminals.

Voltage indicator LED

My last idea to make this as safe as possible was to include a LED that would light up if there is a voltage on the terminals. Just to make sure I’d never plug my head into a live connector.

To isolate the LED from the load (I sure as hell don’t want a LED’s 30 milliAmps on my head, no matter what happens), I used a 1M resistor, and a darlington pair…

Putting it all together

Based on the above, this is the final design, and the device. It’s pretty small, fit on the tiniest veroboard I could find, is safe, and works good enough. All in all it cost me less than $50, and a few hours of work.

Schematic for my diy device

Schematic for my diy device

The device built

Advertisements

5 thoughts on “Building a good tDCS device – part 2

  1. keith

    I like the huge inductor, what ramp time did you get on turn on? Did it prevent the phosphenes. I have been experimenting with smaller inductors and achieved a rise time of about 500ms with little affect on the phosphene.

    Reply
    1. Coralio Post author

      Actually, I have a confession to make. So far I always used the potentiometer to start and stop, which naturally does not cause phosphenes. ;) I promised some scope shots though, so when I take those, I’ll do a “live” hard switch on, and publish my experience.

      Reply
      1. Coralio Post author

        I’ll do that post real soon, but in the meantime, I did a live test without measurement. I connected up everything, with the battery last. (This is somewhat less aggressive than adding my head last.)
        I did not experience any phosphenes on startup, and some barely noticeable ones at shutdown.

  2. robin mercer snead

    My husband who is an electrical engineer can build me a device but he wants to know what you used for parts. He was very impressed with your plan. Please let me know what parts to uses especially the DARLN piece. Where we live the Doctors have never even heard of TDCS. I have had major depression for 45 years. I would love to live one day not depressed or medicated before I die.

    Reply
    1. Coralio Post author

      Actually, I just used two discrete BJTs. I didn’t put too much thought into the components, just got what was cheapest on Mouser, as the design is quite conservative, nothing should come even close to operating limits.

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s