New tDCS Regulator Designs

I released a simple pcb design last week for a stimulator based on the goflow schematic.

I've been working on a few more ideas and have posted two new schematics and one new board design. All the schematics, board designs and (eventually) code are hosted on github [v1][v2][v3]. The schematics and pcb layout are done with free, cross-platform gEDA (and friends) and the licensing is nonrestrictive (CC-BY).

I am still waiting for the prototypes to return from oshpark, I'll have a better idea of the electrical characteristics when they arrive. I'll also probably catch some blindingly obvious (in retrospect) errors.

There was a lot of great feedback in some of the other tDCS discussions, including info from a few EEs. I am new to EDA and electronics and would appreciate any input (feedback, commentary or patches against the repo).



  • rdbrdb
    edited August 2012
    Cool, it's always nice to have more engineers working on this stuff.

    In response to the GoFlow design, I've created a safer design a while ago.  Check it out, maybe you can get some ideas to upgrade your own design from it:
    I'm planning on releasing a cleaned-up and slightly improved schematic in a while, and eventually having them manufactured as well.

    A few comments/questions about your design:
    (1) You're using a barrel connector for the power supply.  Barrel connectors are typically used with mains-powered adapters.  You should never use a mains-powered supply in a device that's hooked up to the body, ever.  If there's a voltage surge, it'll travel right through the device, jump across whatever protection you might have in place, right through your brain.
    So, perhaps it is better to be stricter and only allow battery clips that are directly soldered to the board.  You could use two 9V batteries in parallel if this is necessary.

    (2) I'm a bit worried what the big capacitor might do if the battery is suddenly removed.  Perhaps it could discharge through the LM334, damaging it, which could result in injury next time the device is used.

    (3) Do you have any failsafe current limiter in case everything else fails for some reason?  The GoFlow uses a 5 mA fuse, which is laughable (5 mA fuses aren't feasible; where they exist, they are very expensive and have rather high trip time and reliability).  My design uses a simple JFET as current limiter.

    (4) TVS diodes or varistors are cheap and easy to hook up, and could protect the circuit from electrostatic discharge.
  • edited August 2012
    I definitely looked at your circuit when you originally posted it. I was worried that the part count would be too high for many hobbyists to consider building... but then I went off into the weeds and now all my designs are SMT with climbing part counts.

    l need to study it again. I am particularly interested in figuring out the JFET current limiter. My intuition in transistor and opamp circuits is really bad... It'll take some time, but it's great to have a reference. Thanks!

    (1) Yeah, it was designed to be run from the mains. I now realize that this is a terrible idea. With versions 2 & 3  I am opting for a switching 12V supply using USB provided 5V. I haven't properly considered the implication of computer sourced USB power... I assumed that I'd inherent several layers of good regulation and protection... but maybe this doesn't offer as much protection as I think it does... Also, someone could just plug in into a cheapo wall-wart and the original danger reoccurs. I am also worried about what effect switching noise will have on the LM334Z output. I can't wait to get a scope on it.

    (2) The LM334Z can handle 20V in reverse (the datasheet says it's can handle light-duty rectification in AC circuits). I don't think a discharge from the 12-16V cap would damage it. I could put a big bleeder resistor across it. In general, I am interested in examining the usefulness of this output cap. I think the theory of operation is that the cap passes current (proportional to C and dV/dt) during the steep voltage step at startup. This bypasses the electrodes for a while; as the cap charges it passes less current and the electrodes pass more. It's a ramp, but it's unclear to me what the time constant of this would be... I am not sure it's really useful, this needs checking. The v2 design is meant to have programmable current ramping via an eepot on the LM334 sense line, and will likely skip this cap all together.

    (3) There is no fail safe limiter. I investigated the "fast" 5mA fuses and like you found them wanting. I'll checkout the JFET solution.

    (4) I recently read everything in Art of Electronics on ESD (using the index), and was underwhelmed by their lack of practical advice on this front. What components (in my circuits) do you suspect are most susceptible? The LM334, I'd guess? I didn't check to see if they have any internal clamping. I'll google around for explanations of esd protection best practices.

    Thanks for the feedback! If you have any experience with gEDA and wanted to hack on the designs directly, I'd welcome the help.
  • rdbrdb
    edited August 2012
    The idea for the JFET current limiter is simple:

    (right circuit) Basically, the current through the resistor creates a negative potential at the gate (law of ohm, V = I * R, so a current of 2 mA through a 100 ohm resistor biases the gate by -0.2 V), and if it gets lower than a certain threshold value, the gate slams shut.
    I'm using BF245C myself, but any depletion-mode JFET with an appropriate gate-source threshold voltage will probably work.

    Even a USB connection is unsafe.  If you have to connect it to a computer, keep a battery for the internal power supply, and use optocouplers with high isolation voltage for the data lines.  Although since USB is bidirectional, this is a bit tricky, it's probably easier to use serial, isolate the serial lines and have a USB to serial converter chip on the USB side.

    Keep in mind that capacitors don't ramp up and down linearly.  The charge and discharge curves are very steep initially.  Ramping up using a microcontroller should work fine, which is what my design does.

    ESD protection is relatively easy, all you need to do is redirect the discharge away from the electronics.  A TVS diode is a fast-acting zener diode which breaks down (becomes conductive) above their rated voltage, so you can use these to redirect the surge around your current regulator.  (Alternatively, you can use a varistor, which decreases with resistance as the voltage over it increases.  I don't think they respond as quickly as TVS diodes though.)

    If you get a scope to test your circuit, be sure to check the turn-on behaviour.  From a quick glance at the datasheet, it looks like there's a spike in output current when the LM334 starts up.
  • Nice explanation of the limiter!

    That seems like a lot of work for USB. What about a crowbar at 6V or similar on the input in combination with the FET current limiter?

    Re: the 334Z, yeah, that graph (startup spike) is interesting. It looks like as much as 5% overshoot.
  • rdbrdb
    edited August 2012
    Eh, not sure.  I wouldn't trust it, personally.
Sign In or Register to comment.