Raspberry Pi GPS Dashcam

My main project is a Raspberry Pi GPS Dashcam which uses a raspberry camera module and gps webcam in order to record the surroundings as well as allow the user to know where they are located.

Engineer

Jeremy W.

Area of Interest

Electrical Computer Engineering

Mechanical Engineering

School

Monta Vista High School

Grade

Incoming Senior

 Bill of Materials

Reflection

Overall, I would say my experience at bluestamp was good. During this time, I was able to experience some things I wouldn’t have been able to experience anywhere else. In addition, the setbacks that I ran into were great learning experiences that helped me gain more troubleshooting skills. However, I do believe that it could have been better. I wish I had chosen a project that was more hands-on because the majority of my current project was software work and I really enjoyed the small hands-on portion of the project.

Final Milestone

Hi, my name is Jeremy and I am a rising senior at Monta Vista High school. For my third milestone, I got the usb webcam to record a timelapse with a text overlay that shows data that the gps receives. To get this to function to work I wrote a python program and in this program, I run a loop to store the gps data and each it runs through the loop, I would take an image. These images would then have gps data overlaid on them and then they would be saved into a folder. After the data get overlaid onto all of the images, I then would string the images together at five frames per second in order to create the timelapse.

During this milestone, I had one major setback which was trying do dynamic text overlay. I wanted to do a dynamic style in order to broadcast live data over

video, however there was no real way to do dynamic text overlay as there was only static versions options available. Therefore, I decided to change my video to a timelapse which would allow me to still have live data as I would just overlay gps data onto each image before stringing them together. 

For my modifications, I want to have a case or box that would fit all of the necessary part for the dashcam to work as well as have a button to turn on the dashcam to start recording and turn off the dashcam to stop recording.

Here is the code that I wrote to record a timelapse.

Second Milestone

For my second milestone, I was able to get the usb webcam to record videos as well as get the gps to obtain data. To record videos using the usb webcam, I used a software called ffmpeg which handles videos, audio and streams. This software would use the camera that is connected to the raspberry pi at the moment and record videos at 25 frames per second. And this is the video that the camera recorded just now. In addition, to the video I could get data like the latitude, longitude, speed, and time from the gps. The gps works by getting a fix from a nearby satellite which would then feed the gps all of the information.  

One problem I had when doing this milestone, was getting the webcam to record. My original milestone was to get the raspberry camera module and the

USB webcam to record at the same time, however the ffmpeg would only record with one camera and it would always choose the raspberry camera module. This would prevent the webcam from working which is why I decided to change my milestone to getting the webcam to record and obtain the gps data.

For my final milestone, I want to be able to overlay the gps data onto the video that will get recorded and after I get that to work, I will then focus on getting the two cameras to work at the same time.

First Milestone

For my first milestone, I got the raspberry camera module to capture still pictures as well as record videos. In order to get these functions to work, on the raspberry pi, I created two programs using the python. The first program is used to take a still photo. In this program, I called a function to present a live image of what the raspberry camera module sees onto the screen. Then, a time action is called in order to give the user time to get ready before the photo is taken. Then the still photo will be taken after the set time has passed. After the photo is taken, a function is called to stop the preview of the live image on the screen. The second program was coded to record ten second videos. In this program, I set up the configurations of the video and then I call for the live image to be shown on the screen. This is then immediately 

followed with a start recording function to record everything the raspberry camera module sees. The time functions is then called to give the user ten seconds. After ten seconds, the stop recording function is called to end the video and stop preview function to stop the live image on the screen.

During this milestone, I ran into a couple of problems. One of the problems I had was setting up the raspberry pi as there were a lot of cables that I didn’t have. I had to constantly ask for wires that I thought were necessary for raspberry pi. Then, I was unable to connect it to my computer because there were no adaptors were able to connect to the ports my computer had. In order to fix this, I changed my computer to a monitor which had the ports that were needed. In addition, I figured out that cables like the ethernet cable were unnecessary to get the raspberry pi to function.

Another problem I had was creating new names for the new photos and videos that are getting taken. At first, the names would not change so the new images and videos wouldn’t save since the names would have already been used. In order to fix this problem, I coded in the program to count the number of files in the folder and increase the number after the name to always have a new name. This gave me the chance to learn about os module which is something that allows the user to interface with the operating system that Python is running on.

For my next milestone, I will connect the usb webcam to the raspberry pi and get it to function with the raspberry camera module.

Here is the code for taking a still picture and recording a video.

RGB Night Light

RGB Night Light Wiring

schematic

The RGB Night light is a circuit that powers a RGB LED light which turns on when it detects that it is dark. It also allows the user to choose the night light color from magenta, blue, cyan, green, yellow, orange, and red.

This RGD Night Light, which is powered by 5 volts, has a photoresistor, a potentiometer, three 330 Ω resistor, a 10k Ω resistor, twelve jumper wires, and a RGB LED light. The photoresistor is a resistor that uses light wavelengths to determine its resistance in the circuit. This allows, the night light to know when it’s dark which prompts it to turn on. The circuit also has a potentiometer which is a manual adjustable resistor. This allows the user to change its resistance which ultimately changes the voltage of the circuit. This then changes the night light color as it is programmed to change the color of the RGB LED light based off that resistance. The resistors in this circuit help control the amount of current that flows towards the RGB night light and the RGB LED light is a light that uses red, green and blue values to determine the color of the light.  

During this starter project, I had a problem in the beginning when I was unable to find any 330 ohm resistors. In order to solve this problem, on the supplies tables, I found resistors that did not have their resistance labeled. This allowed me to learn about the colors that are on the resistors and what they represent. By learning what the colors represent,  I was able to find the 330 ohm resistors and make the project work.

Here is an example of my code.

STEM Summer Camps Coding & Robotics Classes For Kids San Francisco Coding & Robotics Classes For Kids New York Coding & Robotics Classes For Kids Denver Coding & Robotics Classes For Kids Palo Alto STEM Summer Camps For Kids in New York STEM Summer Camps For Kids in Palo Alto STEM Summer Camps For Kids San Francisco STEM Classes For Kids in New York STEM Classes For Kids in Palo Alto STEM Classes For Kids in San Francisco Code Classes For Kids Code Classes For Kids in New York Code Classes For Kids in Palo Alto Code Classes For Kids in San Francisco STEM Summer Camps For Kids

Leave a Comment

Start typing and press Enter to search