Yes, the last two schematics are what I had in mind. are what I had in mind.
Sorry it took me so long to get back.
Forget about a second transformer and all that. Your existing DC supply will do nicely.
I'm thinking mdorian's cap at the pot is unnecessary, but it can't hurt.
A simple experiment might clear a lot up here. The windings in the AC adapter's transformer are fixed. The windings ratio is something like 25.55:1. So, put 230 in, get approx. 9V out. Put in 220, get 8.61V. Put in 240, get out 9.39V. So, the voltage at the regulator's input, even after rectification and filtering (smoothing) will go up and down with the mains voltage. The regulator's 5V output remains constant, and the divider's output is much lower than the 5V reference, so don't sweat it. The ADC's input is high impedance, and the divider's resistance to the PIC is a couple of K, so don't sweat THAT. If you could get a Variac and run your board off it, you could literally discover what the actual DC voltages will be at your regulator input. Better yet, if you have the divider built and working, you could find the output voltages for THAT compared to the two mains extremes.
If you can't, then you can figure there is a close relationship between the mains voltages and the DC in (and the divider's output) and experiment to come up with the approximate divider voltages for the AC voltage ranges you want to monitor. For now, install one of the dividers as provided by mdorian or kchristie. (thanks, guys, saves me the trouble of cranking up the OrCAD). Set the divider pot for 2.5V. This is the middle of the ADC's input range, which internally is 512 or 513 (200 HEX). Remember, being a 10 bit device means the internal values are 0 to 1023 (3FF HEX). If the mains happen to measure 230V at this time, BINGO, you're right on. The divider's output will be higher then 512 when the mains are 240; it will be less then 512 when the mains are 220. Each of these 1024 steps is 4.88mV each. As can be seen above, the AC adapter's output is 390MV difference between the adapter's 9V at 230V AC and the two outermost mains voltages. So, 390/4.88 is 79, or 4F HEX, which means the outer readings are 79 greater or less than the 512 in the middle (i.e., 1B1 HEX for 220V, 24F for 240). I can't swear this is true after rectification and filtering, though. This is where a Variac would be a real help. Otherwise, you have to just sit there and constantly measure the mains versus the divider's output to get the exact values. No doubt someone here will give us a mathematical way to figure this.
Hope that helped!
kenjj