Is there anyone who can help me with the use, visual or video
JaneYu 2023-04-14 05:47:09 102 Views9 Replies Is there anyone who can help me with the use, visual or video
Any material that is highly translucent and soft enough can be used for this rain sensor.
JaneYu Ok, so I'm having weird results. Sometimes the commands return data, most times not.
And it seems like each command only works once or so.
I've written a little Circuit Python program (trying to basically build a little "Hello, World" type of program.)
Using a XIAO RP2040
With the mini expansion board.
I have a grove cable which has single female pins on the non grove end.
From the black pin on the grove connector, I run that (via jumper) to the red pin on the sensor cable. (G to G)
From the red pin on the grove connector, I run that (via jumper) to the black pin on the sensor cable ( 3.3 to 3.3)
From the white pin on the grove connector, I run that (via jumper) to the yellow pin on the for cable (TX to TX)
From the yellow pin on the grove connector, I run that (via jumper) to the white pin on the sensor cable ( RX to RX)
That's as per the manual.
Here's my little CircuitPython program
"""CircuitPython Essentials UART Serial example""
import board
import busio
import digitalio
print("Starting up")
uart = busio.UART(board.TX, board.RX, baudrate=115200, bits=8, parity=None, stop=1, timeout=2)
# This should show system status and clear system error status
uart.write(bytearray(b'3A020000C7'))
data = uart.read(10)
print(data)
# This should show Firemware Version
uart.write(bytearray(b'3A0000004B'))
data = uart.read(10)
print(data)
# This should command module to wake from sleep mode
uart.write(bytearray(b'3A91010088'))
data = uart.read(10)
print(data)
# This should give us chip temp
uart.write(bytearray(b'3A100000EF'))
data = uart.read(10)
print(data)
# This should show rainfall state
uart.write(bytearray(b'3A0100000D'))
data = uart.read(10)
print(data)
All of those byte sequences are from the manual. (and I have gotten a response for most of them, but only once -- and it looked like the response was duplicated in the output stream... and cut off after 10 bytes of course... and I never saw the CRC coming back..)
My current output is :
Starting up
None
None
None
None
None
Which makes no sense to me. Those values are taken straight from the documentation. Any ideas??
JaneYu I've tried (today) a Sparkfun Thing Plus RP2040 with same code. Exactly same results.
I can try other boards, but I feel pretty confident that these two boards work properly.
And given that I got good data at least once, I'm feeling fairly frustrated that I can't get consistent working behavior. The code isn't that complicated... Any thoughts?
how to calculate temperature?
3A 90 xx xx xx
int temperature = (receivedData[2] << 16) | (receivedData[3] << 8) | receivedData[4];
gives an incorrect value...
JaneYu Sure, you could find this wire info in our product page.
But the wire color of this product is really easy to mislead users.
Sorry for the inconvenience that may caused to you.
JaneYu I used the same connection I am getting garbage values can you provide the code to get the data from the sensor ????
JaneYu 

