I have an LDR detecting electricity meter LED flashes (one flash every 1Wh cosumed). The LDR is in a voltage divider set up with a 57K resistor and the mid point goes to an 08M. This set up seems immune to daylight and detects flashes without problem.
Each time the 08M detects a flash it increments a word variable and sends it to a second 08M via a Maplin 433MHz link (as described by Hippy)
The second 08M sends the word variable to the PC serial port via the standard download collector. The data is displayed in Excel via PLX-DAQ (free download).
Analysis consists of checking for missing data by seeing if the word variable has incremented by one. The power in W is then calculated by dividing 3600 by the time interval in secs(derived from the PC clock since the last reading) . This works fine but suffers from the limitation that the time used is in integer seconds only.
I now want to eliminate the PC and instead display the power consumption on an LCD.
That means finding some alternative method to accurately time the pulses. The time between pulses can vary from as little as 0.25 secs to around 50 seconds.
Can the DS1307 be used for this ?
As I understand it from the data sheet the DS1307 gives a standard output in integer seconds but has an output that can be set to give 4096 pulses /sec. That would however mean counting about 200 000 pulses to correspond to the longest period. So I suppose a word variable would need to be incremented and a count kept of the number of overflows.
With only 244 us between pulses it seems a lot to do.
Would an X1 part be more suitable using the timer facility ?
Are there any other simple methods that come to mind ?
Each time the 08M detects a flash it increments a word variable and sends it to a second 08M via a Maplin 433MHz link (as described by Hippy)
The second 08M sends the word variable to the PC serial port via the standard download collector. The data is displayed in Excel via PLX-DAQ (free download).
Analysis consists of checking for missing data by seeing if the word variable has incremented by one. The power in W is then calculated by dividing 3600 by the time interval in secs(derived from the PC clock since the last reading) . This works fine but suffers from the limitation that the time used is in integer seconds only.
I now want to eliminate the PC and instead display the power consumption on an LCD.
That means finding some alternative method to accurately time the pulses. The time between pulses can vary from as little as 0.25 secs to around 50 seconds.
Can the DS1307 be used for this ?
As I understand it from the data sheet the DS1307 gives a standard output in integer seconds but has an output that can be set to give 4096 pulses /sec. That would however mean counting about 200 000 pulses to correspond to the longest period. So I suppose a word variable would need to be incremented and a count kept of the number of overflows.
With only 244 us between pulses it seems a lot to do.
Would an X1 part be more suitable using the timer facility ?
Are there any other simple methods that come to mind ?