Final Project Write up
For our final project, Henry and I, made a spy camera with a raspberry pi. We choose to use a raspberry pi zero because it has built in wi-fi.
The first things we had to do was the make a voltage regulator and case for the components. The pi operates at 5 volts over USB but we used 4 AA batteries in a pack. With a linear voltage regulator and two 22uf capacitors we were able to lower the 6 volts to 5. We then soldered in the lines to the VCC pin of the pi as well as the ground pin. The holder was made to secure the board with the voltage regulator under the pi.
To get the camera working, we utilized the built in pi command raspistill. The command is raspistill -o #name_of_file.jpg. We wanted to make sure the file wouldn't be overwritten with each photo so we also implemented a simple bash script that makes a time stamp for the make and appends that to the filename.
The first things we had to do was the make a voltage regulator and case for the components. The pi operates at 5 volts over USB but we used 4 AA batteries in a pack. With a linear voltage regulator and two 22uf capacitors we were able to lower the 6 volts to 5. We then soldered in the lines to the VCC pin of the pi as well as the ground pin. The holder was made to secure the board with the voltage regulator under the pi.
To get the camera working, we utilized the built in pi command raspistill. The command is raspistill -o #name_of_file.jpg. We wanted to make sure the file wouldn't be overwritten with each photo so we also implemented a simple bash script that makes a time stamp for the make and appends that to the filename.
DATE=$(date +"%Y-%m-%d_%H%M"
raspistill -vf -hf -o /home/pi/camera/$DATE.jpg
We had to also use the secure copy command to send the files to another computer on the network. That part of the script was...
scp home/pi/camera/$DATE.jpg TERMINALName@IPAddress:/directory_on_comp
You can find the IP address of the terminal by logging into the pi using the ssh command
ssh pi@IPADDRESS
Then we run the script and a picture is take and sent to the predetermined folder. The only problem we found was that the network at the school didn't allow for transffering files over it's ports. Other than that we were able to take the picture from a computer while the Pi was somewhere else.
Comments
Post a Comment