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.


2012-08-20 21.44.17

My Sketch


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.


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;
   5:          // This method is run when the mainboard is powered up or reset.   
   6:          void ProgramStarted()
   7:          {
   8:             Debug.Print("Program Started");
  10:             GT.Socket thermoSocket = GT.Socket.GetSocket(thermoExtender.ExtenderSocketNumber, true, thermoExtender, null);
  11:             thermometer = new DS18B20(thermoSocket.CpuPins[4]);
  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:

And here’s the output!


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.


Post a Comment