Hi,
After an absence from these forums of quite some time (about two years, I think), I am almost ready to get back into the workshop and do some tinkering, but I am hoping to obtain some advice before I dig in. Hopefully, this is a relatively simple project (aren't they the ones that always turn out to be the most complicated?)...
I need to detect when a fault occurs on a piece of equipment without interfering with the existing system. When a fault is raised, a red LED flashes on the control panel, and when this happens, I want my picaxe circuit to detect the flashing LED and trigger an alarm, so I am thinking that a fairly simple optical sensor would do the job.
I have a bit of a blank regarding the detection of the flashing LED, but as the normal state for the LED is ON (solid), my first thoughts are that I could simply detect an absence of light from the LED. On a fault, the LED flashes about twice per second, so as long as the picaxe code can check for an absence of light at faster than that frequency (which I am certain it can), then that should do the trick.
However, I really think that I should be able to come up with a more elegant detection routine; something that actually detects flashing over a period (say 30 seconds), just to make sure that it really is a fault. e.g. If the light sensor became detached from the control panel, then there would be a permanent absence of light from the LED, which would not be a fault as such (perhaps this could trigger a different alarm signal). This is where I have drawn a blank! I can't think of the code to detect flashing (of an indeterminate frequency).
The detection of light from the LED should not be a problem; the LED has a panel that closes over it, and there is enough room to mount a small detection device, so it will be in a permanent state of darkness. If it helps, it is not any sort of critical system; it would just be nice to know when a fault occurs as soon as it happens, rather than finding out later. Initially, the alarm will be an audible alert. The next stage would be to add a wireless alert, but as ever, I plan to get the basics working first!
Any suggestions would be appreciated to get my brain working on this one, even if it is just a bit of pseudo-code to get me started.
Thanks in advance,
I
After an absence from these forums of quite some time (about two years, I think), I am almost ready to get back into the workshop and do some tinkering, but I am hoping to obtain some advice before I dig in. Hopefully, this is a relatively simple project (aren't they the ones that always turn out to be the most complicated?)...
I need to detect when a fault occurs on a piece of equipment without interfering with the existing system. When a fault is raised, a red LED flashes on the control panel, and when this happens, I want my picaxe circuit to detect the flashing LED and trigger an alarm, so I am thinking that a fairly simple optical sensor would do the job.
I have a bit of a blank regarding the detection of the flashing LED, but as the normal state for the LED is ON (solid), my first thoughts are that I could simply detect an absence of light from the LED. On a fault, the LED flashes about twice per second, so as long as the picaxe code can check for an absence of light at faster than that frequency (which I am certain it can), then that should do the trick.
However, I really think that I should be able to come up with a more elegant detection routine; something that actually detects flashing over a period (say 30 seconds), just to make sure that it really is a fault. e.g. If the light sensor became detached from the control panel, then there would be a permanent absence of light from the LED, which would not be a fault as such (perhaps this could trigger a different alarm signal). This is where I have drawn a blank! I can't think of the code to detect flashing (of an indeterminate frequency).
The detection of light from the LED should not be a problem; the LED has a panel that closes over it, and there is enough room to mount a small detection device, so it will be in a permanent state of darkness. If it helps, it is not any sort of critical system; it would just be nice to know when a fault occurs as soon as it happens, rather than finding out later. Initially, the alarm will be an audible alert. The next stage would be to add a wireless alert, but as ever, I plan to get the basics working first!
Any suggestions would be appreciated to get my brain working on this one, even if it is just a bit of pseudo-code to get me started.
Thanks in advance,
I