by unrepentantgeek, published

Brainwave by unrepentantgeek Jan 31, 2013

Thing Info

15307Views 1759Downloads Found in 3D Printer Parts
Report Thing


Brainwave is a low cost controller for Reprap 3D printers derived from the well known Sanguinololu. The primary design goal was lower cost, achieved by providing only the minimum required components for a single extruder printer. It can be used to drive a cartesian or delta style printer.


  • Small footprint: only 60mm x 79mm!
  • 12V power input
  • Micro USB connector
  • All connectors at edge of board, vertical or right-angle connectors will fit.
  • Atmel AT90USB646 microcontroller w/ USB bootloader
  • 1, 2, 16 or 32x microstepping @ up to 800mA
  • Dual Z-axis connectors
  • Optional per channel current attenuation
  • Heated bed support with separate power input (up to 24V @ 15A)
  • Integrated heater/thermistor/stepper connector for E channel
  • Fan control


  1. Build, buy (from http://metrix.net ) or borrow a Brainwave
  2. Install Arduino 1.0.2
  3. install the brainwave arduino hardware bundle from github.com/unrepentantgeek/brainwave-arduino into the Arduino hardware directory.
  4. Get Marlin. I am maintaining a branch of Marlin that will compile for brainwave at http://github.com/unrepentantgeek/Marlin/tree/brainwave Marlin HEAD has support, but it doesn't always compile cleanly for this board.

Hardware configuration

Set micro-stepping selector jumpers (D1, D2) per channel. Short both for 32x microstepping. See table on back of board for other configurations. Default: single-step.
Set stepper current reference voltages. I = V / 2.55. Default: 1V == 400mA.

Software configuration

Open Arduino, find the Marlin directory and open Marlin.ino. Select 'Brainwave' from the Board menu. Find the Configuration.h file and change DEFAULT_AXIS_STEPS_PER_UNIT to suit your printer (remember, 32x microsteps!) Power on the Brainwave and connect the USB cable
(note: the brainwave will not power up off USB, you need the 12V supply.) Hold down the PROGRAM button and press RESET, the STATUS led should pulse. Press the Upload button in Arduino. After a reset the brainwave will show up as a CDC ACM serial device (/dev/ttyACM[0..9] on Linux) and be ready to accept commands.

Brandon Bowman wrote up an excellent guide for getting the board working under Windows and MacOS: http://fabbersuw.blogspot.com/2012/12/if-your-brainwaves-got-no-brains-or.html

Brainwave wiring diagram provided by Brandon Bowman.

Known issues

  • It may take a couple of presses of the RESET button to get the firmware to come up after flashing.
  • You may need a thermistor or similar 100k resistance present across the bed and extruder thermistor inputs. Otherwise Marlin may go into a deathloop and you'll never even see a serial device. Even if it doesn't fall on it's face it will only sit and complain about too high temp.

Primary development of Brainwave will continue at http://github.com/unrepentantgeek/Brainwave

Special thanks

Julie Atwood
Matt Westervelt
Frederik Hubinette
Silas Snider
Johann Rocholl
JP Sugarbroad
Austin Appleby
Richard DeLeon
Plamena Milusheva
Mark Ganter
Brandon Bowman

More from 3D Printer Parts

view more

Thing Info

15307Views 1759Downloads Found in 3D Printer Parts
Report Thing


Liked By

View All


Brainwave by unrepentantgeek is licensed under the GNU - GPL license.

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

So how hot is hot? Can I run the board at full current settings on all motors without heat sinks or fans? The way the board is mounted it has ventilation, but I can't measure the temp of the chips while it's printing due to it's orientation. I can measure the back of the board, which at the hottest point is about 68C.

My heated bed is at 104C, and if I touch it quickly, and then touch a motor driver chip quickly, the chip seems hotter, maybe 110C, but I'm only guessing at this point.

The measured voltages on all driver pots is ~ 1.7v. Any further and it rolls over to 0.21v. The ambient room temperature is 11C

That's a bit toasty, but will probably be fine. I'd look into sticking some small heatsinks on the drivers (look for RAM heatsinks) and/or put a small fan moving some air over them.

The thermal shutdown temp of the drivers is 180C, though they'd like you to keep them down around 85C.

Do be careful with the pots, if you open-circuit one it can cause the drivers to over-current themselves before thermal shutdown saves them.

Nice wiring job on the printer. I approve of proper wire management.

So, I've been fighting with this skipping issue for a few months now. I've pretty much rebuilt most of the machine, re-tensioned the belts, bed level, re-made end effector, replaced linear bearings, even the host PC. I burned through a full spool of print starts to figure this out.
The only thing left was to either replace the power supply, or the board. I replaced the board and haven't had any skips since.
I'm 99% convinced the problem is the Y motor trim pot doesn't hold it's value.
I noticed a brainwave 2 is in the works. Please use some different trim pots :)

I recently upgraded my ubuntu box from 13.10 (kernel 3.11-12 ) to 14.04 (kernel 3.13-05) and I can no longer program the board. I've programmed it numerous times before, but now when I push the program+reset combo, the green light pulses for about 1 second before stopping completely, and the device never shows up as a serial device in arduino. I can still connect to the board without programming it.

If I connect the board to my old windows xp laptop, the green light will continue to pulse and I can program the board. Do you have any idea what is going on in Linux and how to fix it? It does not seem related to arduino or host software. It seems like Linux is doing something with the serial port causing the programming wait loop to end prematurely. This did not happen before I upgraded Linux.


Yes this same thing happened to me! There is a daemon looking for modems and it opens every serial device that gets plugged in. I think that it is called modem-manager but it's been a while since I installed. Have a look in the system logs as I think that's how I found it.

"sudo apt-get purge modemmanager" solved that problem. Thanks!

Are there any tricks for controlling the fan speed when using Repetier Host. It is either on or off with no speed control. The fan stays off if I send anything less than 50% speed signal (M106 S127 or less). If I send anything greater than 50% speed (M106 S128 or greater) it turns on at a the same speed no matter where I set it.

The fan pin isn't on a PWM pin, so the firmware needs to use soft-PWM to make the fan spin an anything other than full speed. Yes, this is a deign flaw that I didn't notice until well after all the boards were made. :( I just run my fan at full tilt or not at all.

Does the issue of needing a thermistor still exist? I'm thinking of using the brainwave for a project that doesn't actually need a thermistor, so that would be a problem.

i uploaded the showed marlin firmware to the brainwave controller (arudino 1.0.5 on mac). but I can't connect to the board with the proterface and if I start the board with the motors connected it's just drive the axises insanly fast without stoping at the endstops nearly killing my printer :) what should I do? thanks!!

It sounds like you have the wrong pin definitions. Make sure that you have selected Brainwave 1.0 in the firmware as the motherboard model in Configuration.h (#define MOTHERBOARD 82)

when I push the program button and then the reset, the serial port changes and when I would like to upload the firmware I get an error message "Wrong microcontroller found". And I use the brainwave board (downloaded from the link at the description), I downloaded arduino 1.0.2 just to eliminate all the circumstances, tried everything...

Did you make sure to select Brainwave from the Board menu in Arduino? That sounds like you have the wrong target selected.

Strangeness with a brainwave board: with no header pins connected except for power + USB, I turn the board on and connect. Sending M119 repeatedly shows no endstops triggered for a few seconds, then suddenly Y_MAX becomes TRIGGERED and stays triggered. Resetting doesn't usually help, but on rare occasion it will flip back to "open" for a few seconds before getting stuck on TRIGGERED. Swapping X_MAX and Y_MAX's pins makes X_MAX produce this odd behavior.

Follow-up: for some reason pin 6 (45 on the chip) was only able to output ~0.8v after the first few seconds. Soldered to unused analog pin 49 (FastIO pin 2) and it seems to be stable again...

That's very strange. We tested the ability of those pins to detect HIGH and LOW, but I think that we were unable to test the pullups for fairly dumb reasons. You might also be able use a 20k pullup on the line instead of using another pin.


I see in the main marlin branch now there is an option to select Brainwave for the hardware. Does this mean it is now fully supported within the main branch of marlin including the native USB functionality?

Is there any other configuration needed other than printer specific options (i.e. no modification required in other .h files or anything)?


One more question - has anyone had success getting Repetier running on their Brainwave? I got Marlin working nicely but decided to risk my luck and get Repetier running as well to make an informed selection between the two.

I got Repetier to compile by creating a pins entry for the Brainwave and defining EXTERNALSERIAL (to solve an error or conflict with the Repetier-defined RFSerial).

When I flash it to the board, all three motors on my Kossel Mini build "vibrate" back and forth, although they don't actually seem to step. In other words, nothing moves but they just sit there vibrating. No serial port appears.


I haven't tried, and I don't know of anyone who has. It sounds like you maybe got some of the pin defs wrong. I don't know what is required for the serial support, it's kind of dark magic.

My pots were trimmed to Vref ~1.1V out of the box. Looking at the datasheet and board schematic, the ratio of Vref to drive current is about 2.5. In order to drive the motors with 0.8A (the max of the drivers) I would set Vref to 2V, right?

My board is running nicely and driving my partially complete Kossel-style delta build. So far so good!

Yes, I = V / 2.55 so 2V vRef gets you about 800mA.

I'm having a port issue. In programming mode I see the board at COM4 (i.e. running Windows). Marlin compiles (using your branch for testing) and I flash the board succesfully (avrdude verifies it, no errors).

Afterwards, the board does not create a USB port when plugged in and I can't access it except when in programming mode. I've seen this problem reported by a few other Delta printer people.

Is this a firmware or driver issue? Any suggestions? Thanks!

Nevermind! It required many presses of the reset button after flashing as noted in Instructions above.

Yeah, I'm not sure why this sometimes happens and other times not. If it gives me any trouble I just power cycle the board and move on.

I have a question about how the thermistors should work. With no thermal resistor attached my first thermistor reads 499.5 through Marlin firmware, and then around 482 with the thermistor attached. If I short the thermistor pins I get a reading of around 7.2. The same thermistor gives no reading when attached to the heated bed thermistor input, but Marlin returns 0. Have I completely messed up my Marlin, or does it sound like something is odd about my board?

nvm, flashing the board again did the trick. Not sure what was going on there.

That sounds like Marlin had the wrong config for temp sensors, maybe Configuration.h didn't get saved before compiling?

Glad to hear you got it working!

I'm having issues finding out how to wire the brainwave to the prusa-mendel 3d printer, any suggestions on where to find this?

question regarding Brainwave board build - what type of connector is used for the 4 pins to connect to stepper motors - I have looked at mouser and there are 1000's. thanks for any help

Any 0.1" (2.54mm) header will work. I've used both plain strip header and some fancy right angle latching connectors that you can see in the photo.

Here are the Mouser part numbers:

2 x 649-65846-016LF (8 pos header)
2 x 649-78211-004LF (8 pos wire housing)
2 x 649-78207-108HLF (4 pos header)
2 x 649-78208-104HLF (4 pos housing)
24 x 649-47750-000LF (wire housing pins)

Does this support having an SD card and LCD controller?

No, that requires a more flash and more 5v power from the board than it has.

I'm just adding this board to the RepRap wiki "Comparison of Electronics" page. What are the stepper driver chips?

On Semiconductor LV8713T

Will thi do for prusa i3 printer? Thanks :-)

Yes, it will work just fine.

Has anyone designed a printable case for this or do I have to do it?

I just bolted mine to a piece of plywood. Why would you want to cover up such a beautiful piece of electronic art? ;)

I've not yet heard of any cases for it, so I suppose it's up to you. Let me know if I can help.

Does the microcontroler has enough code space for firmwares like modified delta marlin?, or the most recent one for the kossel delta 3d printer?

Interested in buying, but i have to be sure it will work in a delta 3d printer

Yes, there's room for the delta Marlin firmware. Johann is using a brainwave on at least one of his printers. You get 60k at the moment (64k - 4k bootloader) but there's a 1k experimental bootloader coming if that's not quiet enough.

If you really need more than that, the MCU can be replaced with the AT90USB1286 for 128k.

looking for where I measure Vref to adjust trim pots?

The test point between the pot and the driver chip.

So D1 and D2 are the solder pads? Is conventional wisdom to solder bridge these to set to micro stepping?

I am thrilled to finally have my machine driving motors via Brainwave. Thanks for the help.

Yes, D1 and D2 configure the microstepping config. Short both to get 32x. You should only find a need to drop to 16x if you are trying to get a feedrate that requires greater than 22kHz step rates, but that would be something like 400mm/s.

Post a picture of your bot sporting Brainwave!

I guess the idea here is that the board should be cheap enough that if you fry a stepper driver, you just replace the entire board?

No actually, if you fry a driver your replace just the fried bit. This is actually way easier than it looks! You first cut the pins off the dead part with an x-acto type blade, removing the body. Then you sweep the pins off the board with a hot iron. Apply lots of flux to the pads and tack the new chip in place at the corners, then solder the rest down. It helps to have some sort of magnification, but it can be done without.

I intend to make a guide on doing this when I get some free time.

I have fried my extruder driver twice by being sloppy with the trim pot, but was able to manually replace it both times. So far, I haven't had any non-PEBKAC problems with the board.

Is there a guide for this yet? I just fried mine. I was in the process of flashing the firmware but when I supplied the the 12v to the board, I got a smoke show on the Z stepper driver.

I don't have a guide written up, but the instructions above are pretty much it. Cut the pins off right next to the body (this will take several passes, just take it slow)

Use an iron to clean the old pins off and wipe up the old solder with some solder wick. Solder the new chip down using lots of flux (the amount in wire solder is not enough)

You should check the pot by the z driver to make sure that it is intact. If you overturn this pot it can take the vRef to 5v, which will cause the driver to smoke itself.

Got your message, I'll take a crack at it. Do you know where I can order a that specific driver online?

Mouser and digikey both have them. I think that I've got some extras if you want to private message me your address.

Thanks for sharing, Do you sell the components only for this controller? My circuit board is ready I need all the components to give it a try.

No, I don't sell components, they are all available at http://mouser.com/http://mouser.com/ and likely elsewhere. That reminds me though that I should post a BOM as well. I'll work on that today if I can.

My firmware wouldn't even flash unless I hit the RESET button right before the code started uploading to the board. (Windows 7 Arduino 1.02).

Once that hurdle was crossed, it worked great!

Holding down Program button while pressing reset should cause the bootloader to stay active. The Status LED will pulse slowly when the board is waiting for new firmware. When uploading the Status LED will blink rapidly.

I find that the following process works pretty well for burning new firmware.

  1. Hold Program.
  2. Press and release Reset.
  3. Release Program.
  4. Burn firmware.
  5. When the green light stays off, the firmware has been burned.
  6. Hold Program.
  7. Press and release Reset.
  8. Release Program.
  9. Press and release Reset again.