Page 1 of 1

Arduino nano, multiple DS18B20 problem

Posted: Tue Oct 04, 2022 10:42 am
by ule
Hello

Friend of mine wants connect multiple sensors (DS18B20) to arduino nano via 1wire protocol. Each sensor is connected to different pin. If he connect 5 sensors (example: ports PC0 to PC4) everything works fine. If he connect another sensor (PC5), everything stops. He also tried other ports, or some sensors on one port and some to another, but same result. Five sensors works, six doesn't. Because he's not good in english, he ask me to ask here on forum. He also send me two flowcharts. One is ok and one is not.
Any suggestions?

Re: Arduino nano, multiple DS18B20 problem

Posted: Thu Oct 06, 2022 9:48 pm
by viktor_au
Hello Ule

Please read below...

Re: Arduino nano, multiple DS18B20 problem

Posted: Fri Oct 07, 2022 5:22 am
by viktor_au
One more thing...
Your friend has declared 9 values for 8 max sensors:
tempr_0
tempr_1
tempr_2
tempr_3
tempr_4
tempr_5
tempr_6
tempr_7
tempr_8
------------------
should be 0 to 7
-----------------

Re: Arduino nano, multiple DS18B20 problem

Posted: Fri Oct 07, 2022 5:38 am
by viktor_au
I haven't used OneWire devices, so I checked...
Looks like we do need not to use the diff. pins, but only one.
--------------------------------------------------------------------------------------------
Please read:
https://www.matrixtsl.com/wikiv7/index. ... Interface)

Re: Arduino nano, multiple DS18B20 problem

Posted: Fri Oct 07, 2022 8:20 am
by ule
Yes, he know how 1wire works, but he need to read ID of each sensor. If you have 1 sensor on 1port, you don't need ID. If one sensor stop working, you can simply replace with new one.

Re: Arduino nano, multiple DS18B20 problem

Posted: Sat Oct 08, 2022 9:11 pm
by chipfryer27
Hi

I can understand the thinking in having individual devices rather than a string. I don't have Flowcode on this machine to look at his code but from what I've read it is five sensors on whatever port(s) and all is good, but when a sixth is added they all stop working.

Is it always the same module that when added causes issue, or can any of the modules be connected in any order and when a 6th (any of the modules) is added things go wrong?

How is he powering things?

I have a few 1-wire devices kicking around and should have a Nano somewhere too, so once I'm back from my travels I'll see if I can replicate, but that won't be until later next week.

Regards

Re: Arduino nano, multiple DS18B20 problem

Posted: Tue Oct 11, 2022 6:20 am
by ule
"I can understand the thinking in having individual devices rather than a string. I don't have Flowcode on this machine to look at his code but from what I've read it is five sensors on whatever port(s) and all is good, but when a sixth is added they all stop working."

Correct

"Is it always the same module that when added causes issue, or can any of the modules be connected in any order and when a 6th (any of the modules) is added things go wrong?"

He also tried different combinations. Example: 4 sensors on port D and 1 on port B (working). If added one more on port B, stop working. 5 sensors working in any combination, when he added 6th, stop working everything.

"How is he powering things?"

I will ask.

Re: Arduino nano, multiple DS18B20 problem

Posted: Tue Oct 11, 2022 12:18 pm
by ule
Power is from arduino board.

Re: Arduino nano, multiple DS18B20 problem

Posted: Wed Oct 12, 2022 4:18 am
by viktor_au
Hello Ule
Can you ask your friend to 'ping' the bus before
the program will access sensor N6?

Re: Arduino nano, multiple DS18B20 problem

Posted: Wed Oct 12, 2022 11:53 am
by Benj
Hello,

We overhauled one wire device communications for Flowcode v9 both simplifying the macros and adding additional components to drive specific devices. Would it be worth having a go with the 30-day free trial to see if this solves your problems.

V9 example project available here.
https://www.flowcode.co.uk/wiki/index.p ... ronmental)

Re: Arduino nano, multiple DS18B20 problem

Posted: Sun Oct 16, 2022 12:25 pm
by chipfryer27
Hi

The Nano I have was previously used by a "design" undergraduate and to say their soldering skills leave a lot to de desired is putting it politely... Anyway, headers are now attached properly.

Unfortunately my USB lead is elsewhere so testing will need to wait until another day.

My FCv6 license doesn't include Arduino so I won't be able to compile, but I can use FCv9 to see if anything shows up.

Regards

Re: Arduino nano, multiple DS18B20 problem

Posted: Mon Oct 17, 2022 9:25 pm
by ule
Friend tried same program on Arduino Mega2560. Everything works. Even 7 sensors. Is it possible that nano is not capable of reading more than 5 sensors same time? He send me screenshots. When reading 5 sensors works ok, when connect 6th sensor, strange things happens. Something with rs232 maybe?

Re: Arduino nano, multiple DS18B20 problem

Posted: Thu Oct 20, 2022 10:29 pm
by Bachman
This must be some kind of RS232 problem. My hint is buffer overrun problem. For test, put delays between the print commands. Eg:

print temperature 1
delay 250 ms
print temperature 2
delay 250 ms
print temperature 3
delay 250 ms
etc.

250 ms delay must be more than enough, later you can test, what is the minimum, if it's solving the problem. I don't have knowledge about Arduino, don't know how its serial module (not) handling the data.

Re: Arduino nano, multiple DS18B20 problem

Posted: Sat Oct 29, 2022 10:35 pm
by chipfryer27
Hi

I thought I had some DS18B20 sensors but unfortunately not. I do have DHT11's which I connected to D2-D8 on a Nano and made a very basic loop that read each sensor in turn then displayed the readings on a display. I had to use FCv9 as I don't have a Nano licence for FCv6.

All seven sensors responded and I could mix and match in any order by simply unplugging/inserting from the breadboard etc.

I appreciate this isn't quite the same as what your friend is trying to do, but hopefully suggests it is possible. Has he tried a different Nano or swapped port pins to eliminate the possibility of dodgy connections?

If I get the chance I'll fire the results out of the UART and let you know how things go.

Regards

Re: Arduino nano, multiple DS18B20 problem

Posted: Wed Nov 02, 2022 10:39 pm
by ule
He ask me to post this pic. He gets multiple warnings in compiler, but he don't know meaning (me neither).

Re: Arduino nano, multiple DS18B20 problem

Posted: Sun Nov 06, 2022 2:55 pm
by chipfryer27
Hi

Could you post his chart? Easier to try and suggest something if we can see the entire thing.

Incidentally I sent the results of my DHT11 tests out on the UART. I sent each sensor on a separate line without issue.

Regards

Re: Arduino nano, multiple DS18B20 problem

Posted: Sun Nov 06, 2022 4:41 pm
by ule
Charts are posted in first post. One with 5 sensors (Merjenje_temp_zalogovnika_OK)-> (working) and one with 6 sensors (Merjenje_temp_zalogovnika_NE_6T)-> (not working).