John L Errington MSc

Experiments with an Arduino microcontroller

Useful apps and finding connection faults

USB connection to an arduino

I've often seen questions on the forum that ask why their device wont connect or isn't showing on the PC.

These suggestions will mostly only be relevant if your using a Windows PC.

"USB" covers a multitude of connections and that diversity itself can cause issues in ensuring you have the right connection.

usb ports

The USB ports on your PC are color coded like this.

More recent USB standard conections can provide more current than historic (USB 1.0/1.1) connections.

 

USB Cables: Charging, Data or Sync?

usb cable

A USB cable SHOULD have at least 4 wires: 2 to provide power, and 2 for data transfer.

Unfortunately some USB cables are made cheaply and omit the data wires.

So a cable you get with a USB device may only be a "charging" cable. Generally these look "weedy" compared to a decent data cable.

If you have these (and want to keep them) find a way to identify them so you dont try to use them for a data connection. I tie them in a knot.

 

So if you have a problem the first steps to take are

 

Get a tester

usb meter

One of these is very useful for checking the voltage and current drawn from your USB port, and will show you in an instant if your USB device is drawing current (which it SHOULD be).

They arent expensive!

 

Problems that show up in the IDE

fatal errorWhen you try to upload you may get a message like this.

Often it means you have the wrong settings in the IDE

 

 

choose portFrequently the error can be due to an incorrect choice in the "tools" menu.

Make sure you have chosen the right board.
Its not always obvious which you should choose, as there can be a LOT of options, especially for more recent or more advanced boards like the ESP32.

If you arent sure, the "generic" option will usually work.

 

You also need to make sure that you have chosen the right port.

The utilities listed below will enable you to see which port you should select.

 

 

 

 

Apps for testing the connection

While you CAN use windows device manager to look at the USB connections, I use three FREE and PORTABLE (no installation needed) utilitites. You can even run them directly from a USB stick.

USBDeView

USBDeview

from Nirsoft

lists all USB devices that currently connected to your computer, as well as all USB devices that you previously used, and when they were connected.

 

This display shows a NANO connected on port COM7

 

USBTreeView

USBTreeView

from Uwe Sieber

shows connected devices and all your USB ports.

Gives an extensive page of data relating to the chosen device.

Here you can see I have a Nano (with a CH340 USB - serial chip) connected on COM11.

 

And USBLogview - again from Nir Sofer - gives you an immediate display that shows when a device was connected or disconnected. Here I've unplugged my Nano, and plugged in an ESP32. See how it shows you which port its connected to.

USBLogView

 

If your Arduino doesnt show up in these utilities you have a bad cable or USB port, or your Arduino is defunct.

 

Serial monitor

While the serial monitor you find in the arduino IDE is useful, its limited and primitive.

termiteTools like PUTTY are powerful - but complicated to use.

I've found Termite to be a great compromise providing the facilites I need - such as recording data to a file - with ease of use.

When you enable a log file a dialog opens to allow you to save it with a suitable name in any location.

 

Once again, its free and portable so you can run it immediately, or if you prefer you can install it.

 

Better Serial Plotter

Better Serial Plotter

Better serial plotter

More powerful than the plotter in the IDE but a bit more complicated to use.

It supports plotting multiple data sets on the same screen, on the same or different axes, and can do XY plots.

Right click on the plot screen to change settings, or scroll over an axis to change it.

 

 

In addition to the "basics" - Arduino IDE and Fritzing - I can recommend the following:

Code::Blocks Programming environment

Notepad++ a lightweight and portable code & text editor

Meesoft Diagram Designer used here for flowcharts and circuit diagrams

Dia another tool for diagrams (I used it for the state diagrams)

TinyCAD Very simple schematic editor and a good step towards using more sophisticated packages

Eagle Schematic Editor with the sparkfun libraries as described here

Learn to install and use eagle