

Arduino (IoT): RTD PT 100 Sensores Industriales Parte I
Setup:

PT100 (blanco) ——–4/20mA (B)
Resistor A0-Tierra es 237Ω
Codigo:
int sensorValue = 0; int temperature = 0; int ReceivedByte = 0; float f1 = 0; float t1 = 0; void setup() { Serial.begin(9600); Serial.println("hi..."); } void loop() { delay(1000); sensorValue = analogRead(A2); //Serial.println(sensorValue); /** current voltage(250 Ohm) ADC Temperature ----------------------------------------------------- 4 mA 1 V 205 -50 C 20 mA 5 V 1023 +150 C **/ // map the signals (multiplied by 10 // to get decimal values, because map() doesn't work with floats) temperature=map(sensorValue,205,1023,-500,1500); f1 = temperature; // Float conversion t1 = f1/10.0; // dividing by 10 // with one decimal value // Printing temperature value over serial port Serial.print(t1); Serial.print("\n");
Resultados :
