Portal for car enthusiasts

Homemade gps receiver for the car. How to make a PDA from a car navigator

A wide range of GPS-devices of different price categories is available in specialized stores. Powerful models with advanced functionality are quite expensive, and the simplest beacons are affordable. However, many try to avoid the expense and make their own GPS tracker. How difficult is this task, what will be needed to solve it, and will the effort justified?

Using a Smartphone for GPS Tracking

To use a GPS-enabled smartphone as a GPS tracker or beacon, some software work is required. Making a DIY GPS tracker from an Android, Windows Mobile or iOS phone is very simple, no intervention in its design is required. If the smartphone will be used as a car tracker, you will have to perform simple manipulations to connect it to the vehicle's electrical network.

There are several applications that allow you to turn your smartphone into a tracker. For an Android device, you can download the Loki app from Google Play, run it on your smartphone, and complete the settings. It is recommended to enable the following features:

  • autorun;
  • notices (optional)
  • external power (use of alternative settings when connected to an external power source);
  • full awakening (optional);
  • command processing.

For navigation (location determination) it is recommended to set the data update interval once per minute, for sending SMS messages when the connection with the server is lost, the time limit is 5 minutes. Adjust the settings in the "Events" section according to your own needs.

After completing the settings, it remains to register on the Asgard website and add your device, indicating the identifier determined by the Loki program. If, as a result, a mark of your location appears on the site map, then everything is done correctly, and the smartphone can be used as a tracker, tracking its location through Asgard.

You can also use the GPShome Tracker application for Android, and GpsGate Client for Pocket PC for Windows Mobile. When turning a smartphone into a tracker or beacon, it is extremely important to set the time zone correctly.

To determine coordinates via Wi-Fi and GSM networks, the device must have access to unlimited mobile Internet, so you need to choose a tariff that allows you to optimize costs. If the phone will be used exclusively as a tracker, it is better to install a SIM card only for accessing the Internet, and not for calls. Using a GPS receiver that improves the accuracy of determining coordinates is a very energy-intensive process, so you should take care of providing power to a homemade tracker. To do this, cut off the lower end of the auto plug (cigarette lighter plug) and insert the phone charger cord into the USB connector. To connect the tracker directly to the on-board system, you need to buy a DC buck converter. And those who are a little versed in electronics can assemble an analogue of a converter from a pair of capacitors and a stabilizer.

If a homemade tracker (beacon) is planned to be used for covert tracking of the movement of the car, you need to think about where to hide it so that you can easily get it if necessary. And do not forget to activate the silent mode if the phone has a card for the Internet and calls.

How to make a GPS tracker with your own hands from a regular phone

A simple mobile phone without GPS can also be turned into a beacon, but this requires additional equipment and more effort. Required materials and tools:

  • mobile phone;
  • GPS/GPRS module;
  • GPS receiver;
  • adapter (you can use an old charger with a working plug);
  • knife and soldering iron.

Having cut off the charger from the side of the power supply, you need to strip the wires and solder them to the module board, and insert the plug into the phone's power connector. Then the receiver is turned on and the phone is configured. With this device, you can track the location of mobile phones belonging to your family members. Information about their coordinates will be sent to the mobile phone, combined with the GPS-module, in the form of ordinary text messages.

Some mobile operators offer the Beacon service, you can activate it on any mobile phone without a GPS module. A list of contacts of subscribers whose location is required to be tracked is compiled. To receive a message with coordinates, you need to send a request of the established form.

Is it possible to make a GPS tracker without a phone

There is an alternative to using a smartphone or phone in combination with a GPS module - any device with a GPS function (laptop, PDA). The principle is the same as for a smartphone - installing the application, settings, registering the device on the site.

Is it possible to assemble the GPS module itself and the receiver that make up the beacon or tracker with your own hands? Here are some of the components included in these devices:

  • photoresistor, usually short-wavelength;
  • operational amplifier based on bipolar transistors;
  • rectifier;
  • capacitor type controller;
  • mesh filters;
  • impulse trigger.

All these details can be bought, and the device diagram can be found on the Internet, but not everyone can figure out how to make a GPS tracker with their own hands.


Advantages and disadvantages of homemade design

If you use an old and unnecessary phone (smartphone), then the main advantage of converting it into a tracker is savings. If you purchase a device specifically for this purpose, the savings from making a GPS tracker with your own hands is almost imperceptible. The design of a mobile phone and a GPS module turns out to be rather bulky, it is inconvenient for a person to carry it with him, and when installed in a car, there is a high risk of wire breakage. It is more convenient to use a smartphone as a tracker or beacon, but only for tracking people. Installing it on a car is not the best solution, the original tracker has a number of advantages over a homemade one:

  • up to a year battery operated;
  • without any tricks it connects to the on-board network, consuming a minimum of energy;
  • designed to operate in a wider temperature range than the phone;
  • thanks to the hermetic housing, it can be installed outside the car;
  • reacts to shocks, rocking of the car;
  • can be equipped with a panic button, microphone, various sensors.

If you use your smartphone as a covert tracking device, it will no longer be able to perform the functions of a communicator.

It is better to buy a GPS tracker or beacon than to use a homemade device based on a smartphone or a regular mobile phone. The factory tracker is more reliable, easier to install on a vehicle, and performs more functions. The cost of buying a tracker is not so great, and turning a smartphone into a tracking device is justified only if you have an unnecessary device.

Almost everyone is familiar with the navigation system. GPS helps to quickly and accurately determine the location of a particular object - a person, a car, other modes of transport or animals. The simplest beacon is inexpensive in the store, but a more powerful one hits the wallet a little. But why buy when you can actually do it yourself? From what and how those who wish will now learn.

Self-assembly of a gps beacon, what to make, how to act

ATTENTION! Found a completely simple way to reduce fuel consumption! Don't believe? An auto mechanic with 15 years of experience also did not believe until he tried it. And now he saves 35,000 rubles a year on gasoline!

Every modern phone, car, computer has a gps beacon. The program is convenient, simple, and most importantly productive. The location of any object with its help is determined instantly. Gps beacon, as an independent device, is popular among motorists and parents who constantly want to know where their child is, but not everyone is in a hurry to lay out their money for this device in the store. For those budget conscious people, there are ideas to help them build a gps tracking beacon on their own and at minimal cost. You can make a beacon for tracking with your own hands in several ways, and it is about them that we will now discuss.

Owners of cool smartphones will get a tracking system for free and without effort

Each smartphone that has a built-in gps module can become a full-fledged beacon that a person can use to obtain the coordinates he needs. The whole technical point of creating such a beacon is as follows:

After these steps, the owner of the smartphone will be able to use his device not only for calls, entertainment and access to the Internet, but also to track the location of a particular object. In such a simple way, the smartphone turns into a full-fledged gps beacon.

For the system to work correctly, the android device must have a version of at least 3.2, but it is better if it is at least 4.1.2. Data about the tracking object will be displayed on the phone in the form of SMS messages or points on Google Maps.

How to mount a gps beacon with a less fancy mobile device

A phone that is slightly inferior to powerful mobile devices on the Android operating system too Can be a great base for a GPS beacon. In order to assemble such a device with your own hands, you will need to buy something else and show your skills in handling technical devices. in addition to the phone, you will need to stock up on an adapter - this may be a dangling charger, where the side of the connection to the phone has survived. You will also need to buy a GPS / GPRS module and receiver.

If all the elements of the future lighthouse are at hand, you need to stock up on tools - a knife, a soldering iron. Work must be done according to the following principle:

  • the wires that are the basis of the cable for connecting to the phone need to be stripped;
  • they must be connected to the module or using a soldering iron;
  • connect the system to the phone jack, which is designed for charging;
  • turn on the receiver and try to configure the necessary parameters from the phone.

Such a gps beacon will send signals to the phone in the form of ordinary text messages, and if it is possible to open maps, then it is easier to see the coordinates on them, because it will be easier to navigate in space and determine the specific location of the object.

Such a beacon is easy to use, but at home. The design will be quite inconvenient for carrying or installing in a car. This is an ideal option for those who are going to monitor their loved ones and children from home.

Is it possible to make a lighthouse without a phone

Before answering the question of whether it is possible to make a gps beacon without a phone with your own hands, you should figure out what this device really is and what features it has. GPS beacon is a device that is mainly used to guard cars. It has a compact size, it is powered by a charger. The system accurately determines the location of the object, but for its correct operation, a SIM card must be present inside the device.

The last fact makes it possible to understand that the operation of the beacon without a SIM card is not possible. In this case, there are only two options for getting out of the situation - buying a ready-made beacon in a store or making it yourself using a mobile phone and additional components. If there is no SIM card, the system will not be able to perform the following actions:

  • correct and timely signal transmission;
  • registration of a new tracking object and the display of statements about it;
  • connect to the internet - this is necessary for the operation of gps.

If you use a phone with the latest operating system and a powerful processor, you just need to download a special application for it, and a simpler model requires additional elements to work in gps beacon mode.

Advantages and disadvantages of a do-it-yourself gps beacon

Even store-bought technical devices have a number of advantages and disadvantages. If we talk about a do-it-yourself gps dot, then its positive aspects are as follows:

  • the ability to quickly, without outside help and large financial investments, make a reliable tracking device;
  • even if you have to buy additional little things to design a lighthouse, it will come out much cheaper than in a store;
  • in terms of functionality, such a device is in no way inferior to the beacons that were bought in the store.

A person will be able to use such a beacon for many years, and if there are any inaccuracies in the work, they can always be corrected.

A beacon for a car created by oneself has a number of shortcomings that make it inferior in popularity to the standard version bought in the store. Especially these negative aspects are tangible for car owners and they are as follows:

  • due to the design features of the system, it cannot be correctly placed in the passenger compartment;
  • a part of such a beacon must necessarily be a mobile device, and the constant tracking process can create difficulties for mobile communications;
  • the beacon consists of several elements connected to each other and when the car moves, they can disconnect from each other or break the wires.

If a person plans to use a beacon for receiving gps data for his car, then it is better to buy this device in a store. When a tracking system is needed exclusively for home use, a do-it-yourself beacon will be an ideal option. The frequent use of such systems for cars prompted the creators to opt for a monoblock design of compact dimensions. If you make an analogue of a lighthouse with your own hands only with the help of a smartphone and a special program, you can use it for placement in a car. If the lighthouse is created from separate elements, it is better to leave it for home use.

GPS beacon will always help to search for cars or other moving objects. You can buy it in the store or create it yourself. It is worth deciding which option to choose, taking into account your own financial capabilities, the purpose for which the device will be used and soberly assess your communication skills with technical devices.

After several experiments with arduino, I decided to make a simple and not very expensive GPS tracker with sending coordinates via GPRS to the server.
Used Arduino Mega 2560 (Arduino Uno), SIM900 - GSM / GPRS module (for sending information to the server), GPS receiver SKM53 GPS.

Everything was purchased on ebay.com, in the amount of about 1500 rubles (about 500 rubles of arduin, a little less - a GSM module, a little more - GPS).

GPS receiver

First you need to understand how to work with GPS. The selected module is one of the cheapest and simplest. However, the manufacturer promises a battery to save satellite data. According to the datasheet, a cold start should take 36 seconds, however, in my conditions (10th floor from the windowsill, there are no buildings right next to it), it took as much as 20 minutes. The next start, however, is already 2 minutes.

An important parameter of devices connected to the arduino is power consumption. If you overload the arduino converter, it can burn out. For the receiver used, the maximum power consumption is 45mA @ 3.3v. Why in the specification indicate the current strength at a voltage different from the required one (5V) is a mystery to me. However, the arduino converter will withstand 45 mA.

Connection
GPS is not controlled, although it has an RX pin. For what - is unknown. The main thing you can do with this receiver is to read NMEA data from the TX pin. Levels - 5V, just for arduino, speed - 9600 baud. I connect VIN to VCC of arduino, GND to GND, TX to RX of the corresponding serial. I read the data first manually, then using the TinyGPS library. Surprisingly, everything is readable. After switching to Uno, I had to use SoftwareSerial, and then problems began - part of the message characters was lost. This is not very critical, since TinyGPS cuts off invalid messages, but it's rather unpleasant: you can forget about a frequency of 1 Hz.

A quick note about SoftwareSerial: there are no hardware ports on the Uno (other than the one connected to the USB Serial), so you have to use the software one. So, it can only receive data on a pin on which the board supports interrupts. In the case of Uno, these are 2 and 3. Moreover, only one such port can receive data at a time.

This is what the "test stand" looks like.

GSM receiver/transmitter


Now the more interesting part begins. GSM module - SIM900. It supports GSM and GPRS. Neither EDGE, let alone 3G, are supported. For transferring coordinate data, this is probably good - there will be no delays and problems when switching between modes, plus GPRS is now almost everywhere. However, for some more complex applications this may not be enough.

Connection
The module is also controlled via the serial port, with the same level - 5V. And here we already need both RX and TX. The module is shield, that is, it is installed on the arduino. Moreover, it is compatible with both mega and uno. The default speed is 115200.

We collect on Mega, and then the first unpleasant surprise awaits us: the TX pin of the module falls on the 7th pin of the mega. Interrupts are not available on the 7th pin of the mega, which means that you will have to connect the 7th pin, say, with the 6th, on which interrupts are possible. Thus, we will waste one pin of the arduino for nothing. Well, for a mega, this is not very scary - after all, there are enough pins. But for Uno, this is already more difficult (I remind you that there are only 2 pins that support interrupts - 2 and 3). As a solution to this problem, it can be proposed not to install the module on the arduino, but to connect it with wires. Then you can use Serial1.

After connecting, we try to “talk” with the module (do not forget to turn it on). We select the port speed - 115200, while it is good if all the built-in serial ports (4 on mega, 1 on uno) and all software work at the same speed. In this way, more stable data transmission can be achieved. Why - I do not know, although I guess.

So, we write a primitive code for forwarding data between serial ports, send atz, silence in response. What's happened? Ah, case sensitive. ATZ, we get OK. Hooray, the module hears us. Why don't you give us a call if you're interested? ATD +7499 ... The landline phone rings, smoke comes out of the arduino, the laptop is cut down. The Arduino burned out. It was a bad idea to feed it with 19 volts, although it is written that it can run from 6 to 20V, 7-12V is recommended. The datasheet on the GSM module does not say anywhere about the power consumption under load. Well, Mega goes to the parts warehouse. With bated breath, I turn on the laptop, which received + 19V via the + 5V line from USB. It works, and even the USB did not burn out. Thanks Lenovo for the protection.

After the converter burned out, I looked for the consumed current. So, peak - 2A, typical - 0.5A. This is clearly beyond the power of the Arduino converter. You need separate food.

Programming
The module provides ample opportunities for data transfer. Starting from voice calls and SMS and ending, in fact, GPRS. Moreover, for the latter, it is possible to execute an HTTP request using AT commands. You will have to send several, but it's worth it: you don't really want to generate a request manually. There are a couple of nuances with opening a data transmission channel via GPRS - remember the classic AT + CGDCONT = 1, "IP", "apn"? So, here you need the same thing, but a little more cunning.

To get a page at a specific URL, send the following commands:
AT+SAPBR=1,1 //Open carrier (Carrier) AT+SAPBR=3,1,"CONTYPE","GPRS" //connection type - GPRS AT+SAPBR=3,1,"APN","internet" //APN, for Megafon - internet AT+HTTPINIT //Initialize HTTP AT+HTTPPARA="CID",1 //Carrier ID to use. AT+HTTPPARA="URL","http://www.example.com/GpsTracking/record.php?Lat=%ld&Lng=%ld" //Actual URL, after sprintf with coordinates AT+HTTPACTION=0 //Request data by GET method //wait for response AT+HTTPTERM //stop HTTP

As a result, if there is a connection, we will receive a response from the server. That is, in fact, we already know how to send data about coordinates if the server receives them via GET.

Nutrition
Since it is a bad idea to power the GSM module from the Arduino converter, as I found out, it was decided to buy a 12v-> 5v, 3A converter on the same ebay. However, the module does not like 5V power. We go to the hack: we connect 5V to the pin from which 5V comes from the arduino. Then the built-in converter of the module (much more powerful than the arduino converter, MIC 29302WU) will make what the module needs from 5V.

Server

The server wrote a primitive one - storing coordinates and drawing on Yandex.maps. In the future, it is possible to add various features, including support for many users, the status "armed / not armed", the state of the car's systems (ignition, headlights, etc.), it is even possible to control the car's systems. Of course, with the appropriate support for the tracker, which smoothly turns into a full-fledged alarm.

Field trials

This is what the assembled device looks like, without the case:

After installing the power converter and putting it into the case from a dead DSL modem, the system looks like this:

I soldered the wires, took out several contacts from the arduino pads. They look like this:

I connected 12V in the car, drove around Moscow, got the track:


The track points are quite far apart. The reason is that sending data via GPRS takes a relatively long time, and at this time the coordinates are not read. This is a clear programming error. It is treated firstly by sending a pack of coordinates at once with time, and secondly, by asynchronous work with the GPRS module.

The search time for satellites in the passenger seat of a car is a couple of minutes.

conclusions

Creating a GPS tracker on arduino with your own hands is possible, although not a trivial task. The main question now is how to hide the device in the car so that it is not exposed to harmful factors (water, temperature), is not covered by metal (GPS and GPRS will be shielded) and is not particularly noticeable. For now, it just lies in the cabin and connects to the cigarette lighter socket.

Well, you still need to fix the code for a smoother track, although the tracker already performs the main task.

Used devices

  • Arduino Mega 2560
  • Arduino Uno
  • GPS SkyLab SKM53
  • SIM900 based GSM/GPRS Shield
  • DC-DC 12v->5v 3A converter

Today on the market you can find a large number of GPS-devices with different functionality and price range. But not all people are ready to immediately buy a GPS navigator and prefer to make it on their own. Whether this is necessary is hard to say. But it is certainly possible to do so.

How to make a navigator with your own hands

You can make your own navigator in 2 different ways. For the first option, you will need a battery, the simplest mobile device and a GPS transmitter. It will take a lot of time to assemble such a GPS navigator. First of all, you need to be well versed in system programming and electronics. This navigator is very difficult to use. It will be necessary to send messages to the satellite, and the coordinates will have to be superimposed on maps.

An easier second way: a GPS navigator can be made using a laptop. To do this, you need a GPS receiver and a laptop itself. We connect the GPS receiver via USB, Wi-Fi or Bluetooth. The laptop should detect the device itself. Then we install the appropriate software on the computer, which can be easily downloaded from the Internet.

Programs for creating a navigator

There are many programs that are suitable for trips out of town. There are also special programs for trips around the city. This is, for example, the OziExplorer program. With its help, you can use scanned maps of the area. It is best to use electronic GPS maps to drive around the city. There is another program that has gained popularity due to the accurate map of St. Petersburg. This is the CityGuide program. It also provides information about traffic jams.

Laptop as a GPS navigator

In the car, the laptop must be installed in such a way that it does not slip or fall while driving. You can securely mount your laptop with the car mount. If your PC has Internet access, you can install programs that provide information about traffic jams. And if everything is in order, then the GPS-navigator is ready. Now you know how to make a navigator from a laptop. And if problems arise, then you need to understand the computer settings.

As you can see, you can make a GPS navigator from a laptop. And it is quite justified - to use a laptop as a GPS-navigator. Since it is possible to use various navigation programs using a large display. You only need to purchase a GPS receiver for your laptop. And the problem of navigation is solved forever.

The receiver outputs the following data:

  1. Coordinates - latitude, longitude and altitude of the point where the
  2. Greenwich Mean Time - hours, minutes, seconds
  3. Total number of satellites found by the receiver
  4. The number of satellites from which the signal is received.

The receiver has a memory of 200 points. The coordinates of a point determined by the receiver at a given moment of time can be entered into the memory, and it is also possible to record the coordinates of points from geographical maps into the receiver's memory.

Using the receiver, you can determine the distance and true (not to be confused with magnetic) azimuth from the point where the receiver is located to any point selected from its memory.

The EB-500 is perfect for mobile applications due to its small size and low current consumption.

The accuracy of the coordinates depends on the number of satellites from which the signal arrives at the module, there must be at least 3 of them.

To detect satellites, the module uses 66 channels, while if the antenna is passive, it consumes 28 mA. Once satellites are found, the number of channels and hence the current consumption are reduced.

Supply voltage from 3 to 4.2 volts.

Communication with the module is via two equivalent UARTs.

UART pins - TX0, RX0 and TX1, RX1.

An LED is connected to the GPS status output through a resistor. While the connection with the satellites is not established at the output, the logical 1-LED is constantly on, when satellites are detected, it flashes at a frequency of 1 Hz. After debugging the circuit, it can be removed.

Output V_RTC_3V3 – power must be applied to this output, otherwise the module will not start. It can be connected to the power supply of the module, but it is better to connect a standard CR lithium battery for 3 volts, then all settings will be saved in the module's memory even after the receiver is turned off. RTC consumption is only 1 µA, so the battery will last a long time.

Power is supplied to the VIN_3V3 pin.

The antenna is connected to the RF_INPUT pin. The path connecting the module output to the antenna feed should be as short as possible with a ground plane on the sides. I have a passive antenna

35*35 with a polygon below it 70*70. It started without problems even in the fog in a forest clearing. And the accuracy is pretty good.

A good active antenna is expensive, a good LNA is not cheap. A cheap Chinese antenna, in conditions of strong interference, proved to be worse than a passive one, as you can see, the amplifier there is not quite low-noise. In addition, it is powered by a minimum of 3.3 volts, and is fed from the module to the line

2.8 V. Therefore, it is necessary to cut off the constant voltage at the RF_INPUT pin with a capacitor, open the antenna, start external power - a lot of trouble.

The antenna should not be placed next to the module, so that the noise from the module does not interfere.

This is the coordinates of the measured point on the GOOGLE map. The distance from the wall of the house to the water is 10 meters. The receiver and I stood about three meters from the water.

After the module is soldered to the board, VIN_3V3 and V_RTC_3V3 are connected, the antenna is connected, and by the glow of the LED you are convinced that everything is working for you - you need to check the speedUART exchange. This is necessary for programming the USAR (synchronous asynchronous transceiver) microcontroller.

Connect RX1,TX1 or RX0,TX0 through MAX3232 (operates from 3 volts) with the computer's COM port. For USB, you can solder the transition to the FT232RL - an inexpensive reliable chip with drivers for all operating systems. I got it working right away with no problems.

Check the speed at which the module responds, according to the datasheet, it is 9600 that worked for me at 115200. If it doesn’t respond, go through the speeds. A signal is not required for this - the LED may not blink. I use the terminal in CVAVR or the Terminal v1.9b program is free and very convenient.

The exchange takes place according to the NMEA 0183 protocol.

The ATMEGA 16 harness is standard. The REZET pin is pulled up with a 10 kΩ resistor. The clock frequency is set by a quartz resonator 7.3728 MHz. Power is supplied to the ADC of the microcontroller through an LC filter - a 10 μH inductor, a 1 μF capacitor. The ADC voltage reference pin AREF is connected to the ADC power pin. The connector for the programmer is not shown in the diagram. Port B is connected to LCD display WH1604B - 4 lines of 16 characters. A trimmer resistor R2 20 kOhm adjusts the contrast. The button on the backlight is clocked in order to save battery power.

Between the UART of the module and the USART of the microcontroller, an ADUM1201 microcircuit is installed as a galvanic isolation. The maximum amplitude of the pulses from the module, when viewed with an oscilloscope, is not more than 2.8 V. The microcontroller perceives the pulse as a unit from 2.5 V. The microcircuit will raise the pulse amplitude to 5 volts - the microcontroller supply voltage. In order to avoid crashes, ADUM is better to install.

The AT24C128 electrically erasable and programmable read-only memory (EEPROM) chip with an I2C bus interface is the receiver's memory, where the data of all 200 points will be stored, but more on that later. The outputs of CDL - serial communication synchronization and CDA - serial data and address transmission must be pulled up to the power supply with a 4.7-5.1kΩ resistor. The WP- write protect pin is connected to GND. Pins A0, A1 - addressing pins are used if several microcircuits are connected to the bus, 4 combinations are possible. We have one chip, so the pins A0, A1 are connected to GND - the address is zero.

A divider is assembled on the operational amplifier. The voltage from the battery is divided in half and fed to the ADC input of the microcontroller - bit 0 of port A, to control the voltage value of the lithium battery.

The keyboard for communicating with the receiver is assembled on clock buttons. The READ and WRITE buttons are clocked. Hover button - with fixation. 300 ohm resistors are needed to limit the current so as not to accidentally burn the microcontroller port.

Now about the power of the receiver. I have a 3.7 volt lithium battery, when fully charged, about 4.15 V. To power a microcontroller with 7.3728 MHz quartz and a WH1604 display, 5 volts are needed. Although the datasheet on the display has Vdd from 3 to 5 volts, nothing is visible with the standard contrast control circuit and a supply voltage of 3.3 volts.

It is desirable to apply 3.3 volts to the EB-500 module. A 5 volt step-up switching regulator is assembled on the LM2623 chip. The LM2623 chip is designed specifically for digital equipment, it has a low noise level and a minimum of strapping. Capacitors C4 and C5 are installed additionally to reduce noise.

Power for the EB-500 module is obtained from the output of the linear stabilizer LP2980-3.3. A microcircuit with a very low own consumption, the losses on it are maximum 50 mW, it heats up very little, and we get a stabilized 3.3 volts with almost no noise.

Now about the program. Compiler used.

The NMEA 0183 protocol contains a lot of useful information, but we are only interested in coordinates, time, altitude, the number of visible and used satellites. Therefore, we select only 3 messages (the necessary information is highlighted in red):

1.$GPRMC,181057.000,A ,5542.2389,N,03741.6063,E,0.47,74.50,190311,A*51

Here we are interested in the character number 18 (we start counting from 0), if it is A, then the data is valid (there is a signal), if V is invalid.

2.$GPGGA,181058 .000,5542.2389 ,N,03741.6063 ,E,1,8 ,1.34,115.0 ,M,14.6,M,*54

From here we take almost all the information.

181058 .000 - time

5542.2389 ,N - latitude

03741.6063 ,E - longitude

1 - GPS fix (0 = Data invalid, 1 = Position fixed, 2 = DGPS (improved accuracy))

8 - number of satellites used

1.34 - HDOP, horizontal accuracy

115.0 ,M - height above sea level

14.6,M - Geoidal difference - difference between WGS-84 earth ellipsoid and sea level (geoid)

Time since last DGPS update, missing.

3.$GPGSV,4,1, 13 ,28,65,075,17,26,53,202,37,15,50,278,17,27,39,290,24*7D

Here we are interested in characters number 11 and 12.

13 - Total number of visible satellites.

Immediately after the receiver is turned on, the ADC is started (by setting one to 6 bits of the ADCSRA register of the microcontroller ADC) to check the charge level of the lithium battery. In the interrupt routine, upon completion of the ADC conversion, 100 values ​​​​from the data register are taken and summed, and then the average value of the battery voltage is calculated. If the battery voltage is less than or equal to 3.2 volts, the message “ Battery low". The maximum voltage to which the battery can be discharged is 2.7 volts. It is better to buy a battery with a charge controller.

The microcontroller's USART register is UCSRB=0x90, which means that the receive complete interrupt is enabled and the receiver is enabled. The receive complete interrupt handling function is as follows:

Data is taken from the UDR buffer register, provided that (UCSRA&=0x18)==0 , that is, the UCSRA register does not contain the framing error flag and the overflow flag. If the receiver is in write or read mode (flag=1), then the data is simply taken from the USART receiver buffer so that there is no buffer overflow. Attempts to turn off the USART receiver for this time resulted in a loss of communication with the module. If flag=0, data received from the buffer is parsed. If the beginning of the line is found - the $ character in ASCII code is 36, the entire line to the end - code 13 (carriage return) is placed in the gps array. Then we check characters from gps, gps and gps, look for a combination of RMC, GGA or GSV, all other messages are ignored. If the message is RMC, the variable a equate to the element of the gps array, if GSV - we calculate the number of visible satellites from the symbols located in gps and gps. If it is GGA, we pass from the interrupt handling function to the main program. In the program, we first check the variable A, if it is equal to 86, this is the ASCII character V - no signal, the display will show the message “ No signal

If variable a = 65 - symbol A, this means that a signal has appeared. We extract from the gps array, where the entire GGA message is placed, all the data of interest to us. We calculate the time, coordinates, the number of satellites with which communication is established, the height above sea level. All this data, plus the number of visible satellites calculated in the interrupt routine, is placed in buffers for output to the LCD, and displayed on the display screen. It turns out this picture:

The first line displays the latitude of the point and the number of satellites with which communication is established, there are seven of them. The second line - longitude and the number of visible satellites - 11. The third line - GMT time and altitude above sea or ocean level.

To record data, press the "Record" button. All data is stored in an external memory chip EEPROM AT24C128 with I2C bus interface. The chip's memory is organized as 16384 words of 8 bits each. Internally, 16384 bytes of memory are divided into 256 pages of 64 bytes each. Recording can be done either byte by byte or by page. For simplification of life the page record is chosen. The chip address is one byte: the three most significant bits of the AT24C address are always 101, the last bit indicates writing or reading. If zero is writing, one is reading. Memory addressing - two bytes, high bits of the page number, low bits - the number of the word in this page. It turns out: page numbers from 0 to 255 are 8 bits plus word numbers in a page from 0 to 63 another 6 bits, so 14 bits are needed to address memory. To get the high byte, we take the page number and shift it to the right by two positions - the two most significant bits will be reset, and the 6 most significant bits of the page address will move to the six least significant ones. Then we shift the same page number to the left by six positions and get the low byte of the address, where the two most significant bits are the two least significant bits of the page address, the remaining six are zeros. Now you need to remember the number of the external memory address for the point being recorded. To do this, we use the non-volatile memory of the microcontroller - EEPROM. For ATMEGA16 EEPROM is 512 bytes. We place two arrays in EEPROM eeprom unsigned char ad and eeprom unsigned char opred. The ad array points to a free page in AT24C128 memory, one means that the page is busy, zero means free. For example: ad=0 means that page 20 of the AT24C128 memory is free, and if ad=1, then it is busy. Before writing data to external memory, we go through all the elements of the array ad, incrementing the number of the element g from 0, until the condition ad[g]=0 is found. The page address of the external memory will be equal to g. Now we remember the correspondence of the address of the AT24C128 memory page to the number of the memorized point. opred[point number]=g (AT24C128 memory page address). If it is necessary to erase these points, then write zero to ad[point number to be erased], and move the element numbers in the opred array so that, starting from the point number, one more than the erased one: opred[point number]= opred[point number-1] , and the number of the total number of recorded points is reduced by one. If it is necessary to erase all data from memory, then we reset the number of recorded points and the ad array to zero. When new data is written to the AT24C128 memory, the old data is erased. The variable nomer indicating the total number of recorded points is also located in the EEPROM of the microcontroller.

The recording goes like this:

Press and hold for 50 ms (delay of 50 ms - protection against contact bounce is installed on all buttons) the “RECORD” button. On the display screen in the first line is displayed: “ Tpoints: (point no.)” point number recorded in the EEPROM of the microcontroller wherein incremented. If the point number is greater than 200, the message “ Memory busy” and the receiver exits recording mode. In the second line, you must enter the name of the point from the keyboard up to 16 characters from numbers and lowercase letters of the Russian alphabet. The input principle is the same as in a mobile phone: press the keyboard button until the desired character appears. In case of a typing error, the symbol is erased by a hash. Keyboard pins are connected to bits 3,4,5 of port D and bits 2,3,4,5 of port C. Port D bits are configured as outputs, port C bits as pull-up inputs. A low level is applied to the bits of port D with a frequency of 5 ms and the value of the bits of port C is read. For example, if zero is applied to PIND.3 and a logical zero appears on PINC.2, then the K4 button is active - 3 dezhzh. The button is active for 2.2 seconds - the 16-bit timer T1 starts at a frequency of 28800 Hz when a zero appears on the corresponding bit of port C. When the timer passes the value of 65535, an interrupt is generated and the program goes into the timer overflow interrupt handling function. If another button becomes active before the expiration of 2.2 seconds, then, as in the case of a timer overflow, the timer stops, and all values ​​entered on the previously active button are reset. After typing the name of the point, press *. The third line displays the message “ Current point?” If you need to remember the point determined by the receiver at a given time, press *, the display will show the message “ Point recorded” and the receiver exits recording mode. If coordinates are entered from the map, then press #, the screen displays the request “ Latitude?”Enter the latitude coordinates eight digits without dots - 49˚52"16.54" are entered as 49521654 then press *, the prompt is displayed “ Longitude?” the longitude is also entered, instead of 36˚18"51.57" - 36185157 and then *.

The display shows the message “Point recorded” and the receiver exits recording mode. When writing coordinates from the map, the height value is not recorded, and when reading the coordinates of this point, the height is zero. Writing to the EEPROM AT24C128 page by page is as follows:

  1. A start condition is formed - a transition from a high to a low state at the SDA pin at a high level at the SCL pin.
  2. The byte with the chip address 10100000 is transmitted; the last bit is 0 - write.
  3. The first byte of the memory address is transmitted, then the second byte of the memory address.
  4. Bytes of data are transferred, the addresses of the words in the page are incremented. Changes to the SDA pin occur when the SCL pin is low.
  5. A stop condition is generated - a low-to-high transition at the SDA pin while the SCL pin is high.

To read data from the receiver’s memory, press the “Read” button (in this case, a logical zero is read from the 7th bit of port C) and the display shows: “ Dot:". We type the number of the coordinate point we want to read, and press *. The coordinates of our point are displayed on the screen. When entering a point number in read mode, only numbers are available on the keyboard. If a number is entered that exceeds the number of recorded points, the message “ No data”, then the message is returned: “ Dot:". If there is no saved data in the device memory, then when you press the “Read” button, the message “ No data” and the device exits the read mode. We read from EEPROM AT24C128 like this: start, stop conditions and addressing are the same as when writing. The address at which the coordinates of the read point are recorded (in the program, the number of this point is indicated by the variable nomer_1) is found in the opred EEPROM array of the microcontroller. High address byte will be opred>>2, low opred<<6. Только после передачи второго байта с адресом памяти посылается байт с адресом микросхемы 10100001, где последний бит 1 – чтение. В программе чтение идет побайтно, сначала считываются байты с названием точки. Считывается байт, по номеру кода в считанном байте определяется строка, содержащая код знакогенератора LCD модуля и символ соответствующий этому коду выводится на экран, затем младший байт адреса памяти инкременируется. Так выводятся 16 символов названия точки. Затем считываются байты с данными широты, долготы и высоты точки. После считывания очередного байта младший байт адреса памяти инкременируется. Все считанные параметры помещаются в буферы для вывода на LCD и выводятся на экран дисплея:

You can scroll through the data in ascending order of point numbers with the number 2 on the keyboard, in descending order with zero. Exit Reading Mode #. In read mode, data can be erased one point at a time or all at once. We display on the screen the point whose data must be erased and press *. At the end of the first line appears "Page” To confirm *, if not - #. If you need to erase all data, then press * sequentially, “Page" , click on 1, instead of "Page”appears” All?”if confirmation is *, no - click on #. When erasing, in the EEPROM array of the microcontroller - ad, pointing to a free page address in the AT24C128 memory, zero is written to the element with a number equal to the page address in the AT24C128 of the erased point. Data from this page is erased when other data is written to it, so do not turn off the receiver in write mode until the message “Point recorded”.

The receiver has a pointing mode. This mode determines the distance and true bearing from the point where the receiver is located to any point selected from the receiver's memory. To transfer the receiver to the guidance mode, press the “Guidance” button, while a logical zero is read from the second bit of port D. The display prompts “ Dot:” you must enter the number of the point distance and azimuth to which it will be calculated, and press *. The coordinates of this point are placed in the kr array located in the EEPROM of the microcontroller. The display screen shows the number and name of the point, then the message “ guidance” and the display screen becomes as follows:

The azimuth (287˚1 "48") is displayed at the beginning of the quarter line, followed by the distance to the point of interest to us (3284 meters). So you can walk in azimuth, unless, of course, there is a compass. Magnetic declination - the difference between magnetic and true azimuth is indicated on many maps. The formulas used to calculate the azimuth and distance are taken from a geodesy textbook and redesigned to work with a float variable. The pointing point coordinates are stored in the non-volatile memory of the microcontroller, therefore, if you leave the “Guidance” button pressed and turn off the device, then after turning on the device, pointing to the same point will continue. In order to change the guidance point, you need to release the button, wait for the signal to appear and dial the number of the new point.

The design of the device, of course, leaves much to be desired, but what happened, happened.

As for the fuses, I only have BODEN programmed - the reset circuit is enabled when the supply voltage decreases and SUT1 - controls the clock generator start mode when the reset circuit is enabled. The rest are not programmed, that is, they are equal to one.

List of radio elements

Designation Type Denomination Quantity NoteShopMy notepad
Scheme 1.
U1 RS-232 Interface IC

MAX3232

1 To notepad
EB1 GPS moduleEB-5001 To notepad
D1 Light-emitting diode 1 To notepad
C1-C5, C12 Capacitor0.1uF6 To notepad
C8 Capacitor100 pF1 To notepad
C9, C10 Capacitor4.7uF2 To notepad
C11 Capacitor0.01uF1 To notepad
R7 Resistor 1 To notepad
J1 ConnectorRS-2321 To notepad
Antenna1 Antenna connector 1 To notepad
L1 Inductor 1 To notepad
IN 1 Battery power3 V1 To notepad
Scheme 2.
U2 microcontroller 1 To notepad
AD1 ChipADUM12011 To notepad
OS1 Operational amplifier 1 To notepad
AT1 ChipAT24C1281 To notepad
C6, C7 Capacitor0.15uF2 To notepad
C13, C17 Capacitor0.1uF2 To notepad
C14, C16 Capacitor22 pF2 To notepad
C15 Capacitor1 uF1 To notepad
R1, R3 Resistor

20 kOhm

2 To notepad
R2 Trimmer resistor20 kOhm1 To notepad
R4 Resistor

10 ohm

1 To notepad
R5, R6 Resistor

4.7 kOhm

2 To notepad
R8 Resistor

10 kOhm

1 To notepad
Y1 Quartz resonator7.3728MHz1 To notepad
L2 Inductor10 µH1 To notepad
DS1 LCD displayWH1604B1 To notepad
K1 Tact button 1