NodeMCU & KY-032 obstacle avoidance

NodeMCU & KY-032 obstacle avoidance

The KY-32 obstacle avoidance module, part of the 37 sensors set, uses an infrared light and an infrared receiver to determine whether something is in front of it. Even though the specs say you can set the distance to between 2 and 40 cm’s, most have only managed to get a little over 10 cm. To do this you have to turn the blue/white potentiometers. Turn the one on the left all the way counter clockwise. Turn the other all the way clock wise. That should set the maximum distance.

To connect it to the NodeMCU, you treat it as a analog device. Connect GND to ground. Next to is Vcc which you connect to 3.3v and next to that is signal which you connect to A0. To read the value, you use the function adc.read(0).

I have not been able to use it yet as a digital sensor (using  a trigger) which would allow for having 2 sensors on 1 NodeMCU.

 

One thought on “NodeMCU & KY-032 obstacle avoidance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s