How do I connect the terminal to the turret

Be in build mode (and have a wire crafted). Focus the turret and check the options carefully. I can't remember the key for it, but an "attach wire" appears somewhere.

Here is a video on how to do it :).