Using Arduino IDE with unofficial Arduino clones bearing CH340 chip

Andrey Semenyuk
Dev Genius
Published in
6 min readApr 14, 2021

--

Or a step into the unpredictable world of unofficial Arduino clones

Photo by Lucas Santos on Unsplash

Arduino is very popular platform for many DIY projects and thanks to its open design we have a lot of unofficial clones. Some of them are completely replicating original Arduino design, while some are trying to make it cheaper.

This is what you get when plugging some unofficial Arduino clones

If you bought unofficial Arduino Uno R3 clone, plugged it into your Windows machine and got “USB device not recognized” error, then this article is for you. Below we will see what the differences are between an official and some unofficial Arduino boards and what needs to be installed for some unofficial boards to be recognized by Windows.

USB adapter

First, let’s have a look at the original Arduino UNO R3 below:

Original Arduino Uno R3, bearing ATmega16U2 as USB-to-serial converter

Chip number 1 in this photo is Arduino’s brain: this is ATmega328P, which you program via Arduino IDE. This is the core of the board, this chip runs all your sketches — it contains CPU, memory and controls all the Arduino pins.

But if you will look closer, you’ll see that there is actually another chip on this board, marked with number 2. This is ATmega16U2 and on this board it has one and only role — to serve as a USB-to-serial converter. In other words — it provides USB connectivity to this board and acts as a bridge between your computer USB port and Arduino serial port.

Fun fact: ATmega16U2 is also relatively powerful chip, compared to ATmega328P. Yes, 16U2 has less memory and little bit less clock speed, but still, it can do a lot of tasks. So potentially, it could be used as a main chip for some of your projects, but its abilities are clearly wasted here and it is used just as a USB-to-serial converter.

So, basically, what happens when you plug USB into original Arduino board — you actually plug it into ATmega16U2, which communicates to your computer, operating system recognizes it and loads corresponding driver from the list of drivers installed. Then driver registers new COM port in the system, which you will select in an Arduino IDE, when programming your Arduino. Please note, that on the screenshot below correct port will be named accordingly — not sure if it is done by driver or by firmware on the ATmega16U2 chip, please let me know in comments, if you know.

COM port for official Arduino UNO R3 is named accordingly

But everything what is described above is true for official Arduino Uno R3 boards, and not always true for some unofficial boards. However, some unofficial boards are complete clones of Arduino and are literally different only by board color and logo.

Elegoo UNO R3 is one of the exact clones of original Arduino Uno R3, also having ATmega16U2 as a USB-to-serial adapter

Look at this Elegoo UNO R3 board: you can easily find same chips, as on original Arduino board, they are on the same spots: largest chip on the board is ATmega328P, and small chip on the left, near TX and RX LEDs is ATmega16U2. So, for Windows driver this board looks exactly the same as original one, because driver communicates with the same ATmega16U2 chip, so it will be recognized and will work fine with Arduino IDE.

Unofficial boards with CH340G chip

However, there are some unofficial boards, that will not be recognized by Windows that simple, and therefore device will shut down, no COM port will be exposed and as a result — you can’t work with these boards in Arduino IDE, because if there is no COM port, there is no way of communication and uploading sketches is not possible.

Another unofficial Arduino clone, ATmega328P is in different case and there is CH340G instead of ATmega16U2

Let’s have a look at this board. You can see difference from the first sight — where did that huge ATmega328P go?! Don’t worry, here it is — marked with number one in this picture. Yes, it is significantly smaller, but it is the same chip, just packed into the different case. So even if it significantly differs visually, it is still the same ATmega328P inside, so all your sketches will work exactly the same way.

The real difference is in the chip marked with number two. Remember, we had ATmega16U2 on this place on the official Arduino, but on this board we have CH340G.

CH340 is a series of specialized chips designed to do only one task — being a USB-to-serial converter. Because of that high specialization it is much simpler and therefore cheaper, than powerful and versatile ATmega16U2 used in official boards. Remember, however, that all this potential power and possibilities of ATmega16U2 is just wasted in the official boards, so even if you do have this chip in place, it’s potential is unused. So, from the perspective of overall performance and features of the Arduino board, you basically will not see any difference, doesn’t matter what chip is used as USB-to-serial adapter.

I haven’t tested it myself, but I read some article on the Internet, claiming that Arduinos with CH340 onboard consume less power, than boards with ATmega16U2. This could be quite possible, because CH340 is a simple one-task chip, while ATmega16U2 is a complex microcontroller. Of course, this will not make any difference if you are just playing with Arduino IDE or run your projects powered from the power socket, but if you have something running from a small battery, then this could be a reason to try boards with CH340G — maybe it will win you few days or running.

CH340 driver

But there is one issue with CH340: Windows lacks built-in driver for it. Strictly speaking, this is not a CH340 problem, but a Windows problem, but it is all the same for us, end users — when we plug these boards into USB, Windows will just complain “USB device not recognized” and there will be no COM port created for the board.

Solution is simple — just install correct driver!

  • Step 1: Find the driver. Just google “Arduino CH340 driver” and you’ll get a lot of links. Here is what comes up on google on the first place for me, but feel free to use any other link, as this driver is available in many locations.
  • Step 2: Unzip the file into a temporary location and run installer.
  • Step 3: Plug-in your Arduino board and check new COM port in the device manager. It is COM3 on the picture below, but it could use another port number on your computer.
CH340 driver uses COM3 here, but it could use another port number on your computer
  • Step 4: Choose correct port in your Arduino IDE. Please note, this time it will not be labelled like “Arduino Uno”, it will be just a port number:
Select correct COM port in the Arduino IDE. Please note, there is no hint next to the port, as it was for the boards with ATmega16U2

The end

CH340 is used on many other boards, not only with Arduino clones. So, if you are just starting your way into the bizarre world of microcontroller programming, then you’ll need this driver anyway, sooner or later.

Be curious, try other Arduino clones (they are so cheap!) and have fun!

Resources

--

--

Solution Architect. Love explore everything new, both in tech and new places on the planet.