
6Jakes (Customer) asked a question.
I have an ultrasonic sensor UK1F-E1-0A connected to the A6 pin on the P1AM. I set P1 at 9 inches and P2 at 36 inches. My code is pretty simple for now. Every 500ms, I do an Analog Read from A6 and output the value to the COM port. At 9 inches, the output is 1023; at 36 inches the output is 309. This is very similar to other devices I've tested with. However, as I move my block further from the sensor, the output remains 1023 until I get to about 21 inches then it starts dropping off. If I measure the current across the 250ohm resister, it does begin to drop as soon as I start moving the block. At 22.5 inches (about half way) the input is reading around 960, but the current reads about 12mA. I've done basically the same thing with a laser and an EZ-Array light curtain with an Arduino Uno and it worked fine. Any suggestions are appreciated.
For a start, the SAMD21 in the P1AM is a 3.3 volt device, 20mA across 250 ohms is 5V, significantly too high, maybe try a 150 ohm resistor (for a single standard value resistor, or maybe two 330 in parallel for 165 ohms)