A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Learning the Arduino – The thermistor circuit.

Block Diagram of the Thermistors.

Block Diagram of the Thermistors.

Way back there in November in a post called “Goals of Calibration of the Thermistor Circuit“, I used the diagram to shown in picture 1 to explain how I intended to linearize and calibrate the thermistors.  I made one almost fatal mistake…I changed my mind.  Seriously, I had intended on using a more expensive system to do the D/A conversion and data acquisition.  Since that time I learned of the Arduino and that is a much much cheaper option.  However, everything has its costs and we will get into all that toward the end of this post.  For now it is best that we talk about what an Arduino is and how to learn it.

The Arduino is based on a integrated circuit called a microcontroller.   A microcontroller is very similar to a microprocessor except it has the memory built in it and some input-output (I/O) devices build in it.  To do all of this, it does not have near as much memory or I/O devices as are available on your desktop computer.   For example, it cannot directly drive a screen or a keyboard or CD drives or hard disks. The list of I/O is relatively small, but large enough to do a lot of things.  Arduino has several models of their microcontrollers.  The one I will be describing is the Arduino Uno which is also the model I recommend to start with.

The Arduino Uno being tested.

The Arduino Uno being tested.

The list of I/O on the Uno is:
14 digital IO pins – these can be programmed to be either an input or an output.  6 of these can be pulse width modulated outputs. (More about what that means later.)   There are 6 Analog input pins.  These are what I am interested in driving with the thermistor board.  These use a 10 bit A/D providing a number from 0 to 1023.   The Arduino can be powered by an external DC source but will work fine being powered by a USB cable as I am doing in the picture.

Any microprocessor is pretty much worthless until it has a program in it.  Whenever you turn on your computer it starts up with a “boot up sequence”.  I understand in the old days this was called boot strapping because the computer was lifting itself up by its bootstraps.  All programs in all computers run on something called machine code.  This is just a bunch of 0’s and 1’s combined in numbers that mean something to the computer.  To make life easier for us humans the next step above machine code is called assembly language.  This is a program that converts special mnemonics  into those numbers for the computer.   That is still a pain for us mere mortals so usually there is a higher level language for regular people to program the microprocessor.   These higher level languages are things like C, C++, Pascal, Python, Basic, etc.  These programs are written into a computer and then it uses a program to compile the language into something the processor can use.

The Arduino comes with its own language and the program to do the conversion is an open source freely down loadable program called the Arduino IDE.   (Sorry about that but tech seems to love abbreviations.  IDE means Integrated Development Environment… the programing program).   All of the booting up of the microcontroller is build right in it, and your program is downloaded via a usb cable into the microcontroller.   The IDE comes with many example programs so you don’t even have to type the programs at the start.  The Arduino IDE program is available for Windows, Mac, and Linux.

Because I have quite a bit of experience with this sort of devices I first just purchased a Uno.  However, very quickly I determined that I could understand things eventually, but I would get there a whole lot quicker if I bought the recommended book called “Getting Started with Arduino”.  If you do not have a usb printer cable laying around, and an experimenter’s board you would be better off to purchase the whole Getting Started Kit.

Now for a few of the negatives.  Because Arduino is an open source project all of the information you want is out there, but often it is in bits and pieces and requires a little searching.  The bright part of that is that it will be the same for any type of project where you are experimenting on your own.  In my professional life I have spent days trying to find answers to questions that seemed to be hidden in lots of doublespeak.  The only other real negative is there are a few words that I found used in an unusual way.  Arduino refers to the program you write as a sketch.  Devices designed to be plugged into the Arduino board are called shields.  I have never heard those two words used that way before, but now that I know, I can live with it.   Now you know too.

Earlier I said I would describe Pulse Width Modulation, PWM.  PWM simply means that an digital output is turned off and on quickly.  In the Arduino a number of 0 to 255 is assigned to an output and this output method is called analog out in this case.  At 0 the output is never turned on, at 255 the output is never turned off, but at a number in between the output is turned on by a percentage.   For example at 128 the output would be on 50% and off 50%.  Because this on off cycle happens very quickly it averages out that the output is 50% on.  This can be used to control the speed of a motor, or to dim a light.

The IO on the Arduino only operates between 0 to 5 V and in the mA range.  To operate devices requiring more power requires an external circuit.   This is the problem I needed to get a good handle on before proceeding with the thermistor circuit.   The specifications say the analog reference voltage can only be 0.3 greater than the internal voltage in the Arduino, Vcc.   Vcc is nominally at 5.0 V.   Since the thermistor circuit was designed to go to 5 V this does not leave a lot of room for error, especially it the thermistor becomes disconnected from the board, and that is very likely.

My answer is to use an internal Analog reference available in the Arduino,  This reference is 1.1 V and if the input is higher than 1.1 the A/D simply hangs at 1023.  I tested it up to 2.5 V input and no smoke!  I will simply run the op-amp circuits into a 10:1 voltage divider and there will be no way I can get above 1.5 Volts output.   This only means minor rescaling of the op-amps and saving all the time to do a redesign.

I have forgot to mention that the Arduino can talk to and listen to your computer while it is running programs because it has serial input and output commands.

In summary,  I recommend the Arduino, but I also recommend the Getting Started book with it.  The Arduino is about $30.00 and the Getting Started book is priced at $14.99.

The Arduino web site is http://www.arduino.cc/  I ordered mine through Jameco Electronics.




Print Friendly

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>