I have tested it and it seems to work via a sample exec that connects via usb and outputs tilt values. So i think the sensor is working correctly
When i set up the circuit to talk to the sensor via serial- i do get continous readings back from the sensor but they are all garbled and do not represent readable strings like:^*&^@&^WEUYI....
I am using NewSoftSerial library and i was wondering if i can actually use this lib connect to this type of sensor. The factory default baud is 19200, 8, 1, N according to the specs. Any help or tips would be much appreciated
but they are all garbled and do not represent readable strings like:^*&^@&^WEUYI.
That sounds like either incorrect baud rate or an upside down signal. Is the output of your sensor RS232? If it is you will need an RS232 to TTL voltage converter between your sensor and the Arduino.
first i would check the proper operation of the sensor with hyperterminal on a PC. If this works (baudrate correct), then i would set the baudrate of Serial to the same baudrate or higher as mySerial, may be the 64 Char buffer overruns, if the sensor transmits without any delay.
yes i have been checking the baud rate but i believe that it is correct.
and yes the connection is rs232, but i do not have a converter. I just have taken the lines directly from the serial port and connected to the arduino. Perhaps this does not work. Yes your right i should be trying to connect to a pc's hyperterminal first and validate all bauds. Not sure what you mean by 64 char buffer overruns but will look into that too.
not sure what upside down signal is but ill look into that too
Thanks for the advise
To read RS232 signals, you need an interface like a MAX232 chip. This converts the RS232 voltage levels to TTL levels the Arduino expects on its serial pins.
RS232 uses negative voltage to indicate a "1", whereas TTL signaling uses a positive voltage to indicate a "1". The MAX232 chip performs this inverting for you.