Introduction: Room Temperature Gauge With a Servo

A very easy electronic and mechanical project to do is to create a "steampunk" style of temperature gauge from a microservo motor. This project was made to monitor a narrow range of room temperatures, from 66 degrees F to 78 degrees F. It is very easy to extend this temperature range for your own needs.

This project uses a GCMICROMITE which is an easy to use 28 pin microcontroller. No development environment is needed, just a terminal program that connects to a USB to TTL adaptor.

The hardware is simple, and the code is very straight forward.

Step 1: Gather Hardware Materials for the Case

The materials for the wood and brass stand were all items that I had laying around in my small materials collection.

The wood base was 2" by slightly over 4" and a quarter of an inch thick. It matched up well with the brass plate that I had which was also a bit over 4" and 2-1/2" wide. These two pieces, assembled together at right angles to each other, account for the majority of the structure to hold all of the remaining hardware and electronics.

Round felt pads will keep the final assembly from scratching a table surface.

Brass nails provide a steampunk-like look on the brass sheet. They help hold the brass sheet to the wood, although glue is also used.

I found a short but of square brass tubing to use as the needle or, as I like to think of it in this style of design, the gnomon.

A small decorative geer and a thin strip of copper are also used in this design.

If you don't have this laying around, as I did, a good hobby/craft store and a hardware store would be the places to look for these items.

Step 2: Gather Electronic Components

All of the electronics is assembled on a Printed Circuit Board. This board is general purpose "sea of holes" useful for this type of assembly. I obtained this particular board from eBay.

The brains used for this project is the CGMICROMITE chip. The first version of the chip (CGMICROMITE1) was used here, but there is a newer version available, the CGMICROMITE2.

The temperature sensor is a DS18B20 again from eBay. The simplest package to solder is the TO92 package. I happened to have a DS18B20 in an SMT package mounted on a little circuit board, so I used that instead.

The microservo is yet another eBay purchase.

Wires, pin headers, resistors, capacitors, and voltage regulators round out the collection of parts.

Step 3: Create Gauge Graphics

I created the gauge face using SmartDraw. I printed it on paper a few times to get it to print the right size.

Once I was satisfied with the size, I positioned the plain paper printed gauge face onto the brass plate and marked the center position of the gauge face.

I printed the same size gauge face onto parchment paper, cut it out, and added glue to the back.

Step 4: Drill Holes in Brass Sheet

I marked the brass plate for the microservo hole, as well as three holes for the brads.

Using a hammer and a punch, I dented the brass. This divot keeps the drill bit from dancing all over the brass plate.

I drilled the three 1/16" brad holes.

I selected a 9/32" drill bit for the hole for the shaft of the servo. This gave plenty of room for the servo to turn, without touching brass and binding up.

Step 5: Glue Brass Sheet to Wood

I mounted the brass onto the wood base. First I added a thin bead of glue, and then I secured it with the three brass brads.

To make sure that the brass plate was stiffly at a 90 degree angle, I added little stop blocks. They were glued.

When the glue was dry I added the felt feet.

Step 6: Mount Microservo

The microservo is mounted using double-stick foam tape.

The shaft of the microservo should be positioned in the very center of the 9/32" hole.

Step 7: Add Face of Guage

The plastic servo piece is temporarily attached to the microservi shaft to manually force (by rotating) the servo position to one extreme.

The plastic servo piece is then removed and the brass needle/gnomon glued to it.

When cured, the servo is again assembled.

The brass strip it trimmed and bent and a decorative gear is attached to the face with double stick foam tape. That subassembly is then attached to the rest of the temperature gauge.

Step 8: Assemble the Electronics

The manual provides a simple example schematic for a basic GCMICROMITE circuit. To this was added connections to the microservo on pin 4. The three servo connections are ground, 6V, and signal. It is the signal line the the CGMICROMITE drives on pin 4.

A 4.7kohm pull-up was added to pin 2 of the CGMICROMITE. That is the data line for the DS18B20. The DS18B20 also connector to ground and 3.3V.

The TO92 package version of the DS18B20 is the easiest to solder to a PCB, but I happened to have a SMT package DS18B20 on a small pcb that I used.

There is a 3.3V regulator soldered to the back of the PCB to provide a regulated 3.3V from the 6V source voltage.

Step 9: Program the CGMICROMITE

A development editor that works well with the CGMICROMITE is the program called MMEdit. That was used for this project. However a simple terminal set to emulate VT100 at 38400 baud would also work really well. The CGMICROMITE has a built in editor when you type EDIT at the command prompt that it provides.

Using either VT100 or MMEdit requires that you have a serial port that connects to the console connections of the CGMICROMITE at TTL levels. USB to TTL serial parts are pretty common on eBay.

The program that runs this device couldn't be simpler.

DS18B20 START 2

This line starts up the measurement action of the DS18B20 on pin 2

' Move needle around

Servo 1, .55

Pause 1000

These lines move the needle completely to one end of the scale for a second.

SERVO 1, 2.55

Pause 1000

These lines move the needle completely to one end of the scale for a second.

' Loop every second

DO

TEMPERATUREC = DS18B20(2)

At the start of the loop the temperature is measured from the DS18B20 on pin 2.

TEMPERATUREF = 32 + 1.8 * TEMPERATUREC

This converts the values that the temperature sends from C to F.

IF TEMPERATUREF > 78 THEN TEMPERATUREF = 78

IF TEMPERATUREF < 66 THEN TEMPERATUREF = 66

These two lines limit the temperature to 66 to 78 to keep the needle/gnomon on the gauge face.

POSITION = 2.55 - (TEMPERATUREF-66) * .1666

This line converts 66 degrees to 2.55 milliseconds and 78 degrees to .55 milliseconds to position temperature into the range that the microservo can move.

SERVO 1, POSITION

PAUSE 1000

LOOP

The SERVO command actually directs the microservo. After a 1 second pause everything is perpetually repeated.

If you break out of this perpetual loop (^C) and issue the command:

OPTION AUTORUN ON

then this program will run on powerup.

Step 10: Stay Cool, My Friends!

There we go! That is pretty straight forward.

It is 71 at my desk.

You can make any type of gauge like this from a microservo. Since the CGMICROMITE can measure analog voltage, then you can scale an analog voltage to run the servo.

Or use the servo gauge to show a count of something. Since it all just math (programming) the gauge doesn't have to be linear.

Comments

author
SnShines (author)2015-04-16

Wow, nice instructable with detailed pictures. Can't wait to replicate it.

author
jolshefsky (author)2015-04-15

That's cool and I can't decide if it is more complicated than the technology needed to make a a coiled bimetalic strip ... :)

author

Coiled bimetalic certainly is less expensive, but this has a lot of flexibility.