Sharp IR sensor with color feedback

Arduino


Here is a simple way to implement distance sensing and an Arduino. The website has more pictures and all the Arduino code so you can easily make one for yourself.

I bought a Sharp GP2Y0A21YK0F Distance Sensor to use in my robot. It was very easy to see the data returned in a serial console window, but I thought it would be cool to see the distance in zones represented by colors from a tricolor LED. Then you would not need to be connected to the computer to tell distance. Green would indicate a safe distance, yellow would represent a cautionary distance and red would be for distances that would require my robot to take evasive action.

Read more about Sharp IR sensor with color feedback

Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK