Arduino OpenstreetMap project help

Hey everyone,

I’m starting a new project and could really use some guidance! I’m building an Arduino-powered map system that will display my GPS location on a TFT LCD screen and show map tiles of my surroundings. The system will use a GPS module for location tracking, and I plan to download and display tiles from OpenStreetMap.

Here’s the plan for the project:

Arduino Uno: The main controller of the system.

NEO-6M GPS Module: For tracking the current location.

TFT LCD Display (2.8” or 3.2”): To display the map with the current location.

SD Card Module: To store map tiles.

ESP32 (optional): For Wi-Fi functionality (fetching online map tiles in the future)

I plan to use OpenStreetMap and download map tiles for my city. I’ll use a tile generator to get the map tiles at zoom level 15, storing them on an SD card.

I’ll be writing a sketch that reads GPS data from the NEO-6M GPS module and displays my location on a map on the TFT LCD. The tiles will be stored on an SD card, and the program will need to load the right tile based on the GPS coordinates.

Initially, the map tiles will be pre-loaded onto the SD card, but I might explore using Wi-Fi (via the ESP32) to fetch online map tiles in the future.

Where I need help: I’m concerned about the Arduino Uno’s memory limits. Will it be enough to store and render the map tiles, or should I upgrade to something like the Arduino Mega or the ESP32 for more memory?

I plan to use SPI for both the TFT display and the SD card module. Has anyone successfully displayed map tiles from the SD card on a TFT screen? Any advice on wiring them up and handling the storage?

Once I have the tile numbers (based on latitude and longitude), how can I ensure the Arduino fetches and displays the right tile quickly? Does anyone have experience using Arduino with map tiles (especially PNG files) on a TFT display?

What’s the best way to handle offline tiles efficiently? I’m thinking of pre-loading them on the SD card, but I’m open to suggestions. If I want to use online maps with Wi-Fi in the future, what would be the best approach for fetching and managing the tiles?

Any tips on making sure the map rendering and GPS updates are smooth? I want to avoid lag and ensure the system runs as efficiently as possible with the available resources.

I’m just about to starts, so any pointers before I dive in would be great!

I imagine you'll get the much the same answer here as you'll get on Reddit where you posted the same question, seeing as how it's mostly the same people in both places.

I think you're vastly overestimating what the hardware you're describing is capable of.

Regarding the last sentence, i don't really want some sort of google maps level map. Just a cool little cycling map that shows bike lanes and stuff

My advice would be to buy a handheld GPS. Or use a map app on a phone. You will save neither time nor money trying in vain to DIY. The fact that you're asking such basic questions is not a good sign that you're at a level to attempt such a project. If you were, you'd have a better handle on what hardware was actually needed to accomplish it and wouldn't need to ask.

See, where I live a GPS phone costs upwards of a hundred bucks. The places I enjoy cycling in, also tend to have very spotty coverage so Google maps almost never loads. I've also got an approaching vacation, without too many responsibilities, and I was looking for a summer project earlier. Time isn't really an issue, I just want to know if such a project is somewhat possible with a years knowledge of arduino.

the same for me. There are many countries where Google coverage is a bad
or has a wrong data.
But there are many GPS maps in the net other than Google - OpenStreetMaps, MapsMe, OrganicMaps etc. In some of them you even able to add your data in the map.

True

Sorry, I didn't express my thought clearly. If Google doesn't work in your area, it doesn't mean that the only option is to make a homemade GPS with arduino and TFT. You can install OpenStreetMaps or MapsMe on Android phone

Yeah i know that, but like I want to build a system that's a bit like the one in this video:(https://www.youtube.com/shorts/X1x_s-o21T8)

if you create a google account and login into maps, it gives you the option for off line viewing. You can download tiles and they are stored locally and the GPS will still track and

if you ave an iPhone, you can also have an off line mode

As far as I'm concerned, when I ride my bike, I use komoot. You get many different maps, can track your path, build and follow an itinerary etc...

Ah thanks for the app

I'm doing a similar project but using esp32s3 with 8MB PSRAM. I render the maps on the device from XML versions of OSM maps. (I preprocess the OSM map data to remove the metadata using Python code on my PC before putting it on an SD card so the files aren't too ginormous)

See https://terrycornall.wixsite.com/website/post/e-ink-gps-device-project for the reasons why I want to roll my own and some early attempts.

I find that having 'lots' of memory to use is essential as the paths that make up roads and rivers and so on can consist of many lat/lon coord pairs and reading them repeatedly from SD can get slow.

If you plan to pre-render the map, probably your biggest memory need is for a display buffer. You might even be able to get around that by drawing straight from SD to the display and not having a memory copy of the whole map. (It's faster if you do have a copy in ram though)
Depending on how you plan to draw your position on the map, you might get away with just a small chunk of memory that saves the part of the map you are going to 'dirty' so that when you need to refresh the map you can copy that part back without having to
draw the whole map again.
If you don't care about slower updates, or if you are OK with leaving the 'dots' of previous positions on the map, you could forget about refreshing the map. It works out fairly well as an indicator of where you've been. Can get confusing if you are looping back on yourself though. Maybe a different color for 'present position' versus 'old position' and just draw over old dots. Or get clever with XOR drawing, which means that drawing a dot twice in the same position effectively erases it and restores the original map. (Works great for monochrome. Can be done for color) However for that you do need a copy of the original map in memory.
One thing to look at regarding the GPS is if it can be told to send you only particular NMEA sentences. Some devices will by default send you a lot of info you don't care about.
Detecting when you have fallen off the map tile currently being displayed is easy. You will have to have info about the 'bounds' of the tile (i.e. corner lat/lon coords) and comparing the GPS info to that will tell you if you need a new tile. On the other hand, to keep it simple, just have one tile that covers the entire area of interest.

If you are doing this for fun and education, I encourage you to define some simple objectives and just go for it, with whatever hardware you can get your hands on. Faster and bigger are nice but trying it with constraints can bring out the best in a project. Or at least inform you about what you really, really need to get next time.

You do not need a map-app in a city. Just know NSEW and Sun position.

If you want better-than-goggle bike routes, use

cycle.travel

When I was a young teen, I went on a solo, 200 miles bike ride, over three days, always returning home before dark (and dinner, and bed). I used a compass, paper maps and hand-drawn strip maps. Internet wouldn't happen for twenty years after I finished. No bike lanes. Dogs everywhere. Never saw another bicycle until I got near home.

Enjoy the ride, or you will miss it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.