Self-defense turret. Uses face detection and recognition to detect intruders and shoot them with a Nerf gun triggered by a servo motor. See this README.
Nerf gun | Fisheye camera |
Base | Servo trigger |
Pin connections as defined on rototron.
make exec PROGRAM=lcd
Enable I2C with sudo raspi-config
and increase the I2C baudrate dtparam=i2c_baudrate=1000000
in /boot/config.txt
.
I also tried to add options i2c_bcm2708 baudrate=1000000
to /etc/modprobe.d/i2c.conf
:
For Nema-17 12V 350mA: red-grey-blank-yellow-green
# Simple demonstration program
make exec PROGRAM=motor
# Manual keyboard controller - should probably execute from a shell on the Pi though
make exec PROGRAM=motor_remote_control
May be a good idea to use a PWM controller to avoid jitter? Meanwhile, connect white to GPIO pin #18 and power/ground.
make exec PROGRAM=servo
I adapted the pin connections from raspberrypi-spy. I used a MCP3008 and a 10K resistor as well and it worked fine.
make exec PROGRAM=flex_sensor
I'm running Raspbian headless. So the selenium driver is installed as a pip dependency along virtual display:
pip install pyvirtualdisplay selenium
Firefox with Aptitude:
sudo apt-get install python-pip iceweasel xvfb
And GeckoDriver by hand and we want a version compatible with IceWeasel. Since currently IceWeasel is ~ Firefox v52, you don't want to install GeckoDriver v0.19 which requires Firefox v55.
wget https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-arm7hf.tar.gz
tar -zxvf geckodriver-v0.16.1-arm7hf.tar.gz
sudo mv geckodriver /usr/local/bin
rm geckodriver-v0.16.1-arm7hf.tar.gz
make exec PROGRAM=browser_driver
make exec PROGRAM=blink
make exec PROGRAM=rgb_led
make exec PROGRAM=vibrator
Follow this pins setup.
make exec PROGRAM=rfid_writer
make exec PROGRAM=rfid_reader
The Pi may crash and restart unless it's got sufficient power. For the Pi3, 2.4A and 5.1V is good.
Card to image:
sudo dd if=/dev/rdisk2 of=raspberry-opencv.dmg bs=1m
Image to card:
diskutil unmountDisk /dev/disk2
sudo newfs_msdos -F 16 /dev/disk2
sudo dd if=raspberry-opencv.dmg of=/dev/rdisk2 bs=1m
Notes:
- Usage of raw disk rdisk2 and block size of 1M to improve copy speed dramatically (10-15x)
- Use Ctrl+T to show progress in the console
Check microphone connection:
lsusb
amixer
Record:
arecord -D plughw:1 --duration=10 -f cd -vv ~/rectest.wav
Play:
aplay ~/rectest.wav
# or
scp -r pi@pi2.local:~/rectest.wav .
open rectest.wav
Take a picture and check it:
raspistill -o ~/cam.jpg
scp -r pi@pi2.local:~/cam.jpg .
open cam.jpg
alsamixer