Author Topic: [video tutorial] Digital Thermometer using PIC16F and AD595 (Completed Project)  (Read 6230 times)

mariush

  • Newbie
  • *
  • Posts: 42
A few weeks ago I decided to stop procrastinating and use some of the parts I had around to build a K type thermocouple thermometer, because the IR thermometer I use is only good for 350c and all my other multimeters don't have temperature reading capability.

So I picked up an AD595 that I originally wanted to use to use in a reflow oven controller and paired it with a pic16f1519 and a 4 digit seven segment display and made a tutorial of sorts.. well, 3 videos about it.

I've actually suprised myself when i got stuck with 3+ hours of content, I initially thought it's only going to take 1h at most.  Anyway, I'm probably speaking slower than native English speaking people so that could account for the long videos...  and I wanted to explain some things as best as I could for total beginners (not sure how well that turned out)...

Project page (and download source code location) : http://www.helpedia.com/pages/Designing_and_building_a_digital_thermometer

Part 1  (explaining part selection, how they work together, what "gotchas" to look for, how seven segment displays work etc) :

http://www.youtube.com/watch?v=me1bqCAaraI

Part 2 (building on prototyping board/stripboard, some minor changes, measuring current consumption etc) : https://www.youtube.com/watch?v=Vq3gZNG5loQ
Part 3 (source code explained in detail) : https://www.youtube.com/watch?v=5q9RHUS1HB4


iloveelectronics

  • Full Member
  • ***
  • Posts: 227
This is great stuff! I've only watched a small part of the first video though. It would have been even better if you had made it a bit more concise :)
My eBay store: http://www.99centHobbies.com
Email: franky @ 99centHobbies . com

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 271
Nice project and videos!

I created a similar project using the AD595;  one of the problems I had was noise on the ADC;   now what I found was if you run an average on a bunch of readings that contains noise, your always going to get a jumpy reading.   

This pic shows the actual noise I could see on my scope. (see top trace peaks)


So what I did was took a series of inter-spaced samples, but only calculate the average to display if the delta is below a preset threshold limit;  otherwise just re-sample.

In the picture on channel 2, amongst the ADC noise you might be able to pick out some little dots;  that is actually the intervals at which my ADC was sampling; so only when the dots (ADC) didn't hit noise it accepted that value as good.

[edit]
Some bits I didn't get in your last video was the table lookup code values;  what are they for?



« Last Edit: June 23, 2014, 12:37:33 PM by jucole »
Hey! Frisbee! Far out!

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 271
[edit]
I think your code might be wrong,..... 

[edit]
Sorry, I watched more of your video and you are correct!  I can see your doing the lookup and calc to correct for offset error and the non-linearisation of the T/C 

But if your getting a slight difference it's because the AD595 chip might be at a different temperature than the point at which your thermocouple joins the board;  I think they suggest for the T/C input to be as close to the input pins as possible.  Ideally they want to be at the same temperature.   The other thing I wasn't sure about was that 150 ohm resistor from the AD595 output to ground;  I would have though such a draw would maybe warm the chip creating more of a difference between the input junction and the chip junction.
« Last Edit: June 23, 2014, 12:44:34 PM by jucole »
Hey! Frisbee! Far out!

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 271
This is the one I did;  I moved the T/C input as close as I could to the chip and made the tracks underneath really wide, then blobbed lots of solder onto the tracks.

Hey! Frisbee! Far out!

mariush

  • Newbie
  • *
  • Posts: 42
Thank you for your comments, I appreciate them.

I'm going to post a follow-up video probably next week. 

I'm just waiting for some cheap 2x16 lcd screens from ebay (ordered 10 for 2$ each) because I want to replace the current seven segment display with lcd. The led digits use too much current for a 9v battery at 70mA (for the whole project) and I'm not happy with that. Hopefully with LCD display the current usage will drop below 20mA and then this will also allow me to use a to-92 regulator instead of a to-220 7805.

As long as I do that I plan to add some uart code to output to a serial port the adc readings and the calculated temperature and I'm going to also add temperature conversion using the coefficients for approximate inverse functions for thermocouples ( they're listed at the bottom of the page here: http://srdata.nist.gov/its90/download/type_k.tab ).

I think the coefficients will make the conversion a bit more accurate (results within -0.05 and 0.04) but as there's lots of multiplications that means there's a risk of taking more time to do the conversion (because the pic16f don't have 8x8 hardware multiplication like some pic18f do)

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 271
Thank you for your comments, I appreciate them.

I'm going to post a follow-up video probably next week. 

I'm just waiting for some cheap 2x16 lcd screens from ebay (ordered 10 for 2$ each) because I want to replace the current seven segment display with lcd. The led digits use too much current for a 9v battery at 70mA (for the whole project) and I'm not happy with that. Hopefully with LCD display the current usage will drop below 20mA and then this will also allow me to use a to-92 regulator instead of a to-220 7805.

As long as I do that I plan to add some uart code to output to a serial port the adc readings and the calculated temperature and I'm going to also add temperature conversion using the coefficients for approximate inverse functions for thermocouples ( they're listed at the bottom of the page here: http://srdata.nist.gov/its90/download/type_k.tab ).

I think the coefficients will make the conversion a bit more accurate (results within -0.05 and 0.04) but as there's lots of multiplications that means there's a risk of taking more time to do the conversion (because the pic16f don't have 8x8 hardware multiplication like some pic18f do)

cool! - I look forward to watching that.
Hey! Frisbee! Far out!

mariush

  • Newbie
  • *
  • Posts: 42
If anyone is still interested, I've posted a follow up video on my Youtube channel : 

http://www.youtube.com/watch?v=9hZq0LtX52I

I've fixed the voltage dividers to lower the power consumption, moved to a cheap 2$ ebay lcd for the same reason, put all the parts on a new pcb to fit into a cheap case from Farnell (they just introduced them, semi-transparent plastic, easy to drill into) and added serial logging.


Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 271
Nice video and some great improvements!    the only thing I noticed was the readings jumped around too much for me;  in the console I saw 27.4 to 29.4,  and a 16 in the middle.   have you tried a 0.01uF - 0.1uF between TC input pins?
Hey! Frisbee! Far out!