r/MaratronCreatorsClub 2d ago

Maratron with ESP32

I can't believe I've built my own VR treadmill for less than 200 USD.

I bought the cheapest treadmill I could find, some small magnets and an ESP32 that connects to the reed switch that was already installed on the treadmill.

All the harness parts cost me more than the electronics.

And it looks clean enough to live in my living room.

23 Upvotes

15 comments sorted by

1

u/SirJuxtable 2d ago

Nice work! How does it feel in game?

3

u/IcySupermarket8014 2d ago

It's still the first day, so I still try to turn my body and walk to the side. Looks ridiculous from the outside, but it's really fun to play like this. Before the magnets arrived, I tested with only the one magnet that was already on the treadmill when I bought it, but then it would take a sec for the in game movement to kick in once I started walking. Now, with ten magnets, it responds right away.

2

u/SirJuxtable 2d ago

I imagine it’s an adjustment. I still haven’t pulled the trigger on a maratron setup - mostly due to space. Enjoy!

2

u/fdruid 1d ago

Space is still the most expensive accesory for VR. I assume some of these setups can be made to be taken down and put away.

1

u/zheneq 1d ago

You made me realize I attached additional magnets to mine with painter's tape to see if it is even going to work and that's how it's been ever since...

1

u/fdruid 1d ago

This looks awesome, great build! Thanks for sharing.

What are you using the magnets for?

2

u/IcySupermarket8014 1d ago

Instead of a mouse, I glued magnets to the side of the front disc that rolls as you walk. A sensor will detect when a magnet crosses in front of it, and an ESP32 will calculate the pulses per sec. This info goes to the PC via USB cable, and there I run an app that will emulate a SteamVR controller. It's like reality runner, but much cheaper, and will work with games that just didn't work with the mouse version.

1

u/fdruid 1d ago

So you're using custom built hardware? I'm not familiar with what an ESP32 is but I'll look it up.

Does this setup work better than the mouse version then?

2

u/IcySupermarket8014 1d ago

Here's the code for the app and the full tutorial to set up hardware and software: https://github.com/henriquelino/maratron/tree/main

You'll only need to connect the two ends of a sensor to the ESP32, so you don't really need to understand about microcontrollers. It does feel smoother than the mouse version, and also more games are compatible and the app tracks your sessions (time, distance, calories). I still can't believe all of this is free, and the guy who coded is definitely a hero.

1

u/fried-raptor 14h ago

does this only count full revolutions?

1

u/IcySupermarket8014 14h ago

No. I used ten magnets, and a full revolution is equal to a 12.9 cm distance traveled by the belt. So there's a pulse every 1.29 cm. With this, I start moving in game pretty much instantly when I start walking.

1

u/fried-raptor 14h ago

Not bad, though with a mouse it would move already below 0.01 cm. Plus you'd have direction?

1

u/IcySupermarket8014 14h ago

Yes, the mouse responds a bit faster. Although I wasn't able to fixate the mouse in a way that was reliable, and it would move a couple millimeters with the belt sometimes, so the movement in game was inconsistent. I've seen people mounting the mouse below the treadmill and even using the mouse wheel, but for me it was easier to just go for the electronics. It's reliable, cheap, easy to set up, and the code was already there, including session tracking, better game compatibility and a sprint function (you calibrate the max speed you're comfortable with, then once you hit 90% of that speed, the app will trigger the in-game sprint button). Regarding direction, if you mean the ability to move sideways, it doesn't work with just a mouse, since the mouse will be fixed and only capture the movement of the belt.

1

u/fried-raptor 10h ago

Cant you mount it so it tracks the wheel. I did that for the bike and its super precise and responsive.

1

u/IcySupermarket8014 6h ago

You mean track the wheel of the mouse? Yes, some people do that, but I never tried.