Well, life is still not on a good keel. I picked up at Fry's a proto shield, and some optocouplers. So the world keeps spinning and I am using a software-controlled power-supply
I don't have a formal sketch but this is what it will do:
Code ? |
---|
setup () { int relay[] = { pin2, pin3, pin4 }; int sscr[] = { pin5, pin6, pin7}; int lamps[] = { pin8, pin9, pin10, pin11 }; int TRUE = 1; int ON = 1; int OFF = 0; delay(30000); int part; for ( part = 0; part < 3; part++ ) { relay[part] = ON; } lamps[3] = ON; // CPU IS UP}
loop () { for ( part = 0; part < 3; part++ ) { if( Vmax() == TRUE ) { sscr[part] = ON; delay(10000); relay[part] = OFF; lamps[part] = ON;}} idel(); return; }
void idel() { // just keep awake; do { delay(60000); // this is a sixty second sleep for ever while (TRUE); }}
int Vmax() {} // have to check on the code still. |
When the unit is turned on, by depressing the power switch in, that powers up the auxiliary power which provides 12vdc, 9vdc, and 24vdc via voltage doubler.
- The Arduino will come up and wait for about 5 seconds (to stabilize power)
- The Arduino will turn on relays 1 through 3 to apply to a resistive load to the toroids.
- The Arduino will loop through each toroid by using a counter in a for loop.
- The Arduino looks at AC voltage input (analog) and waits for max voltage when it sees the start of the drop
- The SSCR is now turned on.
- The Arduino waits 5-10 seconds
- The Arduino releases the bypass relay.
- The Arduino lights a status lamp
Fins But Not Done
I have a problem deriving Vmax AC with an analog input anybody out there knows how? Using a digital pin an optoisolator will not work as I get very small pulses at z-cross. So I have to do it the hard way. I, guess I will use a wall wart taken apart, as I don't need the case or plugs. and I will use a small resistor to limit voltage and current to about 4 volts ac and apply it to an analog pin.