Greetings, I’m working on my first arduino project involving a APA102b and 4 Sharp GP2Y0A21 Distance Sensor. This project is working pretty well but the stability isn’t there yet.
I need tips on the wiring for the LED strip and 4 sensors. For now, I’ve directly connected all 5V/GND (1 LED,4 sensors) into my breadboard.
Problem is the readings from the sensors are crazy, juggling from 50-250 when nothing is detected. I disconnect the LED strip and 3 other sensors for testing and found out that the readings is very accurate, ranging from (50-55).
Any proper way to wire all these?
Thanks, @Tod_Kurt . Nothing quite like the (wise & weary!) voice of experience.
What would you recommend?
We tried a bunch of things: separate power supplies for LEDS and Arduino/sensors, 10uF & 0.1uF caps at both the Arduino and the Sharp sensors, and shielded cable for the sensor run. Each seemed to help a bit (didn’t have a scope at the time to test). But a workaround that seemed to help the most was to have >100msec pauses between updating LEDs and reading the sensors. Basically let the power stabilize.
Hello guys. Thanks Scottie, Mark, Tod for your replies.
@Mark_Kriegsman I tested the sensitivity when the LED is running. During patterns like rainbow cycle, the sensors readings fluctuated a lot. Later, I will try to provide a steady power with capacitors between the sensors and arduino. Thank you.