Root Cause Data Collection: Using the Arduino by Paul Bradt & David Bradt

Root Cause Data Collection: Using the Arduino by Paul Bradt & David Bradt

Author:Paul Bradt & David Bradt [Bradt, Paul]
Language: eng
Format: azw3
Published: 2017-10-15T04:00:00+00:00


SN002 code is a slightly modified version from the website above.

__________________________________________________

/*

SN002 The simplest TMP 36 Thermometer

This code is from henrysbench.capnfatz.com

*/

const int analogIn = A0;

int RawValue= 0;

double Voltage = 0;

double tempC = 0;

double tempF = 0;

void setup(){

Serial.begin(9600);

Serial.println("This is SN002 Program by P&D Analytics");

}

void loop(){

RawValue = analogRead(analogIn);

Voltage = (RawValue / 1023.0) * 5000; // 5000 to get millivots.

tempC = (Voltage-500) * 0.1; // 500 is the offset

tempF = (tempC * 1.8) + 32; // convert to F

Serial.print("Raw Value = " ); // shows pre-scaled value

Serial.print(RawValue);

Serial.print("\t milli volts = "); // shows the voltage measured

Serial.print(Voltage,0); //

Serial.print("\t Temperature in C = ");

Serial.print(tempC,1);

Serial.print("\t Temperature in F = ");

Serial.println(tempF,1);

delay(500);

}

__________________________________________________

Getting the system up and running.

The first step is to label the Arduino UNO SN002. The next is to upload the code via the IDE to the Arduino.

The code is made of two primary elements

The first part of the code sets the input values.

The next part of the code captures the data and sends it over the serial port to the computer every half second.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.