Skip to content

Code for the Integrated Corrosion Sensor project for CET/CS spring 2023

Notifications You must be signed in to change notification settings

siljanLisitsa/integrated_corrosion_sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Integrated Corrosion Sensor

Final project spring 2023 (Project II) for Computer Engineering Technology and Computing Science at Algonquin College

Notes

Sources

As stated in the code notes in Integrated_Corrosion_Sensor.ino, the following sources were referenced in the making of this sketch: Arduino tutorial Simple Web Server Wifi, Arduino tutorial SHT31 Test, OHMMETER USING ARDUINO by PrinceT1 and How To Write Arduino Sensor Data to a CSV File on a Computer by G. Lambert.

Header file for network

The program requires the user to implement a header file with their network IP address and password into the arduinosecrets.h header file in order to post the sensor data to the webpage. If you would like to run this code, don't forget to put in these strings into the empty arduinosecrets.h file includedin this repository, or make your own.

Programs

This sensor is run using the Arduino IDE, PuTTY (for storing sensor data), and any browser (used to display live sensor readings).


The project

The purpose of the project was to work from a given design to build a sensor to detect corrosion of a material using factors of time, (ambient) humidity, temperature, and resistance (of the material, in ohms). Below are the Arduino and sensors used in this project:

  • Arduino Uno Wifi Rev 2
  • Adafruit SHT31-D Temperature & Humidity Sensor
  • Ohmmeter (made from scratch)

The code

The program is divisible into sections by its separate behaviours which were written to meet client requirements as the design evolved and changed. The program was written to display live sensor data to a webpage, and log sensor data to implement a corrosion index.

Displaying live sensor data

Lines 156 - 204: The program displays live data for Temperature (°C), Humidity (%), and Resistance (Ω) to the client's browser, and refreshes these values every five seconds.

Logging sensor data

Lines 132 - 153: The program converts and stores time (ms), temperature (°C), humidity (%), and resistance (Ω) to a char array (four data points to one line, delimited by a comma). This data is loggable in PuTTY and convertable to a CSV file, from which the data can be read or manipulated as one wishes.


Extra notes and example

Upon running the program for a test (with no ohmmeter hooked up), the data in a PuTTY terminal looks like this:

image

From here the data is loggable, and saved to a CSV file (delimited by commas) for creation of a corrosion index. I made a plot of the data in R in order to visualise the test data for review by my peers on the project.

Rplot

About

Code for the Integrated Corrosion Sensor project for CET/CS spring 2023

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published