Protect Your Personal Castle With the Gentleman Maker’s Photon Trebuchet

September 27, 2018 by Robin Mitchell

In this Gentleman Maker project, we will use Particle Photon boards to power a motion-sensing trebuchet that can fend off all your mischievous intruders.

In this Gentleman Maker project, we will use Particle Photon boards to power a motion-sensing trebuchet that can fend off all your mischievous intruders.

In England, there is a common saying that rings especially true for me: “An Englishman’s home is his castle.” Unlike our cousins, home defence is somewhat limited in the UK. Guns are illegal, and even sharp pointy objects are questionable. Strangely enough, it turns out that catapults are not illegal!

In an effort to better protect my home from invaders, in this Gentleman Maker episode, we will build a smart home defence system that uses a trebuchet to take on unwanted visitors!


Trebuchet BOM

The Schematic



You can check out the full Scheme-It schematic for this trebuchet project here.

The Sensor Array

Detecting the presence of intruders can be done using different types of sensors. One method involves the use of ultrasonic range modules that can determine the distance of an object, while another method uses IR detectors to look for changes in IR (such as body heat and reflected sunlight).

For this project, we will take advantage of ultrasonic modules for detecting intruders, but we will add some interest to our detectors! The detectors, based on the Photon, are equipped with 2.4GHz Wi-Fi transceivers and servos—so they can act as scanning rangefinders, which report back their current angle and the current distance measurement to an MQTT server.


Central Control

Central control is a standard PC that runs a Python program, which monitors the incoming sensor data. The screen has a radar output window for each sensor (up to two for this project), and if any readings have gone beyond the trigger range, the software will send the firing command to the trebuchet via MQTT.

The Code

The code for this trebuchet project is fairly straightforward, and some of the pieces for it can be found on Particle's web IDE. You will need to make an account to access these bits, but as I mentioned in the video, there is very nearly nothing to dislike about the Particle Photon.

You can find the trebuchet's trigger code here and you can find the ultrasonic sensor code here. The remaining code for the project is coded in Python and you can download that at the end of this article.

Building the Trebuchet

The trebuchet is a medieval gravity catapult that takes advantage of a counterweight to launch a projectile. Unlike normal catapults, the trebuchet uses a sling instead of a fixed container to hold the ammunition, which improves the range of the trebuchet.

Unlike medieval trebuchets, this one is electronically fired using a simple servo to hold the firing pin. When a firing message is sent from central control, the solenoid is activated, which turns the servo and therefore releases the firing mechanism.

Trebuchets are not the easiest things to aim, so it’s important to place the trebuchet the correct distance from the ultrasonic sensors. Additionally, it would not be unwise to have multiple trebuchets pointed in different directions.



With that, you’re ready to properly defend your home. Just watch out for friendly neighborhood dogs or innocent garden fixtures!



Ready for more Gentleman Maker? Check out the rest of the series here on All About Circuits: