im doing a project where i have to connect various sensors and send the data to cloud and one of those sensors is dm500 ultrasonic density sensor which has a rs232 output. so i used rs232 to ttl converter to interface it with arduino uno im using, but there are lot of problems like
sensor data is not displayed in the format written in the code(it displays the same as it in hyperterminal)
data is displayed only when the arduino board is reset
data is displayed only once a 40 sec if i programmed it to reset continuously
so i donno what to do with this can anyone help me with this one??
My crystal ball says the problem is on line 119719819987199 of your code. But, maybe that's its serial number...
You posted no code. You posted no schematic. You posted no link to the hardware you are using. You posted no program output. So, obviously you don't really want help.
this is the code i used but i get values only on pin 0,1 that too with all the problems i meantion before
and coming to the schematics i made a null modem and
density sensor gnd,vcc,tx,rx to rs232 gnd,vcc,tx,rx and then
ttl converter rx,tx,gnd,vcc to arduino tx,rx,gnd,3.3v respectively
At that point in time, the following serial character hasn't arrived yet.
You never check if you overran the end of the array[20] array. You could be writing to memory you don't own. Use a named constant for the size.
When you print the array, how does the print() function know where the end of the array is? It is expecting a C-style string which has a null character at the end. Maybe Serial.write(array, i); will do what you want.
Use code tags next time. This is your first warning.
i tried to use the same code with ultrasonic sensor echo pro, and it gives data correctly and i want to post this data to the cloud. i can send the data to cloud as " Distance:D003.4T024*C " but i want to post the data in json array format as the backend guy told the server could only accept data in json array . so can you tell me how to do this. i have no idea about json array. i tried to gather some info from net but i didnt get any clarity. so can you help me with this?