Universal Serial Bus (USB) is an industry standard that establishes specifications for cables and connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers.

A broad variety of USB hardware exists, including several different connectors, of which USB-C is the most recent.

Released in 1996, the USB standard is currently maintained by the USB Implementers Forum (USB-IF).

There have been four generations of USB specifications: USB 1.x, USB 2.0, USB 3.x and USB4.

 

Serial Monitor Basic PC to Arduino

Picture
Serial Monitor

Here is a basic USB PC - Arduino Interface via the Arduino IDE included Serial Monitor.
You can send single character commands to the Arduino program with the Serial Monitor SEND button
You will see the Arduino response in the Serial Monitor text display
The advantage is you can command the Arduino without any PC code.
The disadvantage is your portable Arduino needs to be attached to your PC with a 6 foot max USB cable
as you can see with the sendReading, you can still do other things too

Python Firmata USB-Serial

Picture
firmata wiring

Using built in tools is one of the quickest ways to leverage new projects.

Use Python on a PC via the standard USB cable for serial communications to your Arduino.

ARDUINO:

On Arduino you will want to load the standard firmata example program.

No changes needed !

File > Examples > Firmata > Standard Firmata

Analog potentiometer connections standard 5 VDC in, Gnd out, with Analog pin connected in center.

PC:

This tutorial is based on Python 3.7.

Demonstrates Digital input, Digital output, & Analog input.

No Analog output DAC on the Arduino Uno.

Install pyFirmata and time libraries in Python3.

For windows open the command prompt.

For Linux open the terminal.

Type:

pip install pyfirmata

pip install time

Use CTRL-C to stop program.

 

 

Python Tkinter USB Pyserial to Arduino

Picture
Python Tkinter USB Pyserial to Arduino

One of the most simple and straight forward way to communicate with an Arduino is to use the serial communications via USB already part of the programming environment.

Here is the Arduino code with the need Python code.

Download Python3 Pyserial  and Tkinter setup before running the Python code.

Digital output 11 pin changes with Tkinter ON/OFF button.

Use a digital multimeter to see or use a simple LED with limiting resistor.

Note change the port per operating system :

Linux  ( Ras Pi ) use :  port = "/dev/ttyACM0"

Windows use: port = "COM3"

Check your OS for the exact port used.

NOTE: Arduino Tools> Serial Monitor and Serial Plotter are not usable while the Python comm is in use.

Tutorials

Here are some helpful tutorials on some the systems available with Scada123 to try on your own.

You can view videos at:     Youtube Channel Scada LLC

Sort through Topics on the left Menu "Tutorial Menu"

Click on one the Topic Tags that interest you.

License : All programs in the tutorial section are free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.