Problem: DS18B20 no longer working, interfering with serial?

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
A.Harrenberg
Posts: 201
Joined: 05 Sep 2016 22:27

Problem: DS18B20 no longer working, interfering with serial?

Post by A.Harrenberg »

Hi,

I have a wierd problem with my DS18B20 sensor(s) not working any more.

I have build a sketch with multiple sensors for testing, a DHT11, an analog luminance sensor, a BMP180 and an OLED connected via I2C, an analogue PIR and a DS18B20.

Everything was working fine until I discovered that I have resolution problems with the BMP180 sensor. To debug this I changed my breadboard and the sketch very often, now the problem with the BMP180 is solved, but then I recognized that my DS18B20 was no longer working, reporting -327 C which ist the default temperature in case of a failed communication.

While debugging the sketch I also used my logic analyzer and could see that there are still a reset and a "presence confirmation" on the bus, but not more data is transmitted. So I assumend that the sensor was somehow killed during my testing and ordered a new on. But the same applies to the new sensor. In the meantime I also checked with my 2nd Z-Uno and the example sketch from the website, but it is still not working...

I see some strange things here:
- Communication like reading the serial number from the sensor with scanalonesensor() is working only once after a power-up reset, using the reset-button does not work. Reading the temperature results in reading all temperature bits as "high"
- after that, all communication is broken and only the reset/presence show up on the bus.

I tried this with 2 different sensor (the old one and a new one), I tried it on 2 Z-Unos, I tried different pins on the 2nd Z-Uno, the result is always the same... During the debugging for the BMP180 i accidently overwrite a library for the Z-Uno and could not re-install it, so I de-installed the arduino and performed a clean install of 2.06 again.

The old installation was a 0.67, using the pre-release 2.06 and then upgraded to the official 2.06 (on a Win10 installation).
I use the sensor with 3.3V powered from pin 4 and have a 4k7 as a pullup on the data signal.
I have also applied the longer delay time in the ZUNO_OneWire lib but that does not change anything.
The sensor are the water-proof version with ~ 1m cable attached.

I can only assume that the timing might be an issue here, but I can't understand why my old sketch is not running any more, and also the original example from the website does not work.

One additional thing is that the Z-Uno is not detected properly when I plug it to my computer. To have the serial USB-communication I have to push the reset-button, but I can't really remember if that was also the case when the sketch/sensor worked...

Any hints what I can check / change further to get it running again?

Best regards,
Andreas.
Last edited by A.Harrenberg on 29 Oct 2016 18:30, edited 1 time in total.
fhem.de - ZWave development support
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: Problem: DS18B20 no longer working

Post by michap »

Hi,
A.Harrenberg wrote:I use the sensor with 3.3V powered from pin 4 and have a 4k7 as a pullup on the data signal.
Maybe this is the problem - have you tried to power it direct from 3.3V?
18B20 need min. 3.0V http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf

Can you attach your sketch - then I can try to reproduce it.
(please describe the connections too, or schematics/fritzing)

Michael
A.Harrenberg
Posts: 201
Joined: 05 Sep 2016 22:27

Re: Problem: DS18B20 no longer working

Post by A.Harrenberg »

Hi michap,

do you mean using an external power supply? I have just checked, I have indeed just 3.04V coming from pin 4... I will see if I have an externl 3.3V power supply here...

I am just using the sketch from the website https://z-uno.z-wave.me/examples/1-wire ... re-sensor/. The only difference is that I power the sensor from 3.3V as I do not want to put a divider to the output.

Regards,
Andreas
fhem.de - ZWave development support
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: Problem: DS18B20 no longer working

Post by michap »

A.Harrenberg wrote:o you mean using an external power supply?
Sorry, I really thought about a "digital pin" - but digital pin 4 would not work (by default) ;)
So forget about this, sorry.

My 18B20 is still working...

Michael
A.Harrenberg
Posts: 201
Joined: 05 Sep 2016 22:27

Re: Problem: DS18B20 no longer working

Post by A.Harrenberg »

Hi michap,

it seems that my answer was lost, it is not showing up, so here again...

With pin 4 i meant the "physical" pin 4 where 3.3V is, not the digital input 4, sorry for not beeing more precise.

In the meantime I tried it with an external power supply at 3.31V -> no change, re-installed arduino -> no change, tried a third sensor -> no change, tried putting 5V to sensor with a divider in the data signal -> no change...

At the moment there isn't even the communication after power reset ;-(

Do you have the possibility to test at a second computer where you newly install arduino?

How is you sensor connected, 3.3V or 5V? Are you using the water-proof sensor with the long wire or the one in "transitor package"?

Can you provide your sketch so that I can try it here?

I am running out of ideas at the moment ,-(

Thanks,
Andreas.
fhem.de - ZWave development support
A.Harrenberg
Posts: 201
Joined: 05 Sep 2016 22:27

Re: Problem: DS18B20 no longer working

Post by A.Harrenberg »

Hi,

some more strange things...

When I now plug the Z-Uno to my computer and DON'T reset it, the DS18B20 is working, the temperature is displayed on the OLED, but the board is not detected by Windows (the german error message in the device manager says something like "unknown USB-device, error requesting device information"). When i perform a reset with the button, the sensor is no longer working!

I I just power the device from an USB charger, the sensor works after power up AND is still working after a reset!

So it seems to be connected to the serial debugging!?! :?:

Is it possible that using the serial debugging some interrupts are are ongoing on the "lower" level that disturb the timing here? I am just using serial monitor over the USB, not an extra user defined serial.

@Michap: Do you use serial debugging code in your sketch? If not, can you try to put serial.begin() in the setup() and add some serial.println() in the loop() and see if you can reproduce they behavior from my setup?

Thanks,
Andreas.
fhem.de - ZWave development support
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: Problem: DS18B20 no longer working

Post by michap »

Hi,

I just finished the setup on second PC ;)

- Windows10
- installed Arduino 1.6.5 rc5 (latest download of this version)
- added URL in Board manager, loaded Z-Uno firmware 2.06

Plugged in Z-Uno, windows driver wee installed (yes, after "Reset" - but this is an "old issue")

Used the sample sketch from website - without changing any library.

Using 3.3V fom Z-Uno (pin4 ;) ) and 4.7kOhm pull-up.
Tried 18B20 ("transitor" like device) - is working
Tried waterproof sensor - is working
At serial debug (USB) temperature and address will be shown.

closed serial window, plugged off Z-Uno, plugged on again.
-> USB recognition error
-> reset
-> open serial monior, all is working again

So - no idea what is going wrong at your installation :(

Have you removed all libs and temp files from your arduino installation - maybe here was something "mixed"?
Or have you also tried at second PC?

I send you via PM my Skype account - if you use it, maybebe we can discuss it here...

Michael
A.Harrenberg
Posts: 201
Joined: 05 Sep 2016 22:27

Re: Problem: DS18B20 no longer working, interfering with ser

Post by A.Harrenberg »

Hi Michap,

thanks for your fast reply and help,

yeah, I don't now what is going on... I need to leave now, but I expect I can test again with my laptop tomorrow.

Thanks,
Andreas.
fhem.de - ZWave development support
A.Harrenberg
Posts: 201
Joined: 05 Sep 2016 22:27

Re: Problem: DS18B20 no longer working, interfering with ser

Post by A.Harrenberg »

Hi,

so I tested it now with my laptop and the computer of my wife. On the laptop the Arduino-SW is installed, on the computer of my wife there is no Arduino present.

On all three computers (including my computer) the behavior is the same. The device is not recognized at plug-in, the DS18B20 is working until a reset is performed. After that the serial communication is running but the sensor is no longer working... All three computers are running Windows10 Professionel.

At my computer I installed the USB-driver, so the device is shown as UZB, on my laptop I did not install this driver, the device is shown there as Z-Uno... and on the computer of my wife no driver is installed at all...

When re-installing I manually removed the dircetory .../AppData/Roaming/Arduino15, so there should be no left-over from the previous installation.

I will try to de-install the USB-drivers and install them again, but as this also happen at the computer of my wife where nothing is installed I don't believe that this will have any impact.

Any more ideas?

Thanks,
Andreas.
fhem.de - ZWave development support
A.Harrenberg
Posts: 201
Joined: 05 Sep 2016 22:27

Re: Problem: DS18B20 no longer working, interfering with ser

Post by A.Harrenberg »

Hi,

the problem is also existing without any serial debug communication. As soon as I pressure reset and the device is recognized by my Windows-System the sensor stop working.

Regards,
Andreas.
fhem.de - ZWave development support
Post Reply