Difference between revisions of "Power Fail Logger by Microrusty"

From media_wiki
Jump to: navigation, search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
  '''www.Microrusty.com'''
+
  '''Version 1.0 Copyright © Microrusty.com 2021 '''   
  '''Copyright 04/12/2021'''   
+
Latest Release : 04/12/2021 <br>
Latest Release: 04/12/2021 <br>
 
 
 
 
Software written By '''Jim Merkle''' and '''Rusty Cain''' <br>
 
Software written By '''Jim Merkle''' and '''Rusty Cain''' <br>
 
Hardware design by '''Rusty Cain''' <br>
 
Hardware design by '''Rusty Cain''' <br>
  
 
     '''Notes:'''                                                           
 
     '''Notes:'''                                                           
   The program only writes to the SD Card when there is a change in the AC Power Status from Power Good to Power Failure to Power Good.       
+
   The program only writes to the SD Card when there is a change in the AC Power Status from Power Good to Power Failure back to Power Good.       
 
   To set the DS3231 RTC You must use another program called : DS3231-Set-Time-Date.ino See link below for How to set.
 
   To set the DS3231 RTC You must use another program called : DS3231-Set-Time-Date.ino See link below for How to set.
   Serial Console Settings: Baud rate '''9600 8''' bit<br>
+
   Serial Console Settings: '''9600 Baud 8 bit.'''
  Optimized for no power at the AC plug Automatic switching to battery on main power loss.
 
 
 
Program creates a file with the filename '''"REBOOTS.TXT"''' that captures each time the system is power cycled.
 
Program creates a file with the filename '''"REBOOTS.TXT"''' that captures each time the system is power cycled.
 
  Example of '''REBOOTS.TXT''' file:  
 
  Example of '''REBOOTS.TXT''' file:  
Line 56: Line 52:
 
   #include <SPI.h>              // SPI Interface that the SD card module will use
 
   #include <SPI.h>              // SPI Interface that the SD card module will use
 
   #include <SD.h>              // for the SD card
 
   #include <SD.h>              // for the SD card
 
+
Download the libraries using the '''Arduino IDE''' refer to: '''Download the Drivers''' in '''Setting Time and Date for the DS3231 RTC'''
 +
  
 
[[File:PowerLogger-Top.PNG |350px|left]]
 
[[File:PowerLogger-Top.PNG |350px|left]]
 
[[File:PowerLogger-Bottom.PNG|350px|mid]]
 
[[File:PowerLogger-Bottom.PNG|350px|mid]]
 +
==[[ Power Fail Logger by Microrusty ]]==
 
==[[Initializing the Microcontroller]]==  
 
==[[Initializing the Microcontroller]]==  
==[[Setting Time and Date for the DS3231 RTC]]==
+
==[[Setting Time and Date for the DS3231 RTC]]==  
 
==[[ Programming Power Fail Logger with Arduino IDE]]==
 
==[[ Programming Power Fail Logger with Arduino IDE]]==
 
+
==[[Installation and use]]==
 
----
 
----
 
==[[ Main Page ]]==
 
==[[ Main Page ]]==

Latest revision as of 21:51, 18 August 2021

Version 1.0 Copyright © Microrusty.com 2021    

Latest Release : 04/12/2021
Software written By Jim Merkle and Rusty Cain
Hardware design by Rusty Cain

   Notes:                                                           
 The program only writes to the SD Card when there is a change in the AC Power Status from Power Good to Power Failure back to Power Good.      
 To set the DS3231 RTC You must use another program called : DS3231-Set-Time-Date.ino See link below for How to set.
 Serial Console Settings:  9600 Baud 8 bit.

Program creates a file with the filename "REBOOTS.TXT" that captures each time the system is power cycled.

Example of REBOOTS.TXT file: 
 System Rebooted Date : 04/10/2021    Time : 14:31:37
 System Rebooted Date : 04/10/2021    Time : 17:02:21
 System Rebooted Date : 04/10/2021    Time : 20:24:53

The program checks the RTC Board and SD Card reader to ensure both devices are working.
Program sends SD Card reader status to console port.
Program sends power status to console port.

Example : 
 Initializing SD card...Setting up logging time
 Power Good
 Data written to file:
 Power Good 
Program also creates a file called DATALOG.TXT that captures the Power status with date & time. 
Example of DATALOG.TXT file: 
 Power Good : Date : 04/10/2021    Time : 17:02:21
 Power Bad  : Date : 04/10/2021    Time : 17:08:36
 Power Good : Date : 04/10/2021    Time : 20:24:53
Features
 Microchip Atmel ATMEGA328P Microcontroller
 16-MHZ Crystal Clock.
 ICSP interface uses USBTiny for programming the Microcontroller
 UART Communication Module (RS232)
 SPI Communication ATmega328P
 I2C Communication Module
 SPI SD Card for data logging power outages
 I2C Real Time Clock with date and time
 Time Stamp provides year, month, day, hours, minutes, seconds 
 Automatic switching to battery on main power loss. 
 Captures Power Failures with time and date stamp written to SD Card.
 Captures Power Restored with time and date stamp written to SD Card.
 Captures system resets with time and date stamp written to SD Card.  
 
 Three time log registers triggered from battery switch-over as well as input driven events.
 Featuring clock output and two independent interrupt signals.
Libraries used:
 #include <Wire.h>             // For I2C Interface SDA SCK
 #include <ds3231.h>           // For the DS3231 RTC library
 #include <SPI.h>              // SPI Interface that the SD card module will use
 #include <SD.h>               // for the SD card
Download the libraries using the Arduino IDE refer to: Download the Drivers in Setting Time and Date for the DS3231 RTC

PowerLogger-Top.PNG

mid

Power Fail Logger by Microrusty

Initializing the Microcontroller

Setting Time and Date for the DS3231 RTC

Programming Power Fail Logger with Arduino IDE

Installation and use


Main Page