Disclaimer: don’t build one of these, but if you do, this design is probably better than whatever else you find on the internet, but maybe not. Ultimately I am not responsible for anything you do or build.
Transcranial direct current stimulation (tDCS) is a technology used to treat a variety of ailments, especially anxiety and depression. Read more about it on wikipedia or in one of the 1000+ studies investigating the technology. This article showcases a DIY tDCS device that I have built.
The circuit is pretty simple. In fact, it is a use case for the LM344 and they even include a diagram (see below).
Why this circuit?
While tDCS devices have simple purpose, some of the designs online are a bit worrisome. I would not recommend any circuit that uses the LM317 for any current regulation since the minimum recommended output current of that IC is 10mA, about 5-10x higher than our design specification. This is why the LM334 is the better option here.
I also decided to use a DC-DC voltage converter for my circuit, but this is really not necessary if you have a fresh 9v battery. For the F3 -> FP2 montage and my DIY sponge electrodes (below), I have observed that only 5-7 volts are required to maintain a nice 2mA. The DC-DC regulator might be required for higher impedance montages or combination tACS+tDCS in lieu of an extra 9v battery.