Skip to content
An iOS + Raspberry Pi + Arduino sentry gun.
Swift Python C++ Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Raspberry Pi Server for SwiftUI's example
Raspberry Pi Server


An iOS-powered crowd control machine. Requires an iOS device, a Raspberry Pi and an Arduino.


iOS uses CoreML to detect people's faces. Angles are calculated and sent to a Raspberry Pi via socket connection, which routes the angles to an Arduino which controls the sentry's motors. A button connected to the Raspberry is used to turn the whole thing on and off.


The whole thing is currently just a prototype, with the Arduino only handling a single servo motor that moves in the X axis. I'll update this README as the project progresses.

Things you need to do to run this:

  • Change the socket IP address at the iOS project / Raspberry python file to match your Raspberry's IP
  • Change the USB port at the Raspberry's python file to match your Arduino's
  • Change the pins at the Arduino file to match your actual build (Current: servo at pin 9 and buzzer at pin 11)
  • The Raspberry listens to commands from a Dream Cheeky Big Red Button: . You might want to edit the Raspberry's python file to stop this interaction if you do not want to use this button.

Detailed instructions TODO

Interacting with the Sentry Gun:



  • Arduino: Add an Y axis servo, a trigger-pulling servo, and a Nerf gun
  • iOS/Raspberry: Change socket connection to a bluetooth connection


I borrowed some AVCaptureVideoPreviewLayer code from Thanks!

You can’t perform that action at this time.