Try using GPS receiver kit with RaspberryPi3 (Ruby)

Goal

--Location information can be obtained by GPS

What I used

--GPS receiver kit with 1PPS output "MICHIBIKI" 3 receivers supported

Connect

Since I had all the parts at hand, I assembled it with the circuit diagram of the manual posted on the Akizuki-sama site. It seems that the switching diode is actually unnecessary, but I connected it because it also provides insurance so as not to break it.

image.png

http://akizukidenshi.com/download/ds/akizuki/AE-GPS_manual_r1.06_s.pdf

The breadboard is vertical because the GPS antenna had to point straight up by default. By the way, it took about 30 minutes for the LED to blink in the initial operation test. I put it by the window, but maybe the place I put it was bad.

IMG_4489.jpg

Source

To execute the following sources, it is necessary to make UART connection related settings on Raspberry Pi. Please google there: pray: Once that's done, I haven't done much.

I used nmea_plus for NMEA format analysis. SourceDecoder Maji convenience: point_up:

require 'serialport'
require 'nmea_plus'
sp = SerialPort.new('/dev/serial0', 9600, 8, 1, 0) # see: https://rubydoc.info/gems/serialport/SerialPort#set_modem_params-instance_method

trap 'SIGINT' do
  sp.close if sp
  exit
end

source_decorder = NMEAPlus::SourceDecoder.new(sp)
source_decorder.each_complete_message do |message|
  # see: https://github.com/ianfixes/nmea_plus/blob/master/lib/nmea_plus/message/nmea/rmc.rb
  if 'GPRMC' == message.data_type
    puts message.utc_time
    puts message.active? # false:Data invalid
    puts message.latitude
    puts message.longitude
    #puts message.speed_over_ground_knots
    #puts message.track_made_good_degrees_true
    #puts message.magnetic_variation_degrees
    puts message.faa_mode # A:Independent positioning(Accuracy about 3m), D:Relative positioning(Accuracy 0.About 4m) 
    puts
  end
end
# sp.close <=You won't get here ...

result

Below is the execution result.

2020-07-15 12:35:37 +0000
true
33.725575
131.64382333333333
A
2020-07-15 12:35:38 +0000
true
33.72558166666666
131.64381833333334
A

By the way, with Google, if you enter latitude and longitude in the search keyword, Goole Map will be displayed at that point. Himeshima Village Office: grinning:

image.png

Impressions

――The pins of the GPS receiver kit are aligned with the pins of the Raspberry Pi (it seems), so I didn't get lost when connecting. ――You can usually find a useful Gem by searching. Let's use Ruby even if we don't mind. ――Ah, I forgot to play even though I connected the 1PPS terminal.

Recommended Posts

Try using GPS receiver kit with RaspberryPi3 (Ruby)
Try using GloVe with Deeplearning4j
Try using view_component with rails
Try using Cocoa from Ruby
Try using gRPC in Ruby
[Programming Encyclopedia] §2 Try using Ruby
Try using Redis with Java (jar)
Try using Spring Boot with VS Code
Notes on using FCM with Ruby on Rails
Try using Kong + Konga with Docker Compose.
Try using the Wii remote with Java
Try to link Ruby and Java with Dapr
I made blackjack with Ruby (I tried using minitest)
Try to get redmine API key with ruby
Easily edit performance videos with ffmpeg using Ruby
Try using S3Proxy with Microsoft Azure Blob Storage
Try using another Servlet container Jetty with Docker
Try using libGDX
Try using Maven
Try using powermock-mockito2-2.0.2
Try using GraalVM
Try using jmockit 1.48
Try using SwiftLint
Try using Log4j 2.0
Try Ruby Minitest
Try using OpenID Connect with Keycloak (Spring Boot application)
Try to work with Keycloak using Spring Security SAML (Spring 5)
Try using the query attribute of Ruby on Rails