1022 views|4 replies

255

Posts

4

Resources
The OP
 

[Digi-Key Follow me Issue 1] Implementing electronic fence function through GPS [Copy link]

 This post was last edited by HonestQiao on 2023-7-1 15:45

1. Project description (about 800 words, pay attention to neat format)

This event provides the Air530 GPS module, through which Pico W can easily and quickly obtain GPS positioning information.

However, the screen used in this event was a small OLED 128*64 screen that could only display relatively basic information.

Based on the actual situation, an electronic fence project was realized through GPS positioning information.

Its specific functions are as follows:

1.1 After the code is started, simple music is played to indicate the start

1.2 Start key monitoring. When the BOOT key is long pressed, the initial position setting is started. If valid GPS positioning information has been read, the current position information is set as the initial position information, and subsequent positioning information will be compared with this position. After the setting is successful, a music reminder will be played.

1.3 In the loop, read the GPS information of Air530 through the serial port, and update the read information to the screen for display

1.4 If the GPS information read is valid and the initial position has been set, the distance is calculated and output to the screen.

1.5 If the distance exceeds the set safety distance, a music alarm will be played

The main technologies involved in this project are as follows:

1. Read the GP information of Air530 through the serial port and decode it

2. Read the status of the BOOT button, identify short press and long press, and set the long press to set the initial position

3. Use nano-gui to process the display of OLED screen

4. Control the passive buzzer to play sound through PWM

5. Calculate the location distance through GPS positioning information

2. Main code snippets and descriptions corresponding to each function

2.1 Initialization settings:

2.2 Playing Music:

2.3 Get GPS information:

2.4 Initial position setting:

2.5 Calculating distance by latitude and longitude

2.6 Main process:

3. Function display and description (with pictures and text)

3.1 Overall structure:

3.2. After the program is started, the corresponding log information will be output:

3.3. The current real-time information is displayed on the screen:

4. Your experience of this activity (including opinions or suggestions)

Because I had used Hezhou's GPS before, the GPS module was easy to drive.

I have used OLED before, but this time I used nano gui to drive the OLED, which is easier to use and more convenient.

In addition, it is suggested that in the future, basic and challenging tasks can be set up to allow everyone to show their skills.

5. Complete code

gps_safe_dis.zip (14.16 KB, downloads: 3)
6. Project Video:
This post is from DigiKey Technology Zone

Latest reply

I made a PPT and conducted outdoor tests. I really put a lot of effort into it.  Details Published on 2023-7-3 11:11
 
 

6841

Posts

11

Resources
2
 

I studied Teacher Qiao's homework carefully. It's really good!

This post is from DigiKey Technology Zone
 
 
 

159

Posts

0

Resources
3
 

very good!

This post is from DigiKey Technology Zone
 
 
 

1463

Posts

0

Resources
4
 

I studied Teacher Qiao's homework carefully. It's really good! Save it

This post is from DigiKey Technology Zone
 
 
 

55

Posts

4

Resources
5
 
I made a PPT and conducted outdoor tests. I really put a lot of effort into it.
This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list