HBT 2015 Big Giveaway - This is it - Final Weekend to Enter!

Huge Supporting Membership Discounts - 20% Off - Final Weekend!

Home Brew Forums > Home Brewing Beer > Automated Brewing Forum > C programming (not arduino) to read DS18B20 one wire (thermistor?)
Reply
 
Thread Tools
Old 02-27-2013, 06:50 AM   #1
KuntzBrewing
Feedback Score: 0 reviews
Recipes 
 
Join Date: Aug 2011
Location: Kokomo, Indiana
Posts: 630
Liked 14 Times on 13 Posts

Default C programming (not arduino) to read DS18B20 one wire (thermistor?)

I thought that this was a simple a2d conversion. Plug in the wire to the chip and read the voltage. Convert the voltage to a temp. I'm using an ATmega328P chip. I've tried google but if your not using the arduino interface then there seems to be no help.
KuntzBrewing is offline
 
Reply With Quote
Old 02-27-2013, 10:26 AM   #2
alien
Feedback Score: 1 reviews
Recipes 
 
Join Date: Apr 2012
Location: Philadelphia, PA
Posts: 1,235
Liked 65 Times on 58 Posts
Likes Given: 61

Default

LM35 is like that (simple output voltage) but not DS18B20. Not trying to be funny, but you could learn that from reading the data sheet, and other things besides. Like which pin is which.

If you don't want to use the Arduino IDE try googling "AVR DS18B20".
alien is offline
 
Reply With Quote
Old 02-28-2013, 12:06 AM   #3
craigmw
Feedback Score: 0 reviews
Recipes 
 
Join Date: Dec 2012
Location: Villa Park, CA
Posts: 204
Liked 19 Times on 15 Posts
Likes Given: 12

Default

No, it operates on the Dallas Semiconductor/Maxim 1-Wire bus, a serial protocol that can allow for multiple sensors and "switches" to share the same bus. You should look up the OneWire.h file to see how the Arduino handles the bus, as you could likely adapt it for your use. It has the advantage of minimizing the number of analog pins needed for temperature sensors. It can also be used to control SSDs, relays, etc. using one of their 1-Wire switches.
craigmw is offline
 
Reply With Quote
Old 02-28-2013, 06:49 AM   #4
KuntzBrewing
Feedback Score: 0 reviews
Recipes 
 
Join Date: Aug 2011
Location: Kokomo, Indiana
Posts: 630
Liked 14 Times on 13 Posts

Default

I read the manual and wrote code. It seems to read degrees C correctly (close enough) although instead of a 4.7K ohm resistor i used a 330ohm or 3.3kohm (i tested it early in the day i forget which it was) but the dsm18b20 in a ceramic cup of ice cold water read .8ish degrees celsius. That makes sense to me. I mean thats around 33-34 degrees F
KuntzBrewing is offline
 
Reply With Quote
Old 02-28-2013, 06:52 AM   #5
KuntzBrewing
Feedback Score: 0 reviews
Recipes 
 
Join Date: Aug 2011
Location: Kokomo, Indiana
Posts: 630
Liked 14 Times on 13 Posts

Default

Luckily ive got a good professor and 8 of us are in a class ( my professor designed every board for Carrier air systems (industrial air conditioners.))
KuntzBrewing is offline
 
Reply With Quote
Old 02-28-2013, 03:57 PM   #6
alien
Feedback Score: 1 reviews
Recipes 
 
Join Date: Apr 2012
Location: Philadelphia, PA
Posts: 1,235
Liked 65 Times on 58 Posts
Likes Given: 61

Default

Sounds like you're away. Iced water is not necessarily 0C, to calibrate properly you should fill the glass with ice and test the water in between the cubes or use ice slush.

3.3K would be fine for the pull-up.
alien is offline
 
Reply With Quote
Old 03-03-2013, 03:25 PM   #7
crane
Feedback Score: 0 reviews
Recipes 
 
Join Date: Sep 2011
Location: San Diego, CA
Posts: 365
Liked 37 Times on 29 Posts
Likes Given: 1

Default

I've found that with thermistors I need to constantly stir them in the ice slush water to get it all the way down to 32f. The very little power they consume will heat up the water around it if you don't keep stirring it. This is probably the same case for the active temp sensors.
crane is offline
 
Reply With Quote
Reply


Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thermocouple vs thermistor? MrRoboto General Beer Discussion 3 01-17-2013 12:59 AM
Connecting a Three wire inline GFCI to a 4 wire Outlet? ODI3 Electric Brewing 3 10-10-2012 03:02 PM
4-wire GFCI 220 volt cable with a 3-wire dryer outlet? gshopper Electric Brewing 12 07-17-2012 11:49 PM
1-Wire DS18B20 Waterproof Temp Sensor thermowell? Homercidal Fermenters 1 01-17-2012 03:22 PM
Arduino + DS18B20 + HD44780 PhattieMcgee Brew Stands 7 01-18-2011 02:11 PM


Forum Jump

Newest Threads

LATEST SPONSOR DEALS