Join our community on Discord

We’ve built a robot that we can drive, but until it uses some sensors, it isn’t showing much automatic behavior. In this chapter, we’ll find out about the different types of range-finding distance sensors and choose a suitable type. We will see how to mount the chosen distance sensor arrangement to the robot, connect it electronically, and then write code for it.We will look at how to get data from the distance sensor. We will then see how to serve that data via MQTT and transform the data to visualize it on our phone app.You will learn about the following topics in this chapter:
- Choosing between optical and ultrasonic sensors
- Attaching and reading a distance sensor
- Making sensor data available in MQTT
- Viewing sensor data in a smartphone app