Using an Arduino to Flash the Melzi Board (Wanhao I3) and Upgrade Firmware


Introduction: Using an Arduino to Flash the Melzi Board (Wanhao I3) and Upgrade Firmware

I purchased an e3d hotend and due to it using a different thermistor, the stock firmware that came with the Wanhao i3 (v2.0/2.1) won't be able to read the thermistor temperature correctly. I had a spare Arduino laying around and found out I could use it to flash the Melzi board which is normally done with a standalone AVR programmer.

Step 1: Preparing the Board

  1. Disconnect the printer power supply from the back.
  2. Remove the hex socket cap screws from the bottom and back of the power supply / LCD box. Don’t remove the middle four on the bottom as these hold the PSU in place.
  3. Remove the back of the box and slide the bottom of the box toward the back, and place the two pieces somewhere convenient close by. It gets a bit annoying because things aren’t modular with this printer.
  4. You can unscrew the four hex socket cap screws that keep the Melzi board in the box to have more freedom. Be sure to remove any SD card or USB cable you’ve still got connected. You can probably skip this part but I find it easier to manage with it outside the box.
  5. Ensure the auto-reset jumper at the bottom of the board is on (or if you’ve chucked it out like I have, that the two pins are electrically connected somehow) and the power jumper up the other end of the board is set to USB
  6. Remove the SD card and USB cable if you’ve haven’t already, and disconnect the LCD cable near the auto-reset jumper from the board. Apparently the LCD messes with the SPI interface somehow.

Step 2: Preparing the Arduino

I’ve used an Arduino Duemilanove but you can use an Uno (I am not sure about Nano and other types). Arduino gives you a little more info about this process here. Whatever device you are using, this is called the ISP programmer.

1.Install Arduino 1.6.9 (I use this only because the firmware was confirmed working with this, you can probably use the latest but not certain), and install the Sanugino package. This can be done by copying the contents of the zip to /ARDUINO_INSTALL_DIRECTORY/hardware.

2. Connect the ISP programmer/Arudino to your computer. Open device manager -> ports to see what COM port it is if you are unsure.

3. In the Arduino IDE, Tools -> Board -> Select your Arduino board and select the COM port corresponding to your device, Tools -> port

4. Open the ArduinoISP example from File -> Examples ->ArduinoISP -> ArduinoISP and upload it to your Arduino by clicking the upload button.

5. Now we need to burn the bootloader to the Melzi. This will require either 6-pin headers or some sort of make-shift situation like I have done (wires + solder + Arduino headers). However you do this, connect the pins on the Arduino to the Melzi board ISP pins on the bottom of the board. As per the schematic, ensure the following pin connections:

Arduino 10 -> Melzi RES

Arduino 11-> Melzi MOSI

Arduino 12 -> Melzi MISO

Arduino 13 -> Melzi SCK

Arduino 5V -> Melzi 5V

Arduino GND -> Melzi GND

6. Once the connect is made, ensure both the Arudino and Melzi are powered by USB.

7. Go to Tools -> Programmer -> Arduino as ISP.

8. Go to Tools -> Port -> select the port corresponding to the Melzi board, not our Arduino.

9. Change the processor board to Sanugino using Tools -> Board and set processor to The Sanguino ATmega1284p (16MHz) using Tools -> Processor.

10. Click Tools -> Burn Bootloader. This should take about one minute or so and will notify you if successful. Errors will occur if steps 7 – 9 aren’t followed.

11. Remove the headers from the the SPI pins on the Melzi board. You won’t need the Arduino anymore so you can disconnect this too.

Step 3: The Firmware

I have used a nice version of the repetier software modified by Max Bian on the Wanhao google group:

1. Download the firmware and extract it somewhere and open the .ino file in the Arudino IDE. You can use whatever firmware you like. I will be referring to this one though.

2. Open it with the Ardunino IDE and do these few modifications if you wish:

a. This ensures the thermistor of the e3d can be used correctly if you want to use the the e3d v6 hotend – In the configuration.h and change “#define EXT0_TEMPSENSOR_TYPE 97” to “#define EXT0_TEMPSENSOR_TYPE 8”.

b. This ensures the rotary encoder on the box is nice and smooth - In the configuration.h file, change “#define UI_ENCODER_SPEED 1” to “#define UI_ENCODER_SPEED 2” and “#define UI_KEY_BOUNCETIME 10” to “#define UI_KEY_BOUNCETIME 20”.

c. This removes all those stupid beep sounds - In the ui.cpp find and replace “BEEP_SHORT “ with “//BEEP_SHORT”.

3. Save all these modifications. Ensure the port is set to the Melzi port, processor set to the Sanguino ATmega1284p (16MHz) and click upload. This will take about a minute.

4. If you get the error “avrdude: stk500_getsync(): not in sync: resp=0x00” you haven’t burned the bootloader correctly so go back and try again.

5. Once completed, remove the USB cable from the Melzi board, remove the auto-reset jumper if you are used to that and change the power jumper back to VREG, attached the LCD screen back again.

6. Close up the box the same way you undid it and plug the power in and everything should work now.

You’ll see some nice changes in the menus and startup screen, but other than that, everything should be similar. A really great feature is the babystep-Z adjustment in quick settings which can be done at the start of the print if the bed is level but too close to the nozzle.



  • Water Contest

    Water Contest
  • Creative Misuse Contest

    Creative Misuse Contest
  • Oil Contest

    Oil Contest

17 Discussions

One error in this instructable: In part 8 of step 2 it says to choose the Melzi COM port, but it should say to choose the Arduino port. Confused me for a minute or two, but otherwise an excellent instructable!


3 months ago

Hi, I tried all you steps, but when trying to load the boot loader, I get these errors:

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00

avrdude: stk500_recv(): programmer is not responding

2 replies

I had this problem, I resolved it by not connecting the 5v or gnd pins at all and rather than selecting the melzi as the com port select the Arduino as the com port. It works perfectly then.

I'm getting the same response and can't seem to find a fix for it. That error message is why I tried to burn the boot loader in the first place. Did you happen to find a fix?

Followed this guide and it worked great, thanks! I have a Wanhao Duplicator i3 v2.0, and I noticed after the install that I get idle temps at about 3-7 degrees C and that the hotend temp fluctuates a bit. I think the termistor settings are off. From what I can find on Google I have the 100k 3950 thermistor, do I need to change any configuration values for this to work better? The termistor itself should be ok, worked great before the board swap. Ideas?

1 reply

Replying to my own post here if anyone else has the same problem. I changed these two lines in Configuration.h:


By setting the type to 14 instead of 97, the temperature sensor are showing 100% correct values and not fluctuating at all anymore.

So do you know if this is the newest version of the firmware that is available?

1 reply

I'm not sure. The one linked is a random one I found. Use James' and Jetguy's version if you're worried, down the bottom of the page

Would you recommend this to someone who doesn't have any upgrades as in no aftermarket thermistor or anything? What are the top added setting options available with this?

3 replies

Hey Isaac, just copying and pasting this from a previous comment:

The new firmware is much better. Just little things like the babysteps function (basically Marlin live-adjust). When I am printing my skirt, if I feel it's too close/far from the bed, I can just adjust the Z-height on the fly. Other things like when you doing test extruding (moving extruder axis), it shows temperature fluctuation on the screen. The lack of beeping is also amazing. I only have good things to say about the upgrade.

Is there anyway to undo it once its done or is it permanent?

Once the firmware is flashed, you can't go back without reflashing it. I am unsure if the official firmware is out there. I know there is a Github for the i3 plus, but unsure about v2.1. The original firmware really is just repetier firmware, not really customised. This firmware is pretty standard, no real reason to go back.

So if you didn't want to mess with the firmware you could just use the thermistor that came with the Wanhao ? The heater cartridge used seems to be irrelevant to the firmware ?


3 replies

That was my original plan, however I didn't realise that E3D released the new cartridge style thermistor, and subsequently a new heat block. This meant that thermistors that rely on the threaded cavity to be placed into the heatblock, like the stock Wanhao one, cannot be used without modification of the block which I wasn't keen on. Hence upgrading the firmware was the next best thing which required no additional cost for me. You're right in that the heat cartridge type is independent of firmware, only supply voltage of the board you're using (12/24V).

Thanks. How have you found the different firmware? I have been put off in the past as people on Google groups said a lot of settings have been customised for the printer. However, if you have had no print issues it doesn't seem to customised that much.

The new firmware is much better. Just little things like the babysteps function (basically Marlin live-adjust). When I am printing my skirt, if I feel it's too close/far from the bed, I can just adjust the Z-height on the fly. Other things like when you doing test extruding (moving extruder axis), it shows temperature fluctuation on the screen. The lack of beeping is also amazing. I only have good things to say about the upgrade.

Thanks for sharing :)