Tags

, ,

On to testing the temperature.

Open Source

I am using the Ladybug Shield Alpha 1 board created from the kicad files located at this GitHub repository. The Arduino Sketch I used during test is located here.

Thanks to Those That Went Before

Adafruit provides great tutorials.  I used their thermistor tutorials for this effort.

Thanks to Gerald Rectenwald for his excellent class notes on thermistors.  They were easy to read and useful.

As always – a huge thank you to Chris Gammell.  His Contextual Electronics and additional guidance has made it possible for me to even attempt this effort.

Testing the Thermistor

As noted in an earlier post,  the pH value will vary depending on the temperature.  The Ladybug Shield includes a thermistor circuit.  I detailed the thermistor circuit in this post.  I really like this circuit because it is a nice example of yet another use for a voltage divider.  Recall from this post:

CalculatingRTherm

The goal is to figure out the resistance of the thermistor – Rt.

Design

The circuit design for the thermistor is very simple.  

 

Thermistor Circuit

I labeled the known resistor (R15) on the schematic to be 1K +/- .5% Ω.  The resistor should be 10K since the thermistor’s rated resistance is 10K.  The 1K is a remnant of when I was using the MCP3901 for the ADC.

The voltage drop – Therm_AIN – is the input to the ADC.

Getting the Temperature

 

The schematic of the ADC shows the thermistor is measured off of channel AIN2 of the ADS1015.

PinsForECOnADCLadybugShieldAlpha1

 

 Arduino Sketch

The goal is to find Rt (the value for the thermistor which is acting as a variable resistor in the voltage divider circuit).  There are two knowns:

  • R – This is R15 in the schematic.  I am using a 10K resistor that is within 1% accuracy.
  • Vs – The V_Clean power.  This comes from the output of the voltage regulator.  While the voltage regulator SHOULD be 5V, I typically get a measurement of 5.06V. This is probably “close enough.”  However, the calculation for the temperature will vary by ~ 3˚ when 5V vs. 5.06V is used.  Ideally, since the ADC has a VREF and does that relative to Vs – I should be able to get Vs from the ADC.  But I can’t figure out a way to do this.  For now, I will use 5.06V for the known Vs.

 Results from Arduino

The sketch I used is located here.  I ran the sketch for awhile.  Output varied by +/- 1˚C.  Here is a typical line of output:

0:00:01 | ADC reading: 2378.00mV | Thermistor reading: 11278.39 ohms | Temperature 22.34 *C | 72.20 *F

From this small test, I have some confidence the thermistor circuit is working correctly.  The voltage reading on my DMM was within 1-2mV of the digital output I received in my Arduino sketch.  The temperature conversion was within 1˚F of a reading I made with a thermometer I had lying around.

What’s Next

It’s time to connect a probe, wrap the waterproof the thermistor and make the connecting cable from the thermistor to the shield long enough to be submersed on a nutrient bath….

Advertisements