Setting up 1 Wire Communications

Setting up the Pi with the required configuration

Source: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/ds18b20

Although the DS18B20 just looks like a regular transistor, there is actually quite a lot going on inside. The chip includes the special 1-wire serial interface as well as control logic and the temperature sensor itself. This is generally done on GPIO 4, but can be configured to work on just about any GPIO pins. Its output pin sends digital messages and Raspbian includes an interface to read those messages. With the ATXPiHatZero, the default of GPIO4 is used.

We also have these sensors available in the store with the proper connector for the ATXPiHat.

  • After you backup the memory chip for the PI, (Just do it)
  • It is always good to update the Raspbian image prior to any upgrade. From a terminal prompt;
sudo apt-get update
sudo apt-get dist-upgrade
  • Go ahead and install the Octoprint, ATXPiHat and get all of the prerequisite software installed. For the sensor to be “found” you will need to power up the ATX supply. This is a later step.
  • After completing the installation of all of the software, you will need to startup the raspi-config
sudo raspi-config

Follow these steps;

sensor1

sensor1-1

sensor1-2

sensor1-3

  • Press enter to continue. At this time, it might ask you to reboot the Pi, regardless it is a good idea to do it regardless. If it does not ask to be rebooted, at the command prompt;
sudo reboot now
  • Install the sensor.
  • The ATXPiHat does not provide power to any of the sensors until the ATX Supply has been started. This by design, in an effort to make sure that everything is protected from voltage overages, etc the supply is in an off position while installing the sensor.
  • From the Octoprint user interface go ahead and start up the ATX supply via the drop down on the top of the browser window.
  • After the sensor is plugged in, we need to check to see if the Pi sees the sensor.
cd /sys/bus/w1/devices
ls

sensor1-4

  • After power has been applied, you should see a new folder in the devices folder starting with a “28-“. You are done. It might actually take a up to a minute for the sensor to be found by the Pi and the plugin. Please note, when you power down the ATX supply the sensor will go away from the folder.