Use PIC microcontroller for Time application

Click For Summary

Discussion Overview

The discussion revolves around the feasibility of using a PIC microcontroller to create a time-based control system for switching a device, specifically to light up a lamp at a predetermined date and time. The application is intended for use in a company setting for a rotational under frequency relay that requires checking the current date and time to determine which output should be activated.

Discussion Character

  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant inquires about the possibility of using a PIC microcontroller for a time-based switching project, specifying a need for operation on a specific date and time.
  • Another participant suggests using a Real Time Clock (RTC) module that can be interfaced with the PIC microcontroller for accurate timekeeping.
  • Some participants propose that an on-board timer could be utilized to implement a real-time clock, but note that the accuracy would depend on the oscillator's precision.
  • There is mention of using a 32.768 kHz crystal with an RTC, as it simplifies the process of keeping track of time due to its binary properties.

Areas of Agreement / Disagreement

Participants present multiple approaches to implementing timekeeping with a PIC microcontroller, including the use of an RTC module and the on-board timer method. No consensus is reached on the best approach, and the discussion remains open to different methods.

Contextual Notes

Participants express varying levels of confidence in the accuracy of different timekeeping methods, highlighting dependencies on oscillator precision and the choice of components.

sanyad
Messages
2
Reaction score
0
Dear,

I want to make a project to switch-n a device on day-date-time basis i.e. I want to lighup a lamp on 30/08/2008 at 02:00PM .Is it possible to make a circuit for this by using PIC microcontroller.I want to use it in my company for rotational under frequency relay which trips off the output feeder by getting an external input pulse and check for date/time for operation of PIC output i.e. which output should be trip as per current day/time?.


Kindly reply pleaseeeeeeeeeeeeeeeeeeeee...


SANDEEP
INDIA
 
Engineering news on Phys.org
sanyad said:
Dear,

I want to make a project to switch-n a device on day-date-time basis i.e. I want to lighup a lamp on 30/08/2008 at 02:00PM .Is it possible to make a circuit for this by using PIC microcontroller.I want to use it in my company for rotational under frequency relay which trips off the output feeder by getting an external input pulse and check for date/time for operation of PIC output i.e. which output should be trip as per current day/time?.


Kindly reply pleaseeeeeeeeeeeeeeeeeeeee...


SANDEEP
INDIA


The best way to do that is to use a Real Time Clock module that the PIC can read:

http://en.wikipedia.org/wiki/Real_time_clock

Dallas Semiconductor makes RTCs, for example.

.
 
Assuming you're not doing anything else that's really time critical, you can also implement a real-time clock using the on-board timer (note that the accuracy will depend on the accuracy of your oscillator--you won't be able to keep track of time long term if your oscillator is not accurate). See the Microchip documentation (there should be a generic timer section, as well as subsections for each of the usually-dependent timers) for more details, but a decent way of doing it is to trigger an interrupt every (few?) second(s) and have an accumulator somewhere which keeps track of the time.

Random trivia: if you're using a RTC: a 32.768 kHz crystal is usually used because 32,768 is 2^15, which makes (EE) life really simple--assuming you had to keep track of individual pulses yourself.
 
MATLABdude said:
Assuming you're not doing anything else that's really time critical, you can also implement a real-time clock using the on-board timer (note that the accuracy will depend on the accuracy of your oscillator--you won't be able to keep track of time long term if your oscillator is not accurate). See the Microchip documentation (there should be a generic timer section, as well as subsections for each of the usually-dependent timers) for more details, but a decent way of doing it is to trigger an interrupt every (few?) second(s) and have an accumulator somewhere which keeps track of the time.

Random trivia: if you're using a RTC: a 32.768 kHz crystal is usually used because 32,768 is 2^15, which makes (EE) life really simple--assuming you had to keep track of individual pulses yourself.

Thanks
 

Similar threads

Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 13 ·
Replies
13
Views
7K
Replies
4
Views
6K
  • · Replies 30 ·
2
Replies
30
Views
15K
  • · Replies 4 ·
Replies
4
Views
32K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 9 ·
Replies
9
Views
4K