jump to navigation

DS18B20 HEX code — move it to the sketch October 27, 2011

Posted by rik94566 in 1-wire, aquaponic automation, aquaponics, arduino, CEA, Controlled Environment Agriculture, DIY aquaponics, DS18B20, HEX code, indoor aquaponics, indoor gardens, indoor growing, One-wire, probe index, sensor, Sensor Hub, Stainless Steel Temp Probe, Temperature Probe.
Tags: , , , , , , , , , , , , , , , , , ,
trackback

Now that I have the HEX code for each temp probe it is time to move it to the working sketch.  I will be pulling the sketch from the one used at the hacktronics site.

http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html

Here is the code I pulled.  I will work through it to make the changes I will need to make it fit my application.

Areas to be changed

Here is how I will change the HEX code part of the sketch:

DeviceAddress P-011 = { 0x28, 0xF4, 0x6B, 0x31, 0x03, 0x00, 0x00, 0xF2 };
DeviceAddress P-012 = { 0x28, 0xD8, 0x79, 0x31, 0x03, 0x00, 0x00, 0xC6 };
//DeviceAddress P-0XX = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };

I will only start by testing out 2 probes

I will make these changes as well:

  // start serial port
Serial.begin(9600);
// Start up the library
sensors.begin();
// set the resolution to 10 bit (good enough?)
sensors.setResolution(P-011, 10);
sensors.setResolution(P-012, 10);
//sensors.setResolution(P-0XX, 10);

and change here also:

Serial.print(“Probe 011 temperature is: “);
printTemperature(P-o11);
Serial.print(“\n\r”);
Serial.print(“Probe 012 temperature is: “);
printTemperature(P-012);
Serial.print(“\n\r”);
// Serial.print(“Probe 0XXtemperature is: “);
//printTemperature(P-0XX);
// Serial.print(“\n\r\n\r”);
}

Advertisements

Comments»

1. DS18B20 HEX code — move it to the sketch « Aquaponic DIY … | Free Aquaponics Tips - October 27, 2011

[…] HEX code, indoor aquaponics, indoor gardens, indoor growing, One-wire, … … Read more: DS18B20 HEX code — move it to the sketch « Aquaponic DIY … ← My Friend Reviews Aquaponics Designs in the Comfort of His Home … Aquatic […]

2. Work Trucks For Sale - November 2, 2011

http://www.wholesalecarsdirect.com/trucks-for-sale/Work-Trucks-For-Sale.htm Thanks for that awesome posting. It saved MUCH time 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: