Skip to main content


Hackers Reveal How They Make Money Breaking Into Companies | Inc.

Recent posts

Converting/Calculating GPS cordinate ddmm.mmm format to decimal degrees

Here is a thing that i have faced few times when it comes to GPS data. Below is the GPGGA string from NMEA data receives from GPS. I have highlighted the latitude and longitude from the string.


Latitude = 0412.75469
Longitude = 07332.48758

If you want to plot this in google maps or any other platform you need to convert this data to decimal degrees, which will be easy to point the location rather than using raw data. In order to do that please follow these steps and write your own math function for this. For my purpose i am using my own function to handle the conversions.

First lets start with latitude. Get rid of the zero first.

rawdate = 412.75469  in this case 4 is the degrees which is in blue color and minutes in green

degrees = 4
minutes = rawdate - (100*degrees)
minutes = 412.75469 - (100*4)
minutes = 12.75469

So to find out the decimal degree format of raw latitude value please follow the steps bellow.

GPS hooked up to Raspberry pi - P2

In previous post you have seen the data format which Pi receives from GPS. Its in bytes and here is some raw data.
Note: In order to get GPS position data i have placed the unit out of my lab where it can see clear sky.


GPS hooked up to Raspberry pi - P1

Its been a while that haven't publish anything. I have been using Raspberry Pi for long time since it was released and the old pi hangs around doing nothing. So i thought of  hooking up an GPS to raspberry pi so that viewers out there who has interest in electronics and programming will know how it can be done.

Note: Raspberry Pi inputs or outputs supports 3.3v so the RX and TX pins also support 3.3v. So be careful about handling the voltages with the pi and devices interfacing.

I have a ublox GPS but it supports 5v so i need to do level conversion. If you want to know about level conversion please checkout my YouTube channel or the old blog posts.

First have to disable pi console in order to use the UART. If not it will get terminated. For more information Google for disabling console.
import serial  gpsport = serial.Serial("/dev/ttyAMA0", baudrate=9600, timeout=0.2)
while True:      rxgps = gpsport.readline()     if len(rxgps) > 10:        print(rxgps)
The above python sc…

ESP12E Relayboard and Alexa

Arduino and RS485 communication done from scratch....

This experiment was bit delayed due to lack of libraries for RS485 for Arduino. After lots of frustrations, i manage to make it work with soft-serial. Master controller send the command in bytes with [slaveid,status,level] and when a specific id slave response to it and lit and LED. Level byte is an analog value sent by master to dim the LED.
RS485 is a long distance communication protocol which is used is several industrial applications so it can be used to monitor and control devices in a twisted pair network.

What is Charlieplexing?

When you use microcontrollers and you are out of PIN's to connect some LED's for status or when you want to drive a binary clock with few pins left in microcontroller, there is a way that can solve this issue.
Its called charlieplexing and if you know multiplexing you will have some idea of how it works. I will do an example using Arduino for demonstration.
Charlieplexing is a method to drive multiple LED's with few pins available in your microcontroller.
Here is the formula to calculate how many LEDs can be drive from N number of pins.

Number of LED's = No. of PINS available ( No. of PINS available - 1)

For example you have only 3 pins left in Arduino and you want to know how many LED's can be drive.

Number of LED's = 3(3-1)
Number of LED's = 3(2)
Number of LED's = 6

So from 3 PINS you can drive 6 LED's.

Since arduino have tri-state output (INPUT, HIGH and LOW) its easy to drive the LED's using this method.
L = LOW (make out pin as LOW)
H = HIG…