Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I did not connected it yet, I am only thinking how to do it
Have you considered powering the coil of a 5Vdc relay directly from the transformer/rectifier ?
When the rectified 5Vdc is present the 5V relay is energized and its off when the 220V/5V fails.
I don not have scope now. I have changed 5V relay with 12V and I have the same problem (with 12V relay and voltage from the grid, I have 1,2 V on relay in off state.If the LED is lighting at all then the pic pin must be going high for a short period. The 0.5V you are seeing is the average voltage, can you use a scope to look at it? Also, the lack of decoupling capacitors and powering the relay through the 7805 could be causing a continual reset. Can you power the relay from the 12V supply?
/* Project name:
Detect low voltage
* Description:
When voltage is detected LED blinks
* Test configuration:
MCU: PIC12F629
Dev.Board: EasyPIC4
Oscillator: 04.0000 MHz, Internal
SW: mikroC PRO for PIC
*/
unsigned char i;
bit oldstate; // Old state flag
void main() {
OSCCAL = 0b11111101; // calibrate internal osilator 4 MHz
CMCON = 0b00000100; // CIN- analog, Internal VRef
TRISIO = 0b00000010; // gp2 = output
VRCON = 0b10101111; // sets Vref
gpio.F2 = 0;
do {
if (CMCON.COUT == 1)
{
gpio.F2 = 1;
}
else
{
gpio.F2 = 0;
}
} while(1);
}
just a quick one - did you disable the comparator?