I want to put some electronics inside of a surfboard. What would be the best way of doing this?
Just cutting a hole, put electronics in and then cover with like foam, epoxy and glass fibre?
Despite what others have said, your not going to want to 'seal' electronics into the board with fiberglass and resin. How would you access it if it breaks down? What you need is to encase the device with a means of access. For instance, a screw in cap with O-ring. The encasement gets glassed into the board with the cap exposed. Think leash cup with a waterproof cap. Any shape would work, but your going to want to make it as shallow as possible or you risk compromising the structural integrity of the board. I highly suggest you contact a local board builder to work with early on in the process. They'll have invaluable suggestions on how to design the enclosure and distribute weight.
You'd install it basically the same way you'd install fin boxes and foot strap inserts (youtube example), surfboards aren't much more than a big block of styrofoam wrapped in fibreglass and resin. Simply put, you need to cut through the fibreglass, and hollow out a spot to put your electronics, and seal it back over with fibreglass and epoxy, then do whatever finishing work is required. How or where you install your electronics however may depend on what it's being used for, and whether it needs to be wired so it can be recharged, or accessible so it can be retrieved. There are shark repellant devices that install on the base of your board behind the fins that interfere with a sharks senses for example that need to be charged before each use, and have a transmitter wire that runs the length of the base of the board:
Anything you install on your board will follow the same basic steps as installing any other insert, but there may be special considerations depending on what you're installing.
For installing batteries to power an electric motor, weight may be an issue, you're going to need to install the batteries in such a way that they are distributed through the board while keeping it balanced. If they are a couple of large batteries that you're putting on a wave board, then I'd install them towards the rear directly under the centre line of the board where you will be standing so the board will still be maneuverable. If you're using multiple smaller batteries on a paddle board, then I'd wire them in a series and probably do two lines, one down either side, this would potentially make the board more stable. Your board size and use will have some influence over where and how you modify it.