I would like to buy this inclinometer from the company leveldevelopments:
I wrote them and they said the PCB-only version is also available for easier setup with Arduino. The problem is my knowledges are limited and I have no idea how to extract the 2 main information from this module i.e. X and Y (from pitch and roll axes). When plugged to a PC (using the RS232 or RS485 interface), a software is provided from the company to extract these data. In my case, I would like to connect it to an ESP8266.
If you read the datasheet (the pdf is at the top of the link above), I have a feeling it would be possible to get these data (see p.8 and after) but I don't know where to start. Before buying one, I would like to make sure I will be able to.
Can someone tell me please if it would be feasible and give me a direction?
Thanks for helping me on this.
Actually, I would prefer to use the ESP8266 if possible.
If I can simply use these commands get---x and get---y in my arduino program, that would be fantastic. Would it be that easy? No problem for the conversion into variables indeed.
Can I just connect the inclinometer directly to the ESP? They provided me the scheme of the PCB from another series but it should be very similar:
Those pins "UART Rx" and "UART Tx" are hopefully normal TTL level signal.
What happens if you apply 5V to pin 1 of Connector 1 (and GND to pin 2) and measure pin 5 and 6 of Connector 2. If the "UART Tx" is near 5V, then you might be able to connect that to a ESP8266 (I would use a protection resistors of 1k). Maybe those are normal logic signals meant for a RS-485 module.
Note: The ESP8266 is more or less 5V tolerant. The ESP32 is not. If you want to upgrade to a ESP32, then you need a level shifter to convert the signals to 3.3V.
You could try to power the Connector 1 with 3.3V and hope that the serial communication still works. It is out of spec, but it might work.
Can you measure both GND pins 2 are connected to each other ?
Maybe they have a optical isolation for the serial port.
Where do you get that extra serial port of the ESP8266 from ? You need the first serial port for the Serial Monitor of the Arduino IDE and to upload a sketch.
@Koepel Sorry, another quick (and stupid) question. I was looking at the RS232 to TTL converter you mentioned. Just to be sure, if my device needs 12V and the ESP 3.3V, I need to connect the 12V on the VCC of the converter, and separately connect 3.3V on the ESP, right?
The MAX3232 has a low input threshold. It does not need signal levels of 12V. If you can power your device with 5V, that will be safer.
There are many manufacturer's that take a shortcut with RS-232 signals. You might have to test that.
Default: RS-232 with -12V and +12V levels
Good: RS-232 with -15V and +15V levels
Good: RS-232 with -5V and +5V levels
Still accepted by the MAX3232: RS-232 with -3V and +3V levels
Bad: RS-232 with 0V and +5V levels or 0V and +12V.
Worse: inverted RS-232