Maze Mapping with Arduino

What I'd like to do is create a robot that can navigate a maze. This stemmed from an idea I had to create an autonomous lawn mower.

My robot should be able to do 2 things.

  • Create an accurate map of its surroundings
  • Create a route based on said map to follow

Because of the limitations of the arduino I know that I won't be able to create anything on the actual arduino. The arduino will only navigate the maze using simple logic and record data from its sensors. I will have to design some sort of program on my computer that allows me to take the serial input from the sensors on the arduino, create a map, and eventually create a route from that data.

Right now I'm shopping around some and researching a bit on what type of senors I would need, how I can record the serial monitor, and other stuff too.

This is what my shopping list looks like

  • Arduino
  • Motor Driver
  • Plexi Glass chassis with 2 TT motors and a wheel encoder cut out
  • Time of Flight Sensor (budget LIDAR)
  • Triple-axis Accelerometer+Magnetometer
  • MicroSD breakout board

I'm using a Time of Flight Sensor instead of an ultrasonic senors because they have a much more narrow "cone of sensing" compared to an ultrasonic sensor, which can lead to inaccuracy https://www.hackster.io/paramaggarwal/mapping-a-room-wh-ultrasonic-distance-sensors-9725b7 ( see that for more details) I also thought about using Bluetooth or WiFi instead of the SD, but they were more expensive than the SD card.

I'm also wondering if I need a photoelectric speed encoder (like this one) https://www.amazon.com/SODIAL-Measuring-Sensor-Photoelectric-Infrared/dp/B0757DT15F/ref=sr_1_17?ie=UTF8&qid=1533876498&sr=8-17&keywords=Photoelectric+Speed+Sensor to measure distance, or if the accelerometer can do that fairly accurately.

So do y'all think this project is do-able? Id love to hear some suggestions and criticisms of my current thought child!

I'm also wondering if I need a photoelectric speed encoder (like this one) https://www.amazon.com/SODIAL-Measuring-Sensor-Photoelectric-Infrared/dp/B0757DT15F/ref=sr_1_17?ie=UTF8&qid=1533876498&sr=8-17&keywords=Photoelectric+Speed+Sensor to measure distance, or if the accelerometer can do that fairly accurately.

Both won't be accurate enough because you're accumulating the measurement/traction error. That's why most lawn mowers simply mow in a random route as keeping a location just by measuring the acceleration or the wheel rotation isn't accurate enough.

Ever heard of the Japans Micro mouse contest, there is hundreds of codes out there and designs, A quick search for Arduino micromouse found a tutorial for you that you could build upon.

Arduino-and-ArduMotoMicromouse

2017 micromouse contest

There so coooool, it gets one chance to learn the maze and then it has to find the cheese as quick as possible.

Wow thanks! I've never even heard of the Micro mouse contest!

Both won't be accurate enough because you're accumulating the measurement/traction error. That's why most lawn mowers simply mow in a random route as keeping a location just by measuring the acceleration or the wheel rotation isn't accurate enough.

Is there any way to get an accurate measurement of the location?

Watson221:
Is there any way to get an accurate measurement of the location?

Yes, these "mice" use sensors to detect the walls and this enables them to correct any inaccuracy from the speed/rotation sensors.

As for mapping and solving the maze, there are much more powerful Arduino compatible boards available these days, compared to Uno/Mega etc, so it should be possible. For example check out Teensy 3.2, 3.5, 3.6 or the AdaFruit ItsyBitsy M4, Maple Mini. But think carefully before choosing esp8266/esp32 because anything with wireless capability would probably violate the competition rules of Micromouse contest, should you be thinking of entering.

Finally, I would advise that this project will be fascinating with lots of fun and learning. But it will take several.years of effort, patience and determination. It's not a project for the faint hearted! Start small and simple.

To map a maze, you actually do not need to know the distance, you just need to know the connections between points. Think London Underground map style. That makes it a lot easier. You map your route, and get to your destination by travelling from station to station (in a maze that would likely be junction to junction - you may even be able to ignore corners as they don't actually change the route you follow), and changing lines at specific stations. It'd be a lot more complex a map of course than the London Underground one.

I am starting to understand what you mean by points. However, I don't understand how I can translate that into hardware. Like what would the distance sensor look for? Or how would I connect the dots?

Normally the mouse would have 3 or more distance sensors. One pointing forwards and two pointing right and left. If the mouse gets too close to the wall on one side, it adjusts the motor speeds slightly to steer away from the wall.

There are many algorithms for joining the dots, such as "flood fill" and "A*". But as a beginner, the simplest to start with is the "left hand wall follower" algorithm.