Hardware

Nathan Whitmore
Attachments
openstim_ac.png (90774 bytes)

The OpenStim hardware is based on an Arduino board, with an AD5206 digital potentiometer to control current flow. The Arduino board's built-in voltage source and ADCs greatly simplify the task of constructing an OpenStim, since the only soldering required is connecting the MCP4131 to the Arduino.

How it works

Transcranial Direct Current Stimulation relies on maintaining a constant and very small flow of current(typically 0.25 to 2.5 mA) through the head. The head, electrodes, and wire all essentially act as a resistor that limits the flow of current. The essential task of a tDCS device is to supervise the circuit by modulating either the supply voltage or other sources of resistance within the circuit, to ensure that the total current flow through the circuit meets the target.

OpenStim accomplishes this by way of a control loop. Power from the Arduino 5 volt regulator is fed to the A terminal of the digital potentiometer, and the output is taken from the wiper terminal. By sending SPI commands, the Arduino can control the amount of resistance between these terminals from 0-10KOhms. The OpenStim also uses a small(~17 ohm) resistor located between the power supply and the digital potentiometer. This resistor decreases the voltage on the line by a small amount, which varies depending on how much current is travelling through the circuit. The voltage on the "low" end of this resistor is read by one of the Arduino's ADCs, and used to calculate how much current is flowing through the circuit at any given time.

Bill of Materials

1x Arduino UNO(or compatible board). Distributors listed here Note that boards based on the Arduino Leonardo are NOT compatible because they don't have a dedicated USB chip.

1x Analog Devices AD5206BN10 order here

1x 10-50 ohm resistor (values anywhere in this range should work because the OpenStim will "learn" the value during calibration. If you want to be super-careful, use a 17 ohm resistor--that's what was used on all the test units)

1x A -> B USB cable

16 ga or smaller sheet aluminum(quantity depends on size of electrodes)

Absorbent material sufficient to completely and uniformly cover the sheet metal on one side(see the [Electrodes] page)


Related

Wiki: Electrodes
Wiki: Getting Started
Wiki: Home

  • J Harlow
    J Harlow
    2014-07-08

    I have threw together a Frizing file (breadboard/schematic/PCB layouts) of the multi-channel device. (See http://www.fritzing.org/ for GNU/GPL software ) The file is attached, feel free to update/correct and re-post. I may refine it an update at a future time.

     
    Attachments
  • Jibroseph
    Jibroseph
    2014-07-15

    Sean, check the manufacturers part number in the list. Make sure it's the AD5206BN10. Searching may list similar part numbers, be sure to check it exactly matches.

    In other words, you want the 10kOhm version. Below is the link. Good health to us! May we be protected!
    http://www.digikey.ca/product-detail/en/AD5206BN10/AD5206BN10-ND/617182

     
  • JDub
    JDub
    2014-08-05

    So, quick question, in the image openstim_ac.png, which electrode is the cathode, and which is anode?

     
    Last edit: JDub 2014-08-05
  • JDub
    JDub
    2014-08-05

    OK, after further research I believe the answer is "either, depending on how it's programmed." Is that correct?

     
  • Jibroseph
    Jibroseph
    2014-08-05

    Be sure to test your circuit's conventional current with a digital multimeter. You don't want to be guessing here. I've not finished building yet, but am inclined to think the circuit does not run in reverse.

     
  • JDub
    JDub
    2014-08-16

    Thanks for the heads up. Yeah I have been testing everything before launch for sure, and am not getting readings I like. I admit to being a n00b, so please bear with me. That's why I'm here :) !

    That said, I'm having issues. Running the diagnostics, I get the message "Test failed. Your device cannot produce sufficient current, or cannot modulate current output. Check connections to the resistor chip, or click next to check for shorts." The short test comes up clean.

    AFAICT, the connections involving the simple 15Ω resistor I used are correct. I disassembled and rebuilt the unit on a new breadboard shield, and I still can't seem to get a stable "commanded current."

    BUT... there is one other MAJOR question about the diagram that is a mystery to me. If you look at openstim_ac.png, there is a floating label, "U1, 10KΩ" that doesn't seem to be in the schematic. Since the error message references a resistor chip, and U1 10KΩ implies a resistor chip (which I don't have in my circuit, except that a potentiometer is also a “variable resistor,” so…), why don't I see this chip on the hardware list or as an actual component in the schematic????

    Could my AD5206BN10 be bad? Is there any way to test it with simple electronics equipment? (digital MM, arduino, a couple of breadboards, and a stock of misc. electronics parts...)

    Anyone? Anyone? Bueller??

     
    Last edit: JDub 2014-08-17
    • Jibroseph
      Jibroseph
      2014-08-17

      The AD5206BN10 is a digital potentiometer (digitally controlled variable
      resister). That is the resistor chip (check the manufacturer's datasheet
      for details). The way openstim controls the amperage is by varying the
      resistance in the chip ( V=iR ). That 10k ohm number can vary depending on
      what the firmware outputs. If openstim cannot find a setting on the
      resistor chip that works, it cannot control the circuit.

      I'm saying all this but didn't finish mine yet. Actually had trouble
      getting openstim to recognize the device when I plugged in the USB... What
      OS are you using?

      Anyone? Frye, Frye?

      On Saturday, August 16, 2014, JDub fust72@users.sf.net wrote:

      Thanks for the heads up. Yeah I have been testing everything before launch
      for sure, and am not getting readings I like. That's why I'm here :) !

      That said, I'm having issues. Running the diagnostics, I get the message
      "Test failed. Your device cannot produce sufficient current, or cannot
      modulate current output. Check connections to the resistor chip, or click
      next to check for shorts." The short test comes up clean.

      AFAICT, the connections involving the simple 15Ω resistor I used are
      correct. I disassembled and rebuilt the unit on a new breadboard shield,
      and I still can't seem to get a stable "commanded current."

      BUT... there is one other MAJOR question about the diagram that is a
      mystery to me. If you look at openstim_ac.png, there is a floating label,
      "U1, 10KΩ" that doesn't seem to be in the schematic. Since the error
      message references a resistor chip, and U1 10KΩ implies a resistor chip
      (which I don't have in my circuit), why don't I see this chip on the
      hardware list or as an actual component in the schematic????

      Anyone? Anyone? Bueller??

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/openbrainstim/wiki/Hardware/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • foolishsailor
        foolishsailor
        2014-10-07

        Any resolution on the issue with not being able to produce adequate current? I have the same issue and am using an Arduino Uno

         
  • JDub
    JDub
    2014-08-16

    Also, the reason I say what I did in my previous post about "either, depending on how it's programmed" is that there is a stim program called "basic-inverted" that shows the "operating_power" parameter at -1.0. That's the only difference from the stim program "basic," which has that parameter at 1.0. That leads me to believe that the basic-inverted stim program changes the cathode into the anode, and vice-versa.

     
  • Jibroseph
    Jibroseph
    2014-08-17

    The AD5206BN10 is the variable resistor chip. Check the datasheet: http://www.analog.com/static/imported-files/data_sheets/AD5204_5206.pdf

    Pin A6 has a 10kOhm resistance, W6 is the wiper resistance to your electrode, openstim will adjust that one to get the circuit's current right, I think.

    By the way, I cant get openstim to recognize when I plug in the USB to my circuit (even though I could load the firmware. what OS are you using to connect?

     
  • JDub
    JDub
    2014-08-17

    Hey thanks for the reply!

    I had edited my original question heavily before, after I realized (before your post) that the AD5206BN10 is in fact the U1, 10KΩ resistor in question. As you noted, it's a variable resistor, also known as a potentiometer. Duh... (yes, I'm a n00b!) I re-edited my post back to what it was, and edited to include my (corrected) question about testing the AD5206BN10 that was in my later edit, for thread continuity sake. It should all make sense now...

    As far as testing the AD5206BN10, is it true that I should get 10KΩ when testing between A6 (pin 1) and GND (pin 4)?

    To answer your question, I am using Win 8.1. I have had no problems with the device being recognized, but one thing I did notice is that you MUST start the software first, then plug in the hardware. Otherwise, even though it appears to find the hardware just fine after the initial startup, I found there was strange behavior. But, since my device is currently inoperable for all intents and purposes, I can't recreate the strangeness now to report exactly what was strange about it (I noticed it over a week ago, before the real glitching started).

    Also, I found that if after a diagnostic test, if I step backward through the diagnostic pages, trying to get back to the screen where you can start the stimulation or calibrate or whatnot, I get the error "ERROR: The stimulation file is not well-formed. Press any key to restart." Pressing any key does not restart, however.

     
  • JimBob
    JimBob
    2014-08-18

    That LED on D3 requires a current limiting resistor. As it is now, it's pretty much a dead short to gnd and probably drawing more than the ABS MAX current for that pin (40mA).

    Should be using a 200-500 Ohm resistor in series with the LED to keep the current below 20mA nominal for the pin.

     
  • SamyRIMA
    SamyRIMA
    2014-09-17

    Hello,

    Thanks for this great projet. Has there been any random noise stimulation programs developed for this bad boy?

     
  • I'm not sure if I missed the answer or not but I'm getting the same message claiming that "Test failed. Your device cannot produce sufficient current, or cannot
    modulate current output. Check connections to the resistor chip, or click
    next to check for shorts." The short test comes up clean. I've tried everything, replaced the AD5206BN10, went over all connections with a multimeter ( which shows a current of 5 volts through the whole circuit on standby) even replaced the Arduino board and I still get a reading of approximately 1.xxxx E-4. I know that others get it to work but for the life of me I can't.

    I've very excited about this project and I'm anxious to start using it.

    Can anyone help me here? I've included a model of my project if that is any help.

     
    Attachments