Peter made an alarm system for our boat before we headed for Indonesia, the one country we visited where we were told that most of the citizens were a bit light fingered. It was a car alarm with a pressure mat sensor placed in the cockpit in front of the companionway. The alarm was loud! It also had a "panic" button so if you heard someone boarding the boat you could set off the alarm yourself. I liked it a lot, but once we were out of Indonesia we didn't use it anymore. we bought the components in Australia, so you should be able to find what you want in an auto store here in the States. Done right, nobody would even notice the pressure pad.
We heard of a fellow who also rigged this type of alarm to set off flashing lights in the cockpit, but I don't know how he did that.
Motion sensors did not work on a few boats that tried them. Light reflecting off the water could set them off, as did birds, bugs, and flapping flags. The battery on the boat would run down from all the false alarms.
I hope this helps.