![]() |
|
Paul Briedé Jr |
|
MISCELLANEOUS |
Interface GPS module with BS2 for data logging
| Background |
| To be able to use the basic stamp to gather GPS waypoints, there are some connections and programming that is needed. This tutorial will go over what equipment is needed, what devices need to be connected, as well as what code to use to program the stamp. By the end of this tutorial you will be able to connect all equipment to the aircraft, run the stamp, fly the aircraft, and then download the data points to your computer to gather the flight path of the R/C plane. |
|
|
|
This picture shows the Magpie AP with the stamp and Garmin GPS |
| The article that accompanies this tutorial can be found at http://www.parallax.com/dl/docs/article/rambal-gps.pdf |
| Parts List |
| Magpie AP |
| 1 Basic Stamp |
| 1 Garmin Etrex Vista |
| 1 Serial Cable |
| Basic Stamp Software |
| 1 GPS Data Cable |
| Zip Ties |
| Sticky Tape |
| 9 Volt Battery |
| 1 Basic Stamp with GPS Datalogger Article |
| Velcro |
| Step 1 |
| Read the entire GPS Datalogger article. Understand diagrams and pictures included within the text. Also, read the basic stamp code and understand what it is saying. |
| Step 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ignore the code given in the above article. Insert the code below
into the main window of the stamp program. I erased the line where it
specifies which com port to use. In the Directive dropdown menu in the
main window, select the port which you are going to use to run the
stamp. This is the basic stamp code: ' {$STAMP BS2p} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Step 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Once you copy and paste this code in the program, the code portion of this project will be complete. The next thing you have to worry about is the stamp and the Garmin Etrex Vista GPS. To connect the GPS to the stamp, splice the GPS data cable connected to the GPS. Split it into a black wire and a white wire. Attach a connector to the two wires so you can then connect these to the ground and pin zero of the basic stamp. The black wire serves as the ground wire for the GPS and the white wire serves as the wire that transfers data from the GPS to the basic stamp. Once the wires are connected to the stamp, attach a 9 volt battery to the stamp to power it. Next you want to attach the basic stamp and GPS to the Magpie AP. To do this, connect the GPS to the camera bay on the Magpie AP with zip ties and then attach the basic stamp to the top of the camera bay above the GPS with sticky tape and velcro. Make sure the GPS data cable is still connected to the basic stamp. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Step 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Now that everything is connected together and mounted on the Magpie AP, flying the R/C airplane and gathering GPS waypoints is possible. To start, attach the serial cable to the stamp and the computer (make sure the stamp is powered by the 9 volt battery). Turn the GPS on and make sure the screen shows the present GPS location (longitude and latitude). Once the stamp is powered, the GPS is powered and connected to the stamp, connect the serial cable to the stamp and connect the other end to the serial com port in the computer. After this is done, run the program and select [1] Clear datalog and start again. Once this is done, the aircraft will be ready to fly and you will be ready to gather GPS data points. After the desired flight path is obtained and the GPS points collected, the data will be stored in the memory of the basic stamp. To get this data back, run the program and select [3] Dump datalog to PC. This will show all the data points collected during the flight. Copy and paste this information into an excel spreadsheet to be able to make a graph of the actual flight path. Below is an example of this done. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is a video of the Magpie AP flying while collecting GPS waypoints |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example Excel Format: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When copying and pasting the coordinates into Excel, format the cells so they breakdown the coordinate to degrees, minutes, and seconds. To make this into a graphical number, use the formula:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For each longitude and latitude, insert the different number into the formula. Make sure this formula is copied and pasted into the ending cell named Latitude and Longitude. After this is done, highlight the longitude and latitude and graph them in a scatter plot. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Conclusion | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| After this is complete, you can see in a graph the actual flight path of the aircraft. Just like the aircraft can fly to different locations and collect waypoint info, the aircraft can do the opposite. It can have GPS waypoints stored into the GPS and by following a route, the stamp will control the servo's to fly in the desired direction (in the direction of the waypoint). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||