Add sensor by SoftwareSerial


#1

Hello.

I want to add my sensor to controller board directly by serial.

The sensor is Conductivity K 0.1.
(https://www.atlas-scientific.com/_files/_datasheets/_probe/EC_K_0.1_probe.pdf)

And circuit is EZO™ Conductivity Circuit.
(https://www.atlas-scientific.com/_files/_datasheets/_probe/EC_K_0.1_probe.pdf).

The manufacturer’s code is below.
https://pastebin.com/ZCRtn1Qx

I modified that code. Modified code is below.
https://pastebin.com/mWLguhsE

When I compiled and uploaded this code, there was no error. But, all data streamings were stopped in cockpit.
Could anyone help me ?

What is wrong in my code?


#2

I dont know any about arduino programming, but you say that communication is I2C. I dont see I2C in code, only software serial communication to sensor. And you print results in main serial port, maybe crashing ROV default datastream.


#3

I mistake I2C. I modified it.
I don’t know the cause of crashing datastream.


#4

Arduino send to BBB some data, for examle:
DATA,DATA,DATA…
And you code, when it called, insert somewhere unexcepted data:
DATA,DAcond_dataTA,DATA…
Software on BBB crashes, datastream stopped.


#5

And you use some pins for com, its free?


#6

I use D14, D15, 5V, GND pin


#7

Do you think it is impossible to use directly serial connection with my sensor?


#8

I think its possible, but you need to insert your data in standard OpenROV protocol, and add some code to process it on BBB side.
You dont need to re-initalize main serial port in Slave::Initialize().
Where is main code calls Slave::Update( CCommand& commandIn)?


#9

I also want to add some sensors on the OpenRov 2.8. So I want to know if your problems are solved.