jonas_rotter
Hey folks,

I am currently working on reading the values of a turbidity sensor via an Arduino as Modbus slave. During the first test I noticed that I only get funny values. So 5 V are read out as "-64" (A3), the other values vary constantly from -64000 to 64000. I already tried it with another Arduino, here the same problem occurred. The connection to the Arduino is made correctly via OpenPLC, TX/RX flash and digital values are output correctly.
Does anyone have any idea why this is happening?

 Analog.jpg 



Greetings, Jonas
Quote 0 0
thiagoralves
5V = 65535 (maximum 16-bit value). You will have to make the conversion between the two. Make sure you select "unsigned int" on your modbus monitoring program to view the actual value instead of negative numbers. You can also use the "Monitoring" page on OpenPLC for that.
Quote 0 0