Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

28

Found it! sudo nano /boot/config.txt add : dtoverlay=w1-gpio this has to do with kernel update, find more info in this link


9

As it turns out several overlays can be loaded by adding multiple dtoverlay variables: In this case: dtoverlay=4dpi-3x dtoverlay=w1-gpio


5

I don't know about simple but the following works on my Pis. #!/usr/bin/env python # Public Domain import glob import time # Typical reading # 73 01 4b 46 7f ff 0d 10 41 : crc=41 YES # 73 01 4b 46 7f ff 0d 10 41 t=23187 while True: for sensor in glob.glob("/sys/bus/w1/devices/28-00*/w1_slave"): id = sensor.split("/")[5] try: f =...


4

I had a problem like yours and I had to attach the female ends of the jumper wires to the DS18B20 sensor like this: I hope it helps. P.D. Here is a video on how to make headers (Its pretty much the same for male pins) http://www.youtube.com/watch?v=wEPdB-W3-Tc


4

On Raspberry Pi 1 (ignore any errors:) wget https://raw.githubusercontent.com/blogmotion/BitBangingDS18B20/master/configDS18B20.c gcc -o configDS18B20 configDS18B20.c sudo ./configDS18B20 Now type 9,10,11, or 12 to change resolution: 9 bit : 0.5°c 10 bit : 0.25°c 11 bit : 0.125°c 12 bit : 0.0625°c On Raspberry Pi 2 (ignore any errors:) wget https://...


4

I think you've got your connections backwards. You've got the 3.3v power on pin 40, not pin 1. Turn the Pi over and look for the square solder point. That is pin 1. Pin 1 is the pin closest to the PWR led.


4

The DS18B20 is a (Dallas) 1-wire bus device. You can connect multiple 1-wire devices to the same bus. They are differentiated by their unique internal Id. So you can connect additional devices to GPIO4. The Pi (currently) only supports one 1-wire bus. By default that bus is associated with GPIO4. An entry in /boot/config.txt allows you to change the ...


4

I'm starting on this so I apologize if I make a mistake as a rookie. Marteen, I have had the same problem with the sensor and after a lot of searching on the WEB I did not find solution, until I compared the pins of the chip itself (DS18B20) with those of the module KY001. In my case, and I think in yours from what I see in the photos, one mistake was to ...


3

You should not be manually loading the w1-gpio and w1-therm modules. You should now be using the device tree method of configuration. Add the following to /boot/config.txt and reboot. dtoverlay=w1-gpio,gpiopin=x where x is the (Broadcom) GPIO number you want to use for the 1-wire bus. For a description of the GPIOs and the numbering scheme see this ...


3

Added the line: dtoverlay=w1-gpio-pullup,gpiopin=x (where x is my gpio pin) to /boot/config.txt as suggested in the comment.


3

I had the same problem when working on a friend's model-B pi. We tried simply turning on an LED with GPIO 4 as you did and nothing happened. Fortunately, we found a solution here. We ended up having to edit the /boot/config.txt file and added the line at the bottom of it: dtoverlay=w1-gpio,gpiopin=4 Then rebooted, and were able to find the sensor and read ...


3

Add the following lines to /etc/modules w1-gpio w1-therm You'll need root privileges to do so (e.g. sudo vi /etc/modules or sudo nano /etc/modules).


3

This isn't the right answer to my original question, however, it does solve the original problem. There are two reasons why one would want to change the DS18B20 resolution: 1. To read a single device much more quickly than 750ms 2. To read a bunch of devices more frequently than (#devices * 750ms) If you want to do 1, then you're stuck - as far as I can ...


3

Here is the circuit schematic for the sensor: If you look at how the LEDs are connected to the main sensor chip and the power rails I would speculate it is not possible to turn the LEDs off. This is certainly true for the power LED as it is connected directly to the power inputs for the circuit. As for the signal LED I suspect it would also not be possible ...


3

You are now only looking for a single slave device (/sys/bus/w1/devices/28-0316004f1fff/w1_slave), but you ought to also look at the other /sys/bus/w1/devices/28*/w1_slave device. Better try something like: #!/usr/bin/python import sys import glob sensors = glob.glob("/sys/bus/w1/devices/28*/w1_slave") for sensor in sensors: tfile = open(sensor) ...


3

For asynchronous or polling access, the better approach is to serialize your hardware access into a single thread for a given bus. This thread should run at relatively high priority and establish the "time-base" for your application control loop In pseudo-code while(running) write_long_delay_device write_dev1_cmd read_dev1_data write_dev2_cmd ...


2

It's unclear from your picture whether you are using the 5v0 or the 3v3 pin for the power rail of your breadboard. If you are using the 3v3 then it is highly unlikely that you have fried your pin. To move forward with our debugging, let's assume you haven't fried your pin. It looks like you have wired the temperature sensor up correctly with the resistor ...


2

I have 20 of the DS18B20's, ten are the "waterproof" package, and another ten look like a simple transistor. For calibration, I wired them all up on a breadboard together. They were driven with the 3.3v power supply and a 4.7k pullup resistor on the data line (GPIO pin 4) connecting to 3.3v. In this configuration, I could read all 20 using the standard Pi ...


2

I have encountered this, when I jumped from 5 to 15 probes. I have read somewhere that there isn't a real limit and that a scan should detect 70 odd in a first pass. This makes me believe that the modules written for the Raspberry Pi/Debian software has an inbuilt restriction, but I have been unable to find any documentation on that either.


2

It sounds like that you have upgraded to firmware which uses device tree. If you were not using device tree before see Firmware 3.18.x breaks I²C, SPI, audio, lirc, 1-wire (e.g. /dev/i2c-1, No such file or directory) See http://elinux.org/R-Pi_Troubleshooting#GPIO for my method of testing the gpios. With nothing CONNECTED to the gpios it tests that ...


2

A relay (which is what is creating the click sound) is a mechanical device and as a result can wear out. Though the service life is likely in the 100,000's or greater. so you will have to make the decision if this is something you are willing to chance for the perfect brew. When it fails it will kill the power to the heater, likely leaving you with bad bear ...


2

You can not damage the chip this way unless there were other issues (over voltage, static, etc). I would try to swap two chips to see for possible connection issue.


2

fb = open('/home/pi/test2','a+') should do the trick. It opens the file in appending mode for read and write access. Placing the '\n' there is not what you want. Instead simply explicitly append a '\n' each time you want a line break, e.g. fb.write('\n'). For the given example that would look like: dataAsInt = (read_temp()) dataAsString = str(dataAsInt) ...


2

I had the same issue and spend two evenings before finding this link: http://www.reuk.co.uk/DS18B20-Temperature-Sensor-with-Raspberry-Pi.htm It looked like every other howto, but in middle of the text, I found this: NEW 6th May 2015 Update Since the Raspbian operating system was updated back at the end of January 2015 (kernel 3.18.8 and higher) ...


2

If by "internal CPU temp" you mean the sensor built into the pi's SoC, I guess you could get direct access by mmap()ing the right part of the kernel, but since it already exposes an inteface to userspace, that seems a bit silly. Where it's exposed depends on how your kernel is configured (see "Thermal Sensor" at the bottom here), but it is somewhere in /sys ...


2

Sample project is available here: https://github.com/selomkofori/ds18b20_win10iot The DS18B20 is a digital temperature sensor that uses a 1-wire interface which only requires 1 port pin for communication. Unlike other platforms, Windows 10 IoT does not have libraries or micro-second timer resolution needed to read 1-wire devices. This project uses the ...


2

In direct answer to your question, it depends on the size of your breadboard! Looking at what you've got, there is more than enough room for the three sensors you are proposing, although it'd difficult to identify what's connected to what from the photies. A Fritzing diagram might help? There are (if I remember correctly) about 26 GPIO pins on the RPi 2, so ...


2

I'm posting this as it's the answer I got to but all credit is due to the commenter @Joan! /etc/modules empty. /boot/config.txt does not have device_tree=, thus enabling device tree. It does not contain any w1-* lines at all. Result: lsmod shows that neither w1-gpio nor w1-therm are there (nor wire which is usually there when the other two are). After ...


2

Pi4J has released a 1-Wire API in version 1.1. It's no longer a SNAPSHOT version. W1Master master = new W1Master(); List<W1Device> w1Devices = master.getDevices(TmpDS18B20DeviceType.FAMILY_CODE); for (W1Device device : w1Devices) { //this line is enought if you want to read the temperature System.out.println("Temperature: " + ((...


2

There are three minimum things to check here: Which mode is the DS18B20, and whether the connections are done accordingly? If it is a parasitic mode sensor or normal sensor. Typically, the DS18B20 has to be wired as below: (-) ve to GND (+) ve to 3V3 S to GPIO.7 (Pin 7) Configuration. In /boot/config.txt, add dtoverlay=w1-gpio at the end. For this run ...


Only top voted, non community-wiki answers of a minimum length are eligible