Sensor not working on Uno wifi rev2. (ds18b20 {Water Temperature sensor})

It used to work on Uno wifi rev2, but now the sensor readings can't be read. And I have experimented between 2 boards (Uno wifi rev 2 {made in italy} and Uno {CH340}) CH340 it works but rev2 doesn't.

#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 3 //INPUT SENSOR
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup(void) {
  Serial.begin(9600);
  Serial.println("ArduinoAll Test Temperature 18B20");
  sensors.begin();
  pinMode(A0, INPUT);
}

void loop(void) {
  sensors.requestTemperatures();
  Serial.print(sensors.getTempCByIndex(0));
  Serial.println(" *C");
  delay(1000);
}

Let's see how you wired this with a schematic and a good photograph.

Do you know which pin will happen to be '3' on the Uno WiFi rev2? I don't. I'd stick with the denominations as provided here:

It used to be successful. But after 4-5 days the sensor reading not work. But another boards is work!

So...

...how about it?

This is going to be very simple: either you provide the information I and others here ask you so that we can possibly help you, or you're not going to get any help. Got it?

GND --> GND
5Vdc --> VCC
DAT --> 3 {D3}

Another pin not use.

Where's your pullup on D3?

Last time I ask it: schematic, good photos. Otherwise I'll leave this for others to jump into.

That's not an Uno Wifi. The yellow wire on an Uno will go to D3, but on an Uno Wifi it will go to D2 / PA0.

I follow from web and test all pin. Last pin for tried is stop on D3.

To prevent any confusion in pin numbers, refer to this:

As recommended by @pert here: Uno vs Uno WiFi Rev 2 pinout difference?

As you can see, pin '3' should link to PF5, which is actually pin #4 (!!) if you count from the top-right corner in your Fritzy picture.

How is the photo of your actual circuit coming along? I'd like to exclude a miscellaneous hardware problem.

to clear up my misunderstandings I have tried all pins. (And don't change the pin in the program) but it still doesn't work.

Ok, I'm done asking for the same information over and over again. Good luck with your project.

If you immersed the sensor in HOT water the shrink tubing seal probably leaked, if water got in, the sensor is probably ruined.

Thank you for your efforts in recommending. Now i solved the problem by using 2 boards for read and send via tx-rx.

Thank.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.