How to install CH340/CH341 driver for Arduino compatible microcontrollers?
More and more often we are contacted by you and asked how to install CH340 driver for Arduino compatible microcontrollers. In this blog post we would like to explain
- What is the difference between microcontroller boards with CH340 chipset and "originals"
- Where to download CH340 driver
- How to install CH340 driver on Windows
- How to program Arduino compatible microcontrollers with CH340 driver inside Arduino IDE
After reading the blog post, you will be aware of all the stumbling blocks when starting up cheap Arduino clones!
The difference of microcontrollers with CH340 and the ATmega328P chipset
First things first: Arduino compatible microcontroller boards with CH340 chipset are slightly cheaper than classic boards with ATmega328p. This is partly due to the fact that the classic boards with "original" chipset can be connected to the home computer via USB immediately after purchase and are therefore ready for use.
Before we jump to conclusions at this point, let's take a detailed look at the most important advantages and disadvantages of CH340 boards:
Disadvantage 1: The CH340 chipset is not compatible with all operating systems!
Especially with Windows systems, the CH340 chipset often leads to frustration: the Windows operating system is usually not equipped with the CH340 driver ex works. Arduino compatible boards with CH340/CH341 driver, which are connected to a Windows PC, are often not recognized as such by the PC. Within the Arduino IDE, error messages are therefore issued when uploading sketches.
Disadvantage 2: Uploading sketches to CH340 boards takes longer (tested at 5V)!
We admit: maybe this disadvantage is negligible in home prototyping, however it exists. The easiest way to see the difference is to look at the following data series.
Size of the sketch (byte) |
R3 Upload time (seconds) |
CH340 Upload time (seconds) |
500 |
5.3 |
5.6 |
5000 |
9.3 |
9.7 |
7000 |
9.6 |
10.2 |
On average the program upload takes about 0.4 seconds longer with CH340 boards.
Advantage 1: The power consumption of the CH340/CH341 board is lower!
Of course you can neglect the upload time of sketches, especially for rapid prototyping. But what about the power consumption? Again, we looked at the board's behavior with two standard sketches that I'm sure each of you knows: "Bare Minimum" and "Blink".
Example sketch |
Power consumption R3 (mA) |
Power consumption CH340 (mA) |
Bare Minimum |
32.3 |
14 |
Blink |
37.1 |
20.1 |
We are as surprised as you are! The power consumption of the CH340 microcontroller board is only half that of the R3... exciting!
So let's come to the conclusion:
For those who can live with the extra effort due to the installation of the additionally required driver, Arduino compatible microcontrollers with CH340/CH341 chipset are certainly a good alternative. The technical disadvantage of the CH340 version, the upload time, is certainly negligible for the hobbyist. Here even outweighs the gain by the low power consumption!
Where can you download the CH340 driver?
Now it gets a bit tricky: In the following we link you the CH340 drivers for the platforms Windows, OS and Linux. The links of the Windows and OS drivers link to a website with Chinese characters. Don't let that put you off: You can simply download the driver by clicking on the blue bar (cloud symbol). At the time of our test, the sketches were of course virus-free!
Windows: http://www.wch.cn/download/CH341SER_ZIP.html
Linux: https://github.com/juliagoda/CH341SER
OS: http: //www.wch.cn/download/CH341SER_MAC_ZIP.html
Update 11/21/2022: We were informed by a customer that using the above driver for OS may cause complications. We therefore recommend the following driver (subject to a charge).
https://www.mac-usb-serial.com/dashboard/
Further information can be found at https://thingsmatic.com/2017/08/07/using-ch340-devices-with-osx/ .
At this point we would like to point out that administrator rights may be required for the installation.
How do I install the CH340 driver now?
If you have downloaded the corresponding file, you can unpack it (for example with WinRar). Then open the Setup.exe file. After that a new window will open. In this window you select the file "CH341SER.INF" under "Select INF". Afterwards you confirm the selection with the button "Install". If the installation was successful, a popup appears, which confirms the installation.
And how can I use my compatible microcontroller board with CH340 driver now?
Quite simple: (almost) exactly like a board with ATmega328p or ATmega16U2 chipset. First you establish the USB connection between microcontroller and your computer. The microcontroller should be visible in the device manager.
Then open the Arduino IDE. Select the type of your microcontroller under "Tools" and "Board". Then under "Tools" and "Port" select the so-called COM port of your controller. Usually this is the COM port with the highest number.
Important: In the next step you have to select the ATmega329p (old bootloader) under "Tools" and "Processor". Only then you can load the CH340 controller!
That wasn't so hard, was it? If you want to start your next project right now, we recommend our free learning platform www.funduino.de with more than 250 free tutorials for the most popular sensors, actuators and much more!
Auswahl des Prozessors
Heute (15.09.2022) habe ich einen "Funduino NANO R3 - CH340 Chip - fertig gelötet" erhalten und gleich ausprobiert.
Entgegen der obigen Beschreibung musste ich in der Arduino-IDE (1.8.19) als Prozessor ATMega328P auswählen, d.h. ohne "old bootlader".
Muy agradecido
Muchísimas gracias, no todos los días encontramos personas con los conocimientos, la capacidad de transmitirlos y la voluntad de ayudar.
CH340 no deja reprogramar firmware
Hola, este chip se interpone para reprogramar el ATMEL328P y usarlo de controlador MIDI mediante el propio conector USB. ¿Estoy en lo cierto? De ser así, ¿Hay solución?
Un saludo y muchas gracias.
Alte Treiberversion behalten
Hallo,
die Aktuelle Version die immer wieder per Windows update instaliert wird ist die 3.8.2023.2 vom 11.02.2023.
Leider kann ich mit diesem den ESP nicht programieren.
Hierzu muss ich immer eine Alte Version instalieren.... (08/08/2014, 3.4.2014.08).
Windows aktuallisiert diesen aber immer wieder mit dem Falschen....
Wie kann ich das ändern ?