Arduino Mega 2560

The Arduino Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button.

Arduino General Info

Arduino has many low cost microprocessors.( Uno, Mega, Due. . . )

The Arduino Home Site can be found at:

Arduino is a nice simple solution for many C programming ( C++ if you want ) automation projects, so we will begin with this.

There are many different Arduino boards depending on your desires.

Arduino is a microcontroller with limited memory ( Uno 32k ,Mega 256K, Due 512K).

The I/O is limited, but sufficient if you think of it as a dedicated sub process.

The Analog inputs have a 10 bit (1024) DAQ for input and the PWM output can be filtered for a near analog constant value.

Digital inputs are made for ( 0-5 VDC for Uno & Mega 0-3.3VDC Due) and Digital Outputs can all be ON/OFF limited 40mA current with a PWM output option for several designated outputs.

A great starting point for anyone learning Arduino:

Topic: Useful links - check here for reference posts / tutorials


LCD 1602 Keyboard Shield


This is a simple example of a LCD 16 character 2 line (1602) shield that mounts directly on an Uno or Mega.

This also has an addition benefit of 5 built in buttons with built in series resistors that all use the A0 input.

The buttons use a series of resistors that act as voltage dividers giving each button a unique voltage.

Since resistors do vary, you will need to run the program (Keys_1602shield) to set the voltage ranges.

In serial monitor, you will see the key and the bit integer value.

Write down these values.

In the program, set the break values between these measurements.

NOTE: this LCD shield wiring differs from some LCDs with the code:

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

Then run the LCD_KS_Menu program for a simple menu example.

Use the UP/Down to scroll the menu items.

Use the RIGHT button to set the Digital ouput.

Use the LEFT button to return to the menu and turn the output off.


MAX6675 K-Thermocouple

MAX6675 with thermocouple

Measuring temperatures is one of the basics of most process controls.Thermocouples have been used  for a long time.Thermocouples consist of two dissimilar metal wires joined at a hot junction; as temperature changes, a millivolt signal is generated. The most common alloy combinations are known as type J and type K thermocouples.

Type K Temperature Range: Thermocouple grade wire, –454 to 2,300F (–270 to 1260C)

Advantages of thermocouple sensors include: low cost, small size, wider temperature ranges and faster response than RTDs.

The disadvantages of using temperature thermocouples include: they are less linear and accurate than RTDs, a matching extension wire is needed, and thermocouples are sensitive to electrical noise.

To read the millivolt signal and compensate for the non-linearity, we need to use the MAX6675.

The MAX6675 performs cold-junction compensation and digitizes the signal from a type-K thermocouple.The data is output in a 12-bit resolution, SPI-compatible, read-only format.

Arduino library for interfacing with MAX6675 thermocouple amplifier


MAX6675 temperature range 0 to 1023 Celcius

MAX31855 temperature range -200 to 1350 Celcius

Order MAX31855


Arduino 20x4 LCD Module IIC I2C Interface


Here is a quick simple example for hooking up an LCD to an Arduino.

There are lots of LCD options , but $21/2 with I2C attached was too good to pass up !

This specific example uses:

Arduino Uno R3 $16

SunFounder 2004 20x4 LCD Module IIC I2C Interface Adapter Blue Backlight for Raspberry Arduino UNO R3 MEGA2560 $21 per 2

(NOTE: I2C connector module is attached and include with this LCD ! )

The blue potentiometer on the I2C LCD1602 (see the figure below) is used to adjust the backlight  for better display.

Also MEGA compatible with much more memory 256K vs Uno 32K

Video instruction

Electrical Connections: ( 4 wires same for most I2C Adapters )

LCD                      UNO

GND                      Pin GND

VCC                      Pin 5V

SDA                      Pin A4

SCL                      Pin A5


First you need to download the Sunfounder LCD zip at:

Install the zip file into Arduino IDE:

Sketch > Include Library > Add .ZIP Library

Check “includes library” menu after installing.

I2C LCD2004


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.