KeyWild Arduino

Public Domain Software

Author: Lewis Balentine

“Engineering is the art of planning and forethought.”

Legal Disclaimer:

The author makes no representation or warranty, either expressed or implied, with respect to the data files and/or software, their quality, accuracy, or fitness for any specific application. Therefore the author shall have no liability to any person or any entity with respect to any liability, loss, or damage caused or alleged to have been caused directly or indirectly by the use of the data files and/or software. This includes, but is not limited to, interruption of service, loss of data, loss of consulting or anticipatory profits or consequential damages from the use of these data files and/or software.


All files unless otherwise noted are the original work product of the author. Unless otherwise noted these files are placed into the Public Domain for the unrestricted use by anyone for any purpose. Placing these files in the public domain shall in no way be construed as an obligation of the author (or his heirs and/or assigns) to maintain the web site, web pages, files, data or software. Further it shall in no way limit the author’s (or his heirs and/or assigns) options to make, produce or use versions of the software, data files, CAD objects or other material posted under the URL  in any other commercial or non-commercial venture.


In the event of a legal dispute the court is requested to use a “reasonable person’s” interpretation of the “clear intent” of this disclaimer.


The use of these data files and/or software constitutes acceptance of this disclaimer.

“No good deed goes unpunished.” ― Oscar Wilde

Arduino Nano Project One: Thermometer:

This all began as I was searching Amazon for a thermometer that would record the day’s highs and low temperature. All the reviews that I read pointed out various problems with the devices from being off by a number of degrees to infantile mortality. As I read those reviews it occurred to me that it would be very advantageous if I could send that temperature to the computer that I have sitting in a closet upstairs. Still that data would have to be accurate to be of any value. Accurate thermometers that can communicate with a computer turn out to be very expensive. Then it occurred to me how hard could it be to build one: a simple microcontroller board, a sensor, some wire and bit of code. An easy and cheap solution …… well not exactly.


This turned out to be a much more challenging and time consuming task that anticipated. Fortunately I started taking notes on day one. The main project document goes through all the steps I went through in starting from scratch. This is written from the viewpoint of “assume nothing” and should be suitable for a complete novice. Hopefully it may provide a path for others to follow (that will be somewhat less expensive than the path(s) followed).


What you end up with is an Arduino microcontroller programed to be a sophisticated thermometer that can report its readings back to a computer via a standard USB connection. These reports may be generated at periodic times from one minute to 24 hours. The device is “user” calibrated and may be programed to report any combination of raw readings, Celsius readings or Fahrenheit readings. The device may be used in a “self-storage mode” where it is run from an alternate power source (battery) and stores from 440 to 7,040 consecutive readings in its internal memory. Both “wear leveling” and “data reduction” are implemented to conserve storage space and extend the life of the internal EEPROM. Over 30 commands have been defined and implemented to allow the connected computer to control the device via a standard terminal program.


Experienced Arduino users will probably what to skip the beginning and start with the section:

     Thermometer Program, Plan “B”.

Download Files:

Project One:

Simple Thermometer

This is the main Project One document for starting from scratch and producing a sophisticated electronic thermometer. The ZIP file contains a PDF document that is about 300 pages. It contain all the source code (fully commented), as well as many examples and illustrations. The basic requirements for this project are:

          Arduino ATMega328 Board, NANO recommended

                     ($10-25 dependent on source)

          LM34 Temperature Sensor

                     ($2.50 from numerous sources)

          Bread Board, 175 Tie points

                     ($5.00 from numerous sources)


Arduino Project One Document: (8 MB)


Arduino Source Code Files (90 KB):

This contains all the source code files for the examples in the document with the exception of the main Thermometer program (see below).


Thermometer One



This section has applications and source code for the Thermometer program. (30 KB)

This is the Arduino C++ source code for the Thermometer One application. There are separate versions for the ATMega328 and ATMega168 MPUs.


PC Application: (840 KB)

This has the PC Application developed in FreeBasic to capture the output from the Arduino device. The file contains a “short” PDF with instructions for using the program and the Arduino. Full source code for the application is included as well.



Thermometer Two



This adaptation of the Thermometer One application supports multiple sensors.

Up to eight remote LM34 sensors may be toggled on/off. See the enclosed PDF files for more detailed description (EEPROM recording mode not supported).

Arduino_Thermometer_Two(1.0.0).zip: (508 KB)

This is the Arduino C++ source code for the Thermometer Two application.




Arduino Receiver

This is a simple generic PC application for logging data from a RS232 serial port. The structure of the program was designed to make it easy to customize for a specific application. This is the basis of the Arduino Thermometer PC application. Fully commented FreeBasic source code is included. This is an updated version that corrects a bug with switch log files at a set number of hours.

Arduino Receiver: (72 KB)



Arduino ElfDump


This archive is a utility program for the Arduino IDE environment that simplifies extracting ASM files.

ELF Dump: (28 KB)



This is a collection of some of the graphics used in the Thermometer One Project document. These files may have somewhat better resolution that the ones imbedded in the PDF document. Also included is the remote sensor version using a 3.5mm Stereo plug.


Arduino Web Links :

Ardunio: Arduino Home Page

Forum: Arduino User Forum

Reference: Arduino Language Reference

Hardware: The official Arduino Boards

Wikipedia: Wikipedia article on the Arduino

Adafruit: Retailer that sales Arduino boards on line

SparkFun: Retailer that sales Arduino boards on line

SainSmart: Retailer that sales Arduino boards on line


Shameless Self Promotion:

KeyWild CAD Library: A collection of DWG files for use with CAD systems. Fasteners, World Map, …

Back Office, Six Mountains: A novel that I wrote