Wouter, Thanks for your comments. The ICSP would be required to program the PIC on the HV side. The SMD ICs' are soldered directly onto the PCB and I use a small transition board that enables the Microchip ICD2 to plug in via 5 way 2mm pitch header. This also has a Schotky diode and resistor. Then I would need crystal, caps for decoupling and crystal. An analogue reference for the ADC inputs. A voltage regulator with smoothing caps and suitable dropping resistors to enable current for the PIC and opto coupler. (Assuming I use a TX pin only). Then I need to have bit-bashed code in the main processor to receive the data. (Both UARTS are taken). I would also need a timer in the main micro and interrupt input to detect the start bit (time so that the micro can service the other interrupts without too much disruption). I could use the SPI bus but this would take more hardware interfacing. To be able to probe the side that is reading the 3 x 230 VAC inputs and converting to Digital, I would need an isolating transformer for my scope. So far from this thread, it seems the transformer option would be the simplest solution and offer good isolation at the cost of PCB area, but as Howard mentioned the clearance requirements for isolation prevent the circuitry from being too close anyway. The 22mm x 22mm form factor x 3 will make layout a bit tight, I may need to investigate stacking more PCBs and placing the micro and other logic type circuitry on another board. Then leave all the IO interface devices on the lower PCB near the terminals and bring up the control signals via some DIL headers. Thanks everyone for your input. I appreciate the variety of issues that have been raised. Regards David -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of Wouter van Ooijen Sent: Saturday, 30 July 2005 6:32 PM To: 'Microcontroller discussion list - Public.' Subject: RE: [OT] Circuit for measuring mains voltage > Maybe another micro on the HV side could be added to do the > conversion but > this also needs a PSU, > ICSP for programming and opto isolators. You have a voltage on the HV side, so deriving 5V could be simple if you can afford to dissipate some heat. The PIC would do just measurement and sending the result, I see no real need for ICSP (compare it to an analog solution: you must get that right first time too!). I don't say this is the ideal solution, just compare it to other solutions. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist