Kind of lost, how to sense rotation, what hardware to use?

hello

I haven't used arduino before, but I'm working on a project and looking for advice. The project is a puzzle where various puzzle pieces are arranged in a grid and can be rotated in increments of 90 degrees, the puzzle is solved when the pieces are all rotated the right way. The puzzle is part of a larger project of connected puzzles.

I want to implement this by mounting all the pieces on dials that can rotate in increments of 90 degrees, and are arranged in a grid. Some sort of electronic sensor would be able to tell when all the dials are rotated the right way and send a signal that the puzzle is solved. I think everything would be connected to a single esp

Does this goal make sense at all? if so, what sorts of hardware would be useful for it? where could i find a dial that can rotate increments of 90 degrees only?
if not, what other approach makes sense?

thanks so much!!!

Welcome to the forum

How many puzzle parts will there be and what size are they ?

I ask because cost could be a factor in deciding the best solution

A multiposition rotary switch is a possibility.
Example 4 position, 1 deck

These could be wired in series such that only when the selected positions on all switches is correct would current flow to produce a signal.

36, 6x6 grid of them
in my paper and cardboard prototype, 3cm by 3cm squares space for each piece, but the pieces themselves are like 6 mm wide

however these are flexible (probably not much bigger or smaller though)

neat! thank you so much!

Welcome!

There are a lot of ways to detect piece orientation. For example:

  • Magnets + reed switches (or Hall sensors)
  • Color dots + optical sensors
  • Machine vision (camera + software)
  • Barcodes / QR codes
  • Mechanical keying or conductive contacts

To give you a useful recommendation, we need a bit more detail:

  • Are the pieces removable, or fixed in place and only rotate?
  • How much space do you have under/behind each piece for sensors?
  • Do you need the system to be tamper-resistant, or is this for casual use?
  • What controller are you using (Arduino, ESP32, Raspberry Pi, PC, etc.)?
  • Do you (or someone on your team) have experience writing code?

A photo or sketch of the puzzle mechanism would help a lot.

  • the pieces are fixed in place and only rotate
  • ideally if there are sensors it wouldn't take up a lot of space, but i'm not sure at this point
  • i think the more durable the better, a lot of people are going to be using it and not all will be gentle
  • esp huzzah32 feather (i have access to more hardware if need be but i doubt ill need it)
  • i have experience writing code but not in c++, but several people on the team have experience with c++ and can help me out
  • still not sure about the mechanism so not sure where to start sketching it, but i'll try to get back to you on that

Maybe my english is not so good, or the description is too vage.

Is not just a detection problem, but also a construction problem. What materials are you going to use? Is this just a 3d printed puzzle? It has different colors? Different shapes? Will it be durable or just cardboard?

I suggest doing some research about all the posibilities and then narrow the search to what is used on similar devices.

Multimeters use traces, this might be a possibility to detect possition. .


Other posibility could be color detection (if the puzzles can be designed with different colors on every piece) or light detection (is pieces have different shapes).

You could use a simple switch or something like this:

This is the best and cheapest solution, all the others, which would work, are way too expensive or complex, and not all would have the positive click that you need on this sort of project.

You can get switches from many suppliers, even eBay. Look for a four position switch. If necessary ask the eBay supplier what sort of switch this is.

You have to make sure that these switches will be able to make continuous rotation, and not just have four positions and then stop, meaning you have to wind it back when it reaches the end.

Depending on the constriction of the switch, it could be modified to continuous rotation by filling away an end stop. I have done this myself in many projects.

thanks! i agree with you and @jremington that this makes the most sense.

thanks for everyone for the advice

So there would be 4,722,366,482,869,645,213,696 combinations. Do you think it will ever be solved?

It's a logic puzzle, there are rules you can use to figure out what the correct answer is

honestly it's not that hard seeing from the playtesting i've done

Are you intending to buy all the components? From what I read from your description your device could be made quite simply and use a conductive rotation piece and a contact point at the correct orientation. Then a battery and LED would tell when the entire board had all the pieces correctly positioned.