Well, 3x3x3 towers like so:
╔═══╗ <- stone walls
║‼≈‼║ <- charcoal bars supported by charcoal floors
║‼≈‼║ <- entire thing flooded with water as an electrolyte
║‼≈‼║
╚═══╝
seemed sufficient for capacitors.
My resistors will be nickel-silver chains, I may encrust them with gems if I turn out to have enough. (There are bonus points on offer, of course, for making the colors correspond to IRL resistors, but that's a long shot.) All wires will be copper chains, or, if current needs to pass a z-level, a constructed copper block pillar. (Considering swapping the chains out with block walls so the graphics look connected.)
The actual dynamo will be a 3x3x3 block of magnetite mechanisms surrounded by a constructed copper block wall, powered by a perpetual motion machine that spans the entire top of my outdoor farm. Switches are breaks in the string of copper chains filled (or not) by upright copper spikes.
Rails are raising steel block drawbridges, with a retracting steel block drawbridge in between to form a barrel (of which there will be one for each cardinal direction). Projectiles are iron blocks, loaded by hatch from above. Above that will sit a control room with gem windows everywhere and a lever reserved for the King (when he arrives, which I will make sure he does when it's complete).
Finding the metal was an assload and a half of work, lemme tell you. *thanks Armok and the RNG for giving me dolomite on top of slate on top of gabbro*
The only real theoretical problem (aside from the slightly minor detail that electricity hasn't been implemented yet) is that I don't know which direction to point it, as I don't know where the elves and goblins are located...
And I need a name for it, of course.