Arduino Nano test circuit.


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 microcontroller. 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:

Arduino I2C LCD connections.

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

Web site Copyright Lewis Loflin, All rights reserved.
If using this material on another site, please provide a link back to my site.