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
246
My project is to control two BLDC motors and show data of BLDC motors speed and battery voltage, GPS data, and Sonar sensor data on My PC wirelessly. I have radio communication and it is working for BLDC motors controlling. How can I send GPS and SONAR sensor data through the same radio-link?
 

ericgibbs

Joined Jan 29, 2010
18,767
hi um,
Welcome to AAC.
Did you write the program that is currently sending the radio data.?

Do you have a circuit or block diagram to post.?
What is the RF link type etc..
E
 

Thread Starter

umerrai1

Joined Mar 29, 2021
246
hi um,
Welcome to AAC.
Did you write the program that is currently sending the radio data.?

Do you have a circuit or block diagram to post.?
What is the RF link type etc..
E
At this moment I have program that is only controlling 2 BLDC motors. I am going to send you this programme and simply I have connected those motors with pin 5 and 6. Now I have to connect Sonar sensor and gps with it. Please pardon me for my questions as I am new in programming.
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,767
hi,
Looks like Arduino coding, you could add the Tasks for GPS and Sonar.

What are the message data strings from your GPS and also the Sonar. ?
Baud rates , transmit intervals. etc

Which type of transceiver for the radio link are you using.?

Is this for a radio controlled marine application.?
E
 

Thread Starter

umerrai1

Joined Mar 29, 2021
246
Thank you.
Yes, it is Arduino based circuit. I am using ATmega 328p. Further details I will let you know after some time. But the first thing is this will this ATmega can handle these sensors' information at the same time and controls both motors.
 

ericgibbs

Joined Jan 29, 2010
18,767
hi um,
But the first thing is this will this ATmega can handle these sensors' information at the same time and controls both motors.

To answer that question I need to know more details about the project.

What are the message data strings from your GPS and also the Sonar. ?
Baud rates , transmit intervals. etc

Which type of transceiver for the radio link are you using.?

Is this for a radio controlled marine application.?

The more information I have on what you are trying to do, it will be possible to give you answers.

The Mega is capable of controlling a number devices, but it is the refresh/update of the transmitted information that could be limiting.

E
 

Thread Starter

umerrai1

Joined Mar 29, 2021
246
Yes, it is a radio-controlled boat having:
GPS
Sonar sensors
and 2 motors to be controlled.
I will tell you everything about the project after 6-7 hours.
 

ericgibbs

Joined Jan 29, 2010
18,767
hi,
OK,
I have compiled your program in a Arduino OK.
It would help if you could translate the serial print text in the program to English.:)

E
Update:
Translated the code text.
Compiled the code for Arduino.
Tested the code, it drives my Servo unit OK.

Attached;
Servo1.txt [ino]
ServoSerial1.txt ... Output.
 

Attachments

Thread Starter

umerrai1

Joined Mar 29, 2021
246
Thank you so much for your help. That code is just for calibration of BLDC to run forward reverse and neutral position. Now I have to add GPS and SONAR. But my supervisor is not here when he will come I will discuss with them and let you know.
 

ericgibbs

Joined Jan 29, 2010
18,767
hi um,
Some of the details you need to know is the update rate of the Radio transmitted data, the length of each data string, ie: GPS , Sonar [is that water Depth] , also the battery voltage update interval.
I would suggest if possible you use 9600 Baud for radio TX and RX, as this is faster than 4800 Baud.

It is the timing of the data transfer which is critical, as the inputs from the different modules update asynchronously .

E
BTW:
This is an image of a Draft Simulator/Driver I have programmed so that I can test your programs.
[Note the Easting and Northing of the GPS data.;)]

Is this a College project.??
 

Attachments

Last edited:

Thread Starter

umerrai1

Joined Mar 29, 2021
246
woww... it is a nice presentation. I really like it. Mr. Ericgibbs I will be in touch with you and I really appreciate your dedication to my work.
 

Thread Starter

umerrai1

Joined Mar 29, 2021
246
Hello Sir,
My data is as under:
I need these messages from GPS
Coordinates, direction, time
Echosounder is water depth measurement. It has only one message string. and I need battery voltage level and rpm of motors.
Also I will use 9600 baud rate.
 

ericgibbs

Joined Jan 29, 2010
18,767
hi um,
As you may know the Time and Coords for North/East are part of the GPS receiver message output.
Usually set One second output rate

But the Direction will have to be calculated.

The water depth message will have to be output from the Echo Sounder as 9600 Baud

How do you plan to measure the motor RPM and what will be the output data format.?

To measure the battery voltage, you could use an ADC on the Atmega thru a voltage divider.

Post your plan on how you intend building the project.
E

And one more thing, How can I check the update rate?

Update from what to where.?:)

E

BTW
If the Arduino Duo is not suitable, look at the ESP32, you can use the Arduino IDE to write the programs.
 
Last edited:

Thread Starter

umerrai1

Joined Mar 29, 2021
246
If I connect one by one I am getting my messages on my PC screen. But when I connect 3 systems at one time it does not show messages on my screen. Only error messages shows on screen. What should I do that I can get all the messages in one time on my PC screen?
 

Attachments

Ya’akov

Joined Jan 27, 2019
9,080
If I connect one by one I am getting my messages on my PC screen. But when I connect 3 systems at one time it does not show messages on my screen. Only error messages shows on screen. What should I do that I can get all the messages in one time on my PC screen?
How are you physically connecting the three devices to the radio?
 
Top