I have GPS, SONAR and two BLDC motors connected. I have to send data to my PC. I have radio-link. How can I send this data?

Thread Starter

umerrai1

Joined Mar 29, 2021
233
I am having some issues with my laptop because of this I could not connect the weather station with it. Once I will do this then I will let you know.
 

Thread Starter

umerrai1

Joined Mar 29, 2021
233
This is the code I got from arduino library. It is working withmmy ds1307. Now is there any easy way to convert its seconds to milliseconds?
 

Attachments

Yaakov

Joined Jan 27, 2019
3,317
If I divide seconds by 10, will it work?
I don't understand your thinking. Let's say it is the tenth second of the minute and you divide by 10, what do you get?

You only have one second resolution, all 1000 milliseconds of that second have the same identity.
 

Thread Starter

umerrai1

Joined Mar 29, 2021
233
You are right sir. But What I want to say is this, for example, we are receiving messages from a device at 10Hz, so, if I divide 1 second by 10 I will get a fraction of a second. So, for example, if I get a message at 11:16:01.05 (HH: MM: SS) so next message will get a timestamp of 11:16:01.15.
 

Yaakov

Joined Jan 27, 2019
3,317
You are right sir. But What I want to say is this, for example, we are receiving messages from a device at 10Hz, so, if I divide 1 second by 10 I will get a fraction of a second. So, for example, if I get a message at 11:16:01.05 (HH: MM: SS) so next message will get a timestamp of 11:16:01.15.
What tells you the sequence of the messages? The RTC only changes each second. What will tell you which .1s the logged message arrived? If you are only concerned about temporal sequence, just append a the last 3 digits of millis() to the time, that will get you a relative and unique time stamp—assuming I understand what you are trying to do.

It is important to note that if you want the milliseconds or tenths to relate to ANY OTHER CLOCK, you will have to do a lot of work and probably use some external processing to get a good result.
 

Yaakov

Joined Jan 27, 2019
3,317
By the way, the method I am describing is not very rigorous and since the millis() clock is not synced with the RTC, I think it will sometimes put lower numbers on a later message. But the sequence in the log tells you the order, a little math during log analysis ought to be able to figure out the cycle and properly order the messages with the accuracy millis() provides.
 

Yaakov

Joined Jan 27, 2019
3,317
Hmm... let me revise my suggestion.

Log using the RTC, then also record ALL of the output of millis() in the log entry. The first pass is the order in the log, it will tell you in which second it occurred in RT, the second is the millis() count, it will tell you how far apart each message happened by subtraction.
 

ericgibbs

Joined Jan 29, 2010
13,221
hi ume,
I have over 30 years of experience designing and manufacturing marine survey electronic quipment.

There is no reason to time tag echo sounder depth readings at 100mSec intervals.

Your GPS will only give an approximate position every one second.
That is approx 10 soundings per one second position fix.
So the depth sounds are already at approx 0.1 sec intervals, so why time stamp them.??

Who is writing the specification for this survey project.??
E
 

Thread Starter

umerrai1

Joined Mar 29, 2021
233
Sir there are no specifications written for this project. Every day boss says a new thing. So, I cannot say NO on the spot but I have to convince him that millis are not that much important and also difficult to synchronize with an actual clock.
 

ericgibbs

Joined Jan 29, 2010
13,221
hi ume,
Now I understand your work problem.:(

On a project as complex as this, it is important that you have an agreed written specification.

If not, the project will never get completed and the money/ time will be wasted, also you will get the blame for the failure.

Has the Boss ever managed a marine survey project.??

E
 

Thread Starter

umerrai1

Joined Mar 29, 2021
233
Sir, what is the solution for this?
I have one serial port and cannot change the baud every time I connect different equipments.
 

Thread Starter

umerrai1

Joined Mar 29, 2021
233
I have a data logger and its baud rate is set to 9600. Lets say I have a echo sounder having baud rate 4800. I cannot change baud rates how can I connect them?
 
Top