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: 1-wire, aquaponic automation, aquaponics, arduino, arduino sketch, automation, CEA, Controlled Environment Agriculture, DIY aquaponics, DS18B20, electronics, hacks, indoor aquaponics, indoors aquaponics, microcontroller, rik kretzinger, sensor, Temp Probe, Temperature Probe
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.
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”);
}
[…] 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 […]
http://www.wholesalecarsdirect.com/trucks-for-sale/Work-Trucks-For-Sale.htm Thanks for that awesome posting. It saved MUCH time 🙂