I think i had better stick with the capacitor then. For a start ive actually got the capacitor to work with an LED while the resistor only blew up. The capacitor circuit does use a resistor too and the website i got the circuit from says that resistor acts like a kind of fuse. The whole circuit will be inside an IEC plug so yes, it will be a small enclosed space. I was also thinking of putting some kind of glue or silicon stuff over the whole thing but ill decide on that later.
The capacitor i was using costs 9p. If i buy 100 of them then its down to 6.8p. I guess thats not so bad. Its not like i plan to sell thousands of them where every penny counts. I was hoping to have another capacitor anyway to keep the opto on during the zero crossover. Compared to the rest of the circuit 9p is nothing.
Bookmarks