Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: **System Monitor**
- - Source Code NOT compiled for: Arduino Uno
- - Source Code created on: 2024-12-06 12:08:17
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* Real Time Remote Monitoring and Automation of */
- /* Distribution Transformer using Arduino uno, GSM, */
- /* AC Current sensor, AC volage sensor, oil level */
- /* sensor, LM35, LCD 20*4 */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- #include <GSM.h> // GSM library for communication
- #include <LiquidCrystal.h> // LCD library for display
- #include "ACCurrentSensor.h" // Library for AC current sensor
- #include "ACVoltageSensor.h" // Library for AC voltage sensor
- #include "OilLevelSensor.h" // Library for oil level sensor
- #include "LM35.h" // Library for LM35 temperature sensor
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- /****** GLOBAL VARIABLES *****/
- GSM gsm; // GSM object
- LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // LCD object with RS, Enable, D0-D3 pins
- ACCurrentSensor currentSensor; // AC current sensor object
- ACVoltageSensor voltageSensor; // AC voltage sensor object
- OilLevelSensor oilSensor; // Oil level sensor object
- LM35 temperatureSensor(A0); // LM35 temperature sensor object on analog pin A0
- void setup(void)
- {
- // Initialize GSM module
- gsm.begin();
- // Initialize LCD
- lcd.begin(20, 4); // 20 columns and 4 rows
- lcd.print("Monitoring System");
- // Initialize sensors
- currentSensor.begin();
- voltageSensor.begin();
- oilSensor.begin();
- }
- void loop(void)
- {
- // Read sensor values
- float current = currentSensor.readCurrent();
- float voltage = voltageSensor.readVoltage();
- float oilLevel = oilSensor.readLevel();
- double temperatureC = temperatureSensor.getTemp();
- // Display values on LCD
- lcd.setCursor(0, 1);
- lcd.print("Current: ");
- lcd.print(current);
- lcd.print(" A");
- lcd.setCursor(0, 2);
- lcd.print("Voltage: ");
- lcd.print(voltage);
- lcd.print(" V");
- lcd.setCursor(0, 3);
- lcd.print("Temp: ");
- lcd.print(temperatureC);
- lcd.print(" C");
- // Add GSM functionality here if needed, e.g., sending alerts
- delay(1000); // Update every second
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement