Friday, May 11, 2012

Fun with Thermsitors!

For all of you interested in how to interface a Thermistor with an Arduino, you have come to the right place!

Truthfully, this is not a new topic, nor is it Rocket Science, but for any beginners out there wanting to learn about the Secret Life of Thermistors. this post will hopefully help.

The word "Thermistor" is a portmanteau of "Thermal" and "Resistor," and as it's name suggests, it is a resistor who's resistance changes with temperature.  Now, the truth of the matter is that all conductors are thermistors, because resistance is a function of temperature, to varying degrees and directions depending on the materials making up the conductor.

A Thermistor, however, is commonly understood to be a device where such temperature effects are deliberately exaggerated, easily observable, and optimized for specific applications.  Depending on the material formulation of it's body, Its resistance can be made to change either positively (increasing resistance with increasing temperature) or negatively (decreasing resistance with increasing temperature), known as PTC or NTC types, respectively.

Thermistors have the advantage of being inexpensive and rugged, but suffer from a highly non-linear change in resistance with temperature.  In other words, there is not a one-to-one relationship between temperature and resistance changes.  This is a manageable problem in most applications, and this project explains the implications.

Here is a typical Thermistor used for temperature measurement (The very one used in this project, in fact!)

Rather than repeating all the details here, I will direct you instead to the place where the project lives:

For those of you unfamiliar with Git Hub, it is an on-line repository for projects, providing storage, as well as a mechanism for several people to collaborate on the same project. 

To examine or download this project, click the link above, and look at the README file.  To download everything, click the Download link.  You will be able to download an archive of everything you need, including a schematic, code example and supporting documents.

Have fun!

Sunday, December 11, 2011

How do you remember your Resistor Color Codes? Let's create a contest!

Hi, everyone-
I have had the idea of revisiting the durable (and very un-PC) mnemonic for remembering the Resistor Color Code.  Many of us old-timers remember the one we all learned, and it was a perfectly fine mnemonic device (if you were a 14 year old boy back in the 1950's.)  I'm not going to post it here, because it is not suitable for polite company.
Considering that the demographic of electronic hobbyists has changed quite a bit since then, I think it's time for something a little more modern, and so I would like to start the process of designing a contest- one that will present you with a challenge to come up with a better way to remember the code.  For those of you unfamiliar, the basic code consists of 10 different colors, assigned a value of 0 through 9, as follows:

0 - Black
1 - Brown
2- Red
3 - Orange
4 - Yellow
5 - Green
6 - Blue
7 - Violet
8 - Gray
9 - White

Additionally, there are three more colors that are used either as multipliers or tolerance values, appearing in this order:


A complete explanation can be found here:

Some rules we can use:
1.  Build a phrase of words, where each word starts with the first letter of each color, in numerical order.
2. Be original
3. Be civilized
4. Since the letters "B" and "G" appear twice, extra consideration will be given to those who find a way to eliminate the ambiguity, and prevent the colors from getting mixed-up.
5. Extra credit for a coherent sentence.
6. Extra credit for clever humor.
7. Super-duper credit for anyone who can incorporate "Gold" Silver" and "None"

First Prize: Unending Fame and Fortune
Second Prize: Finite Fame and Fortune
Third Prize: Warm Fuzzies.

If we get lucky, maybe a few vendors will want to sponser the contest by donating some cool prizes!

Check back often as this challenge develops.

Remember- this is only a solicitation to help develop the contest, not the contest itself- that will come later, so please do not send in your mnemonics now, OK?

Check back often as this idea develops!

Send in your ideas via comments.  I'll come up with another contact means, soon.

Tuesday, October 25, 2011

The 7400 Logic Electronic Etch-a-Sketch!

Yay!  This placed in the 2nd Place Category of the 2011 Dangerous Prototypes Open 7400 Logic Competition! 

Thanks to all the judges, participants and readers who made this all possible.  There were many interesting, creative and just plain fun entries submitted by people all over the world, making this a most exciting event!

Especially deserving of extra-special thanks, of course, is my DW, who endured the long hours of my absence and general obliviousness to everything else while I was building this!

Yay!  IT WORKS!!

Unfortunately, my first attempt at the electronic Etch-a-Sketch didn't work in time for the contest.  A number of personal matters left me with too little time to build, troubleshoot and refine the design in time for the deadline.  I probably got to within 98% of the task, but that elusive last 2% scuttled the project. 

Oh well... Them's the breaks!

If you want to know more details about the design and operation of this thing, check the prior post.

Hat Tip to the nice folks at Adafruit Industries, supplier of the beautiful 8x8 Dual-Color LED Matrices and sturdy Rotary Encoders for the X, Y and Page knobs!

So, anyway- this is what it looks like in action:

This isn't the greatest video quality, and there are still a few refinements I want to make to the circuit, but at least here is proof that it does, in fact, work! 
Please check back as I make this gadget perform some new tricks and shoot some better video.

Here is the slightly newer design!

Display and Controls Board - This one works!

Logic Board.  This one works!

Thursday, October 20, 2011

Dangerous Prototypes 7400 Logic Contest Entry

Electronic Realization of Etch-A-Sketch Toy with 32-Page Flip-Pad

Kvetch-A-Sketch, Overview

Dangerous Prototypes TTL Logic Contest
“Electronic “Kvetch-A-Sketch with 32-Page Flip Pad”
Submitted by Eastern Star Geek, Johnson City, Tennessee USA

Yay!  This placed in the 2nd Place Category!  Thanks to all the judges, participants and readers who made this all possible.  There were many interesting, creative and just plain fun entries submitted by people all over the world, making this a most exciting event!

Especially deserving of extra-special thanks, of course, is my DW, who endured the long hours of my absence and general obliviousness to everything else while I was building this!

Some more stuff on this project appears in my next Blog entry:

This project is an electronic realization of the famous Ohio Arts “Etch-A-Sketch” toy, with a twist.  Like the original, two rotary knobs are used to move a cursor horizontally and vertically, respectively, but unlike the original, a third knob selects one of 32 different sketch pages.  Simple flip-pad animations can therefore be created by twirling the page knob rapidly. 

The screen is built from four 8x8 dual-color LED matrix displays, for a total screen area of 16x16 pixels.  The artist has a palette of three colors from which to choose- Red, Green and Yellow. 
The three rotary knobs are quadrature encoders with a built-in pushbutton.
Several toggle switches and pushbuttons give the artist the ability to:
1.     Draw dots, either continuously, or one at a time, using the built-in pushbutton in the X knob.
2.     Erase dots, either continuously, or one at a time, using the built-in pushbutton in the Y knob.
3.     Choose the color of the dot(s) to be drawn or erased
4.     Choose between Edit and Playback modes (Cursor is turned off in Playback)
5.     Clear the current page
6.     Go to the “Home Page” using the built-in pushbutton in the Page knob.

Theory of Operation:

1.     Memory Organization:
The system uses an 8-bit data bus, and each line requires 4 bytes of data to be displayed:
Byte 0:              Red Dots, 0-7
Byte 1:              Red Dots, 8-15
Byte 2:              Green Dots, 0-7
Byte 3:              Green Dots, 8-15
The data in each byte represent the four “segments” within a line.

Screen data is stored in a 2Kx8 non-volatile RAM (Dallas DS1220 type), which is addressed as follows:
A0:                   Red/Green
A1:                   Low Segment/High Segment
A2-A5               Line Address (0-15)      
A6-A10             Page Address (0 -31)
The memory was chosen for it’s non-volatility achieved with an on-board Lithium cell, which allows an infinite number of write cycles.
2.     LED Screen Data Management and Addressing: 
The LED screen is made from four Betlux BL-M12A883DUG-11 Dual-Color 8x8 Matrix Displays.  These are Row-Cathode, Column Anode types with one red and green LED per pixel.  They are connected as a row/column matrix for a total of 256 pixels.  Each line segment is driven by ‘HC574 8-bit latch, which drive the columns directly.  The latch signals to each segment come from ½ of a 1-of-8 selector which decodes A0 and A1.  The selector is gated by the Timing Generator, as well.  Each group of 8 Rows are driven with a ULN2803 octal darlington arrays, which are in turn driven by a ‘HC238 1-of-8 selector which decodes A2-A5 of the address bus.
3.     Rotary Encoder Signal Processing and Decoding:
Each rotary encoder consists of two switch contacts with a common wiper for quadrature channels A and B, as well as a third contact that closes momentarily when the knob is pressed.  When the knob is rotated, pulses are generated on the A and B channels at an equivalent frequency proportional to the speed of rotation, but displaced in phase by 90 electrical degrees.  The direction of rotation can be determined by which channel leads the other.
First, the quadrature channels of each encoder are de-bounced with a Motorola MC14490 6-channel debouncer chip.  Then, for each encoder, one section of a 74HC74 D-Flip-flop decodes the direction.  The other half of the ’74 divides the frequency by two to make the encoder less sensitive and make the direction signal not coincident with the pulse signal.  When all is said and done, each encoder will result in a Pulse and a Direction signal, which will be used by binary UP/DOWN counters to generate the cursor positions and page addresses.
4.     Cursor Generation:
The cursor appears as a blinking dot in the currently selected color.  Two 4-bit binary up/down counters are used for the X and Y motions.  The X counter drives a 1-of-8 selector that places the cursor in a horizontal line.  The Y counter binary value is compared to the current line address, and when they are coincident, the cursor is allowed to be displayed.  A simple 2Hz oscillator creates the blink effect, which must be temporarily muted when data is being written to the memory. 

5.     Cursor and Line Data Integration:
The cursor and screen line data must be combined in such a way as to allow dots to be written or erased, and the cursor to always blink, regardless of the state of the current pixel at the cursor location.  Two 74LS181 4-Bit Arithmetic Logic Units (ALUs) are used to generate the necessary bitwise logic operations between the current line segment and the cursor data as follows:

Show Cursor     (F = A XOR B)               0110
Store Hole        (F = A AND /B)              0111
Store Dot          (F = A OR B)                 1110
Hide Cursor       (F = A)                          1111
Erase Page       (F = 0)                          0011

“A” represents line segment data, “B” represents the Cursor data, and “F” represents the result, which is displayed on the screen, and/or well as written to memory.
6.     Timing:
Line segment and line addresses are continuously generated by a master counter chain, with, each address, A0 – A5 representing individual line segments.  A master oscillator drives a chain of three flip-flops, each of which divides the signal by 2.  The divider chain output hen drives a pair of 4-bit binary counters.  With the addition of a handful of gates, the full compliment of timing signals, in addition to segment addresses, are generated. 

Display and Control Board, Wiring Side View
Logic Board, Chip Side
Logic Board, Wiring Side

Logic Board Schematic

Schematic Diagram, Display and Control Panel

This project is from an original idea by the author, and was designed and created from whole cloth especially for this contest.

Thursday, September 15, 2011

Calling all Gadgeteers!

Have you built a project using any of the ideas posted in this blog?
I'd like to showcase what you've done.  I am most interested in projects that have used creative and innovative adaptations of my ideas- especially if they have improved upon the originals!

This blog is all about sharing.  Hope to hear from you, so please post a comment or leave me the means to contact you.

Thursday, September 1, 2011

ASCII to Seven-Segment table

With all the fun we have been having with Seven-Segment displays, lately, I decided to create a semi-automated ASCII to Seven Segment table using MS Excel (yeah, yeah... I know!)
You still have to enter the patterns yourself, but the Hex value and a handy string for inclusion in your lookup table are generated automatically.

You can use this chart to display more than just numerals, although some ASCII characters just cannot be rendered in seven segments, and some might be a bit of a stretch, but do with it what you will.

(Note:  This chart will have to be modified slightly if you want to use it with the Vane Display example in an earlier blog-post, because the segments a-g are mapped to bits 1-7, instead of the more conventional 0-6.  You can change the chart, or wire the circuits differently. Your choice)

If you want to make your own spreadsheet, here are the formulae used in the different columns:

Note: In the image below, the first cell containing data (32) is Cell B5

Cell B5:               No formula.  Just input the ASCII code
Cell C5:               =DEC2HEX(B5)
Cell D5:               =CHAR(B5)       (Note- sometimes I substitute text)
Cells E5 to L5:     No formula, enter a "1" for segment ON, and a "0" for segment off
Cell M5:              =BIN2HEX(VALUE(5&F5&G5&H5&I5&J5&K5&L5),2)
Cell N5:              ="0x"&M5&",  // "&D5&IF(HEX2DEC(M5)=0," (npr)","")  (Note- you can cut and paste the result directly into your IDE when you build your lookup table)

Have fun!

Adafruit Industries: A happy Customer Service story!

Dear Readers:

I have purchased from adafruit industries numerous times since the end of last year, and I am happy to say that it has always been a very satisfying experience. 

Recently, however, there were a series of unfortunate glitches with an order.
While I don't expect anyone, including my vendors, to be perfect,  I do expect them to fix  problems quickly, professionally and equitably.

I am happy to report that adafruit industries understands and practices these principles of Excellent Customer Service!  So friends, help support them.  They are thorough, nice, professional folks to deal with, and their heart is in the right place.  May it always be so.
(Brava, Lady Ada!)