Skip to topic
|
Skip to bottom
"Wealth without money..."
Jump:
RepRap Home
What can it make?
One page description
Future Plans
Main Blog
Documentation
Make your own RepRap
Using your RepRap
Videos / Movies
RepStrap machines
Community
Get a RepRap Kit
User Forums
Builder's Wiki
Builder's Blog
RepRap auf Deutsch
RepRap en espaņol
RepRap in italiano
RepRap IRC Channel
RepRap Twitter
Object Library
Thingiverse
The People
World RepRap map
Related Sites
Background
Press
Philosophy
Acknowledgments
T-shirts, mugs etc.
GPL Licence
Privacy Policy
Main Web
Changes
Changes detailed
Topic list
Search
login
Edit
Attach
Printable
Main.Temperature_Sensor_1_0
r1.13 - 20 Apr 2008 - 18:58 -
ZachSmith
topic end
Start of topic |
Skip to actions
---+ This has been superseded by [[Temperature_Sensor_1_1][Temperature Sensor v1.1]] If you have the old version, it still works great! No need to upgrade. The new version is 100% compatible, but has minor incremental upgrades that make it better. If you don't have a board yet, it is recommended to use the latest version. ---+ Temperature Sensor v1.0 %TOC% ---++ Overview <a href="http://www.flickr.com/photos/hoeken/2086793417/in/set-72157603378626595/"><img src="http://farm3.static.flickr.com/2293/2086793417_6707394772.jpg?v=0" align="right"></a> * *You'll need a [[SolderingToolKit][soldering toolkit]] to do most of this.* * *Read our [[ElectronicsFabricationGuide][Electronics Fabrication Guide]] if you're new.* ---+++ Get It! ---++++ Raw Components * [[http://store.rrrf.org/product_info.php?products_id=58][Buy this PCB from the RRRF]] * [[http://parts.reprap.org/part/module/Temperature+Sensor+v1.0][Buy the components with ease w/ parts.reprap.org]] <br clear="all"/> ---++ Files You can [[http://downloads.sourceforge.net/reprap/reprap-temperature-sensor-1.0.zip?use_mirror=osdn][download the electronics files from Sourceforge]]. This file contains the following: * GERBER files for getting it manufactured * PDF files of the schematic, copper layers, and silkscreen * Eagle source files for modification * 3D rendered image as well as POVRay scene file * exerciser code to test your board. ---++ Interface | *Pin* | *Function* | | +5 | This is the pin to supply +5 volts on. | | S | This is the signal pin. It will output a voltage between 0 and 5 volts that correlates with the temperature. | | G | This is the ground pin. | ---+++ Signal Values The thermistor circuit is a voltage divider that can be read with an ADC such as the one on an Arduino board. That value can then be run through a formula to get the temperature in degrees. This circuit has been [[http://hydraraptor.blogspot.com/2007/10/measuring-temperature-easy-way.html][documented in full detail in a blog entry by nophead]]. ---+++ Thermistor Values You can use a variety of thermistors with your temperature sensor. [[Thermistor][Read more on them here.]] ---++ Build It ---+++ Board Bugs (listed by version) ---++++ v1.0 * No bugs yet, please report any you find to the [[http://forums.reprap.org][forums]]. ---+++ Printed Circuit Board <a href="http://www.flickr.com/photos/hoeken/2089334296/in/set-72157603378626595/"><img src="http://farm3.static.flickr.com/2396/2089334296_afaaf1c6c4.jpg?v=0"></a> You can either [[http://store.rrrf.org/product_info.php?products_id=58][buy this PCB]] from the RepRap Research Foundation, or you can make your own. The image above shows the professionally manufactured PCB ready for soldering. Its also cheap, only $0.50 USD. <br clear="both"/> ---+++ Components <a href="http://www.flickr.com/photos/hoeken/2086793099/in/set-72157603378626595/"><img src="http://farm3.static.flickr.com/2332/2086793099_d0af1a6294.jpg?v=0"/></a> <iframe width='500' height='330' frameborder='0' src='http://spreadsheets.google.com/pub?key=pmEMxYRcQzzATwbOb71BmGA&output=html&gid=26&single=true&widget=true'></iframe> ---++++ Soldering Instructions <a href="http://www.flickr.com/photos/hoeken/2087577858/in/set-72157603378626595/"><img src="http://farm3.static.flickr.com/2127/2087577858_a18e4f74bf.jpg?v=0" align="right"></a> *R1* You can insert the resistor in any orientation. Pay attention to the color bands. <br clear="all"/> <a href="http://www.flickr.com/photos/hoeken/2087577928/in/set-72157603378626595/"><img src="http://farm3.static.flickr.com/2331/2087577928_cedb03b3f5.jpg?v=0" align="right"></a> *R2* You can insert the resistor in any orientation. Pay attention to the color bands. <br clear="all"/> <a href="http://www.flickr.com/photos/hoeken/2087577958/in/set-72157603378626595/"><img src="http://farm3.static.flickr.com/2333/2087577958_c1b2315d9e.jpg?v=0" align="right"></a> *C1* Electrolytic capacitors have a polarity. Make sure the stripe on yours matches the one in the picture. <br clear="all"/> <a href="http://www.flickr.com/photos/hoeken/2087578020/in/set-72157603378626595/"><img src="http://farm3.static.flickr.com/2415/2087578020_23d0610b52.jpg?v=0" align="right"></a> *X1* Make sure you insert the connector correctly: with the tab facing the inside of the board. <br clear="all"/> <a href="http://www.flickr.com/photos/hoeken/2087578070/in/set-72157603378626595/"><img src="http://farm3.static.flickr.com/2389/2087578070_0f3f22bf83.jpg?v=0" align="right"></a> *Wires* Trim 1/4" from the end of each wire. Insert that wire into the hole in the pad and solder the correct wire to the correct pad using the table below: | *Pad* | *Color* | | +5 | Green | | S | White/Brown | | G | Brown | <br clear="all"/> ---++ Test It Now that you have your temperature sensor tested, you'll want to test it. ---+++ Wire it up! The wiring is very simple: 1. Wire 5 to +5v on the Arduino 1. G to GND on the Arduino 1. S to Analog 0 on the Arduino you're done! ---+++ Upload firmware to Arduino Create a new sketch and copy/paste the code below into it. Upload it to your Arduino. The code below is for the standard RRRF 10K thermistor that comes from Mouser. If you use a different thermistor, or are using different resistors in the board, we have a [[http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py][python script]] that you can run to generate new values in the lookup table, or you can grab a pre-calculated table from the [[Thermistor][thermistor]] page. <verbatim> #define THERMISTOR_PIN 0 #define NUMTEMPS 22 short temptable[NUMTEMPS][2] = { // { adc , temp } { 1 , 608 } , { 60 , 176 } , { 70 , 166 } , { 80 , 157 } , { 90 , 150 } , { 100 , 143 } , { 110 , 137 } , { 120 , 131 } , { 130 , 125 } , { 140 , 120 } , { 150 , 115 } , { 160 , 110 } , { 170 , 105 } , { 180 , 100 } , { 190 , 95 } , { 200 , 91 } , { 210 , 86 } , { 220 , 81 } , { 230 , 75 } , { 240 , 70 } , { 250 , 64 } , { 300 , 4 } }; void setup() { Serial.begin(9600); Serial.println("Starting temperature exerciser."); } void loop() { int rawvalue = analogRead(THERMISTOR_PIN); int celsius = read_temp(); int fahrenheit = (((celsius * 9) / 5) + 32); Serial.print("Current temp: "); Serial.print(celsius); Serial.print("C / "); Serial.print(fahrenheit); Serial.println("F"); Serial.print("Raw value: "); Serial.println(rawvalue); Serial.println(" "); delay(1000); } int read_temp() { int rawtemp = analogRead(THERMISTOR_PIN); int current_celsius = 0; byte i; for (i=1; i<NUMTEMPS; i++) { if (temptable[i][0] > rawtemp) { int realtemp = temptable[i-1][1] + (rawtemp - temptable[i-1][0]) * (temptable[i][1] - temptable[i-1][1]) / (temptable[i][0] - temptable[i-1][0]); if (realtemp > 255) realtemp = 255; current_celsius = realtemp; break; } } // Overflow: We just clamp to 0 degrees celsius if (i == NUMTEMPS) current_celsius = 0; return current_celsius; } </verbatim> ---+++ Try it out Start up your Arduino, and open the serial monitor. The exerciser code reads the thermistor every 2 seconds and outputs the current value of the thermistor, as well as the estimated temp. The thermistor code is only accurate at higher temperatures, so get some sort of heat going. I recommend a heat gun, but a lighter will also work in a pinch. Heat it up, and watch the terminal. The most important thing to check is that it is actually changing with temperature and is relatively accurate. If so, then you've successfully built your temperature sensor. Congratulations!
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
More topic actions
Revisions: | r1.13 |
>
|
r1.12
|
>
|
r1.11
|
Total page history
|
Backlinks
|
Refresh
You are here:
Main
>
Temperature_Sensor_1_0
to top
Copyright © 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding
RepRap
?
Send feedback