Tuesday, August 21, 2012

Use a MakeWire Module to Create an Ad-Hoc Temperature Sensor Module

2012-08-20 22.44.36I recently put out a request to a fellow Gadgeteer enthusiast, Eric Hall (aka ransomhall), to help me out with a simple module that I needed to help make some temporary breadboard modules I have been testing a little more permanent.  Eric responded with a very professionally designed module that I anticipate using to make several projects I have in the works look much more polished and take a lot less space on my desk.

I’ve been experimenting with a DS18B20 temperature sensor that operates through an OneWire protocol.  The only other component necessary to make it work is a 4.7K Ohm pull-up resistor.  Since I want to connect it to my Gadgeteer boards and there does not yet exist a module that serves this purpose, I had to make my own.  So, using a MakeBread module (Eric's version of the Extender module) and the 4.7K Ohm resistor I was up and running in minutes (see above picture).  However, as you can see this is not a very convenient way to keep the module for the long run.

2012-08-20 22.08.19

Another more permanent option would have been to just solder everything directly to the Extender module.  I didn’t want to do this because that would have meant keeping all the solder joints exposed with no good way to protect them.  Since this temperature probe will be mobile, I needed a better solution.

I wanted a module that would serve the same purpose as the Extender module – basically would be a way to connect a few wires to a Gadgeteer socket – but it also had to be slim enough that the solder joints could be protected with shrink wrap.

I spent a few minutes in Paint and made up a sketch.  Hours later, Eric produced an Eagle schematic that could be sent off for PCB production and a few days later the boards were in hand.

MakeWireSchematic

2012-08-20 21.44.17

My Sketch

Schematic

Final Product

2012-08-20 21.50.24Now it was time to try them out.  Since I only had three wires and the one resistor that had to be connected to the MakeWire module, I was able to solder everything directly to the board without any problems.

I started by soldering the ground wire on.  Next, I soldered the 4.7K ohm resistor and the data wire into the same hole at pin #4.

2012-08-20 21.58.19

Next, I soldered the other end of the resistor and the +5V wire both into the 5V hole in the module.  Before soldering, I stripped a small piece of wire insulator off some jumper wire and put it over the wire coming from the resistor.  I did this because I knew I was going to have to fold the resistor down onto the board and I wanted to be sure it didn’t make contact anywhere I didn’t want it to.

2012-08-20 22.03.12

All that was left was to cover it in shrink wrap.

2012-08-20 22.05.27 2012-08-20 22.07.21

Now to hook it up to a Cerberus mainboard and test it out.

GadgeteerConnections

To test the sensor, I used godefroi’s DS18B20 driver with this simple test code to display the measured temperature (in Celsius) to the Debug output window.

   1:  public partial class Program
   2:      {
   3:          private DS18B20 thermometer;
   4:   
   5:          // This method is run when the mainboard is powered up or reset.   
   6:          void ProgramStarted()
   7:          {
   8:             Debug.Print("Program Started");
   9:   
  10:             GT.Socket thermoSocket = GT.Socket.GetSocket(thermoExtender.ExtenderSocketNumber, true, thermoExtender, null);
  11:             thermometer = new DS18B20(thermoSocket.CpuPins[4]);
  12:   
  13:             var thermoTimer = new GT.Timer(1000);
  14:             thermoTimer.Tick += timer => Debug.Print(thermometer.ConvertAndReadTemperature().ToString());
  15:             thermoTimer.Start();
  16:          }
  17:      }

Full source code can be found here:
https://github.com/ianlee74/Gadgeteer/tree/master/DS18B20%20Thermometer%20Test


And here’s the output!


DebugOutput


Eric did a great job with the module and I plan to include it in several more projects that are in the works.  If you have a need for a custom Gadgeteer module, contact Eric or one of the other pros over at the tinyclr.com Gadgeteer forum.

Thanks for reading.

Tuesday, August 14, 2012

Gadgetab – the Gadgeteer Tablet

 

IMG_7943

2012-08-14 00.11.58

This story…

…begins a couple years ago when I started the Omnicopter.  To fly the copter, I needed a remote.  So, I built the Omnimote (right).  It was a Panda-II powered remote that used XBee to communicate with the copter.  It also had a small (slow) FEZ Touch display that was useful for displaying some info but had limited ability as a touch screen due to it being a resistive touch screen and it was just too slow to be depended on for use during flight.

As I’ve built other projects since then, it’s become more and more evident that I have a need for a universal device that can communicate and display information with other projects. 

In the past year, most of my focus has been drawn toward the Gadgeteer platform for electronics prototyping.  It’s a much more flexible and productive platform than anything else that exists at the moment and has dozens of powerful modules (subcircuits) that can be attached to it.  Gadgeteer has become my go-to platform when developing electronics projects.

I’ve been doing quite a bit of Gadgeteer evangelizing the past year by giving presentations at our local .NET users’ group and at conferences.  I’m also starting the Nashville Microcontrollers users’ group.  So, the desire to have a truly portable and compact solution for demoing Gadgeteer in addition to something that is useful for my other projects has become a little more important.

However, one piece has been missing to allow me to build the Gadgetab of my dreams – a large capacitive touch display. GHI Electronics recently solved that problem with the release of their CP7 module – a 7” capacitive touch display.  So, let the building begin!

The design goal was to build a tablet type device that could be useful as a remote, demo device, have some room for storage, be battery powered, and look nice – lots of software & sawdust.

 

The Mounting Plate

2012-08-04 19.38.44It just happened that I’d been talking to Steve Presley, who is starting up a custom CNC & 3D printing service, about building some mounting boards for Gadgeteer projects.  I gave him some dimensions and he went to work.  A few days later, I received a perfectly CNC machined piece of 1/4” blue acrylic in the mail and I went to work building the box that would house it.

 

Constructing the Box

2012-08-04 18.24.19

I started by taking a scrap piece of 3/4” walnut and cut it into three pieces. Two long pieces (9 3/4”) would serve as the top & bottom sides of the box.  A 6” piece was cut for the other two sides of the box.

The 6” piece was resawed using the table saw to produce two thinner pieces for the end sides of the box where the openings would exist. 2012-08-04 18.25.39
2012-08-04 18.45.11 After resawing, the side pieces were ripped into two pieces to allow for the space on the sides where the external connectors would be located.
Next, I used the router table to mill several dados in the pieces where they would fit together. 2012-08-04 21.16.08
2012-08-04 21.14.59 Time for a test fit.  Perfect fit! :)
Let’s glue it up! 2012-08-04 21.39.48
2012-08-05 12.14.07 While the sides were drying, I worked on the top & bottom.  I found a wide piece of 7/8” walnut and cut it to 9 1/2” x 7”.
I then resawed it on the bandsaw to produce two pieces roughly 3/8” thick.  A quick pass on the thickness planer to smooth out the saw marks and ensure they were flat and they’re ready to go. 2012-08-05 12.14.34
2012-08-05 12.21.21 After giving the glue 24 hrs to harden, I took the clamps off and glued up the top & bottom.  Glue was brushed on to ensure 100% coverage of the glued surfaces.  Too much glue is better than two little.  The right amount of glue will produce some squeeze out that will help ensure you have no gaps.
Using some scrap plywood as cauls to help ensure even pressure and to prevent the wood from clamp damage, I then clamped it up.  Lots of pressure is essential here to ensure there’s no gaps and everything stays together. 2012-08-05 12.31.22
2012-08-06 19.34.06 Wait another 24 hours then take off the clamps.  Note all the extra glue on the box.  Also, I forgot to wax my scrap plywood and it glued to the box along the edges.  Not a problem…
Using a hand plane and a card scraper, I removed the extra glue and plywood.  Looking better, huh? 2012-08-06 19.48.18
2012-08-06 20.06.49 Next, I put a 3/8” roundover bit in the router table and rounded over all the edges of the box to make it comfortable to hold in my hands.
Using an orbital sander, I smoothed out any problem areas using 80 grit sandpaper then followed up with 120 grit sandpaper over the entire box.  No reason to smooth it any further at this point.  We’ll save the fine sanding for later. 2012-08-06 20.20.01
2012-08-06 22.06.34 Time to cut a whole for the CP7 display.  Since it’s hard to see pen marks on the dark walnut, I add some green tape to the areas to be cut and then mark out the opening for the display.
Drill some holes in opposite corners big enough to fit a jigsaw into. 2012-08-06 22.09.33
2012-08-06 22.16.16 Cut out the opening using a jigsaw then remove the tape.
Time for a test fit.  NICE! 2012-08-06 22.19.07
2012-08-06 22.29.52 So, you’ve probably been asking yourself… “Self, how’s he going to open that box since it’s glued together?”  Simple, we’re going to cut it in half.  Fortunately, we only have to saw two sides of this box since the other two are already open in the middle.  We line up the saw blade so that it cuts perfectly with the edge of the opening and set the blade height so that it’s just a hair short of cutting all the way though.  We don’t want to cut all the way though or the box will flop around when we cut the other side and will create unwanted damage from the saw blade.  Cut both sides.
Using a hand saw, we’ll carefully cut out the hair thin piece that’s holding the two parts together.  The box will likely pop apart shortly after you begin sawing. 2012-08-06 22.31.13
2012-08-06 22.32.49 Clean up the remaining bits of the thin strip using a box cutter.
Time for a test fit of the mounting plate.  Oh yea! 2012-08-06 23.06.01
2012-08-06 23.07.04 Those joysticks need holes now…
Using a Forstner bit on the drill press, I make quick work of that task. 2012-08-06 23.21.00
2012-08-07 19.35.51 The joystick bases are semi-spherical and need a little more space.  So, using a drum sander attachment on the Dremel tool we make the hole openings concave.
Time to cut the dovetails…  We start by routing a dado where the dovetail sliders will run.  This will remove a lot of the wood and make the actual dovetail slot much easier for the dovetail bit and prevent it from breaking.  We do this in two passes.  Cutting half the height in each pass.  We repeat these steps for all four dovetail slots (two on the top and two on the bottom) 2012-08-07 20.01.38
2012-08-07 20.19.35 And finally, install the 1/2” dovetail bit and cut the slots.
Lookin’ good? image
2012-08-07 21.10.16 Now the tricky part… We have to cut the sliders so that they fit perfectly and don’t allow any slop and make the box appear lose.  We cut some rectangular strips out of hickory (for color contrast) that are exactly the height from top to bottom of the slot and are exactly 1/2” wide.  Keeping the dovetail bit at the same height, we adjust the fence so that it aligns over the bit such that the bottom corner of the bit lines up perfectly with the bottom edge of the hickory strip.  Run each strip across the bit four times to cut the double dovetail slider.
Test fit.  SMOOTH! 2012-08-07 21.42.20
2012-08-07 22.36.38 After sanding the entire box with 220 grit then some 400 grit sandpaper, it’s time to start applying the finish.  I apply one heavy coat of Watco Danish Oil first and let it sit 24 hrs.  Be sure not to leave any standing oil.
After the first coat dries, I lightly sanded the whole thing in 400 grit sandpaper.  Then I repeated this process with four coats of satin wipe-on polyurethane.  Then I attached the CP7 using the double-stick tape that is supplied.  AFTER the CP7 is mounted, apply a coat of paste wax to the box and polish it to a smooth sheen. 2012-08-12 16.36.48

This has been a fun project that yielded a platform that I’m sure you’ll see as an essential of many future projects.  So, stay tuned and keep making!

Special Thanks

Steve Presley – for milling a perfectly fitting acrylic base plate.  If you have any custom CNC or 3D printing needs, contact Steve.

Skewworks – for making the best UI controls available for .NET Micro Framework and letting me try out his new Tinkr controls.

GHI Electronics – for building the best Gadgeteer components and for setting the gold standard in customer support.  They’ve also built the best NETMF/Gadgeteer community on the planet.  Got Gadgeteer questions?  Bring them to tinyclr.com.

Coding4Fun

Microsoft’s Channel 9 Coding 4 Fun site featured this project!