Q:

Home-built machine: how to make the 110 V AC electrical installation part "by the book"? (safety, "code")

I am building a machine to manufacture optical components. The source of mechanical power is a 1/4 HP motor that's plugged into 110 V AC. Various parts of the machine receive mechanical power via belts and pulleys. The machine is a large square-ish box made of plywood. Inside it, there's the powerhead module containing the motor, hooked up to the machine via belts.
Grinding / polishing the optical components takes place on top of the machine. The process can be occasionally messy, with water-based slurry droplets being sometimes splashed over the top side.
Here are some images of previous machines made by other folks. The front/right/outside:

The back/inside, with the powerhead module, and the motor almost completely hidden behind the central plate of the powerhead (see the AC cable going to the motor over that plate):

I want to do the 110 V AC part "nice", or "by the book". Near the front/right corner (closest to camera in the first image) I want to add a panel (a small box), jutting out of the big box, containing: the main AC switch, a 16x2 LCD and microcontroller, and perhaps a circuit breaker.
I want the main AC cord to go inside the machine, lay close to the bottom edge back-to-front, then up the front/right edge, come out of the box through a hole, and into the front panel. There, it should go into the main AC switch. From there, it should split in two:
One branch should go into the circuit breaker, then back into the big box through a hole, and then into a regular 110 V AC wall socket mounted inside the big box. The powerhead should plug into that internal 110 V socket, for easy removal (the pulleys on the powerhead need to be adjusted or changed periodically).
The other branch should go into a 5 V "wall wart" supply, and then into the microcontroller connected to the LCD display. All of this branch should stay inside the front panel.
I've done lots of low-voltage electronics design, analog and digital. But I have very limited experience with mains voltage AC, building "to code", etc.
I assume there are some rules to follow when designing the AC part for a machine like this, but what are those rules? In terms of parts and components - should the internal AC wall socket be contained in a box of sorts? Should I run the AC cables inside conduits? (and what kind?)
I assume the rules can't be too different from building a house "to code".

A:

The things to worry about are 1) strain relief; 2) having an appropriately rated and sized fuse or circuit breaker; 3) having a large, easily-operated, within reach of the operator, power on-off switch or other control (http://dx.com/p/ac-220-380v-waterproof-on-off-push-button-switch-167441); 4) making sure everything is properly grounded; and 5) appropriate use of conduit for fire and abrasion protection. Use a C13-style connector mounted on the side of the unit and a standard power cord if the device is portable, or conduit if nonportable. An internal AC receptacle should be enclosed in a standard metal box.
If, as you say, there is water or moisture involved with the operation of the unit then the power source (wall socket) must be equipped with a Ground Fault Circuit Interrupter (GFCI).
Generally you won't have code-compliance issues if you're not manufacturing the units for sale and if your unit looks professional (no sloppy or frayed wiring). For legal advice consult a licensed attorney.
If your unit could injure someone if not shut off immediately (e.g. if a worker's hair or clothing were to become stuck in the mechanism) consider a pull-string or other emergency shutoff mechanism. The string would be connected to a shorting plug the socket for which is wired in series with the mains.

