| Sinal módulo | Arduino | RPi GPIO (BCM) | Tipo | Notas |
|---|---|---|---|---|
| SIG | D2 | GPIO4 | Digital 1-Wire | Protocolo próprio — ver documentação |
| VCC | 5V | 3.3V | — | |
| GND | GND | GND | — |
Instala a biblioteca DallasTemperature antes de usar.
// Biblioteca: OneWire + DallasTemperature
// Instala em: Sketch → Gerir Bibliotecas
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
OneWire ow(ONE_WIRE_BUS);
DallasTemperature dt(&ow);
void setup(){dt.begin(); Serial.begin(9600);}
void loop(){
dt.requestTemperatures();
Serial.print("Temp: ");
Serial.print(dt.getTempCByIndex(0),1);
Serial.println(" C"); delay(1000);
}