How to Calculate Compass Heading from GPS Points

How to Calculate Compass Heading from GPS Points

So you’re building a robot with an Arduino, GPS, a compass and you want it to know which direction to turn so it goes to a waypoint?  Me too!   Here is my demo sketch on how to calculate the waypoint heading.   It amounts to using the atan2 function to calculate the angle between two points, converting the angle to degrees, then normalizing it to a compass reading. The below values are hardcoded. You can run the sketch yourself to test…

Read More Read More

Rover Build Update: Arduino + GPS + Servo = glitch

Rover Build Update: Arduino + GPS + Servo = glitch

In today’s learn as you go along lesson, hit a problem trying to integrate a GPS module on the Arduino with a servos connected to the board’s PWM pin.  The result was the servos would glitch about every second or so.  Doing some searching and based on some forum posts (here too), it looks like the solution is going to be a Servo Shield.  Offloading the PWM processing to the shield should hopefully alleviate the interrupt contention. Here’s a video…

Read More Read More

Compass Placement on the Robot

Compass Placement on the Robot

Another fun lesson learned in robot building.  Where to place the compass?  I noticed some strange readings today on my Adafruit LSM303.  I had already previously discovered that the metal and other electronics of the vehicle was messing with the readings.  I dug up a real compass to compare and immediately discovered an easy way to determine the location of interference and best placement.  For now, on this vehicle I will put forward of the front wheels.  I could also…

Read More Read More

Arduino RC Car with a Compass

Arduino RC Car with a Compass

Initial test video.  Arduino Uno with an Adafruit compass module to drive a Traxxas Slash.  The program turns the vehicle northward and maintains that heading, making any necessary adjustments while driving.  I’ll post build details after I refactor the hard-coded directional value to work with any heading.    

ISS Radio Signal Capture

ISS Radio Signal Capture

Had a great opportunity last night to capture a radio signal from space.  The ISS flew by transmitting a commemorative space anniversary broadcast.  Found out about it at the very last minute and didn’t have time to set up a proper recording and demodulation, but I did manage to take this video.  The signal came in quite strong.  

How to Read the Traxxas Radio PWM Signals using an Arduino

How to Read the Traxxas Radio PWM Signals using an Arduino

These are my notes on how to read the PWM servo signal coming from the Traxxas TQ receiver. Disclaimer: use this information at your own risk.  I am not responsible for any damage. RC car radio receivers communicate with the steering servo and electronic speed controller using electrical pulses called PWM(pulse width modulation).  Using an Arduino, we are able to capture  these pulses and print their values out to the Serial Monitor.  These numbers represent the width of the electrical…

Read More Read More

Controlling a Traxxas ESC with an Arduino

Controlling a Traxxas ESC with an Arduino

These are my notes for getting an Arduino Uno to control a Traxxas Velineon VXL-3s speed controller. Disclaimer: use this information at your own risk.  I am not responsible for any damage. Materials Needed Traxxas ESC Velineon VXL-3s Arduino Uno Stock Traxxas 7.2v battery Power cable First you need to connect one of the Arduino PWM(~) signal pins to ESC connector’s white lead).  Be sure it’s the ESC connector and not the steering servo, they look the same. Warning:  the…

Read More Read More