Arduino Projects Revisited Revised

by Lewis Loflin


This series of projects were originally written for the Raspberry Pi and are being ported over to Arduino. The goal of many of my hardware projects is the ability to move across multiple devices with the same general code structure.

WiringPi is a Raspberry Pi library that uses Arduino type commands on the RPi GPIO which makes some programs easy to rewrite. But there are big differences in particular to hardware access and a full Linux based system using ANSI C versus a micorcontroller. In particular I2C differs a lot and I make use of a lot of I2C devices. Here I'm not interested in WiringPi, but note the Raspberry Pi project listing below.

I mostly use a generic Arduino Nano or Leonardo clone. The Arduino was far easier to program and has many functions not listed in the reference. The following devices are explored with debugged and working code is presented:

The I2C based LCD display no longer uses special Arduino libraries other than the Wiring.h library. We learn how the code really works making it easy to port the code over to Microchip PICs or even Python under Raspberry Pi.

Explain the programming and operation of the ADS1115 a 4-channel 16-bot analog-to-digital converter. (This is an I2C device.) I use this to read the output voltage from a TMP37 analog Centigrade temperature sensor and display the sensor voltage and temperature reading on the Arduino serial monitor and the I2C LCD display.

I also read a potentiometer connected to an Arduino analog-to-digital input then write the data to a MCP4725 digital-to-analog converter and measure the output voltage with a voltmeter.

While it's true Arduino has 5-6 ADCs the 10-bit resolution pales next to the 15-bit resolution of the ADS1115. Yes with a capacitor and resistor we can create a crude DAC with Arduino PWM output, but the performance of the MCP4725 is far superior.

For earlier Arduino Projects see Arduino Projects Hobby Projects Tutorials

New for September 2014: Advanced Arduino Solar Panel Charge Controller
Videos: Operation Circuitry Programming More circuitry

My YouTube Videos on Electronics
Introduction to the Arduino Microcontroller
Part 1: Programming Arduino Output
Part 2: Programming Arduino Input
Part 3: Arduino Analog to Digital Conversion
Part 4: Using Arduino Pulse-Width-Modulation
Repost Arduino AC Power Control

See How I got into Electronics

I've had been a part-time adjunct professor at a local community college teaching electricity and electronics. I have 40 years experience in electronics from vacuum tubes to modern solid state and industrial controls. In college I had a year each of physics, chemistry, and biology along with C, C++. Pascal, and assembly.

Hobby electronics today can seldom be separated from micro-controllers and computers. Unlike the vacuum tube and later transistor eras digital logic and computer programming have become dominant. It makes little sense to wire up 100 small parts by hand for say an audio amplifier when a single integrated circuit and a handful of passive components will do the job - at a fraction of the cost. Hardware is cheap.

In the above picture we have the Raspberry Pi a miniature computer similar to what is found in smart phones and tablets and can run Android or Linux - for $35. In this case I use Debian Linux as an operating system which is identical to the Debian used on a home PC except some hardware specific features. I've attached a number of modules to the Raspberry Pi and programmed them in C and Python. Or the Raspberry Pi can be used as a low-end PC, music box control system, etc. Yes it plays MP3s.

I'd say my job title would be applied technologist. See Electronics Projects for Students and Hobbyists