# Log ping 2 data with GPS

**URL:** <https://discuss.bluerobotics.com/t/log-ping-2-data-with-gps/15889>\
**Category:** Ping Sonar Devices\
**Created:** [January 25, 2024, 11:47pm UTC](https://discuss.bluerobotics.com/t/log-ping-2-data-with-gps/15889 "2024-01-25T23:47:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![caris](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@caris](https://discuss.bluerobotics.com/u/caris)\
**Post date:** [January 25, 2024, 11:47pm UTC](https://discuss.bluerobotics.com/t/log-ping-2-data-with-gps/15889/1 "2024-01-25T23:47:56Z")

</div>

I do some trial for hardware integration with Arduino Mega (2 serial port)  
The goal is to log position (gps) and depth ( ping 2)  
I have got this

```auto
Lat ; lon ; time ; depth ; confidence
-7.822731;110.411600;03:33:01.609;19429;1 
-7.822731;110.411600;03:33:03.609;21085;1 
-7.822729;110.411600;03:33:04.609;28995;1 
-7.822725;110.411590;03:33:06.609;516;0 
-7.822724;110.411580;03:33:07.609;580;0 

```

Then I saw big error…  
Why this can not get 100% confidence…  
The depth read totally.wrong

How to solve this ??  
I use arduino mega for data logger

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [January 29, 2024, 6:55am UTC](https://discuss.bluerobotics.com/t/log-ping-2-data-with-gps/15889/2 "2024-01-29T06:55:28Z")

</div>

Hi @caris, welcome to the forum 🙂

> [@caris](#):
>
> Why this can not get 100% confidence…  
> The depth read totally.wrong
> 
> How to solve this ??

A sensor cannot know for sure that it is measuring the quantity it is supposed to be. Our [Ping Sonar](https://bluerobotics.com/store/sonars/echosounders/ping-sonar-r2-rp/) can use its profile data to estimate the distance to a reflective surface, but sometimes the data it’s measuring isn’t consistent enough for it to know whether there is in fact a surface to detect, or how far away it is if there is one.

I would recommend reading through

1. [this thread](https://discuss.bluerobotics.com/t/using-ping1d-at-an-angle/12541) to understand how an echosounder works, and the **factors which influence its measurements** ,
2. [this comment](https://discuss.bluerobotics.com/t/interpretation-of-sonar-raw-data/11722/4) to better understand the distance estimation process, and
3. [this thread](https://discuss.bluerobotics.com/t/ping1d-confidence-meaning/13846) to get a better understanding of the confidence value

From there, feel free to ask any follow-up questions that you may have 🙂
