Briefing

After a few minutes wondering how to do this, I came up with a very simple idea. I'll use the P2 connector as my interface, each audio channel will send a tone relative to X and Y and the MIC will receive another tone to indicate when the user is solving the maze, so I can set up a timer.

The values here were just randomly chosen, nothing special about it and honestly I've got this values after testing the circuit, to design it I had in mind only the central frequency about 750Hz. And I made the circuit somehow it was easy to modify that.

Blocks diagram

Cool! Next step was to create some blocks diagram and find out what components I would use for each block. In this case I'd divided all circuit in two diagrams, one for the audio signals received and other for the mic signal sent:

Notice that the output were meant to be directly connected to the signal pulse from the microservo 9g. if you google it you'll see that the signal is a 20Hz rectangular waive with high time changing from 1~2ms, but in reality this Chinese motors have a big tolerance, so I made a circuit reliable enough to calibrate this easily.

To do all this blocks I've used some 555 timers, Opamps and transistors only :) Check out the schematics at the documentation bellow.

I did add some pots to calibrate the zero position, it would fix the tolerance problem on those servos and made everything easy to calibrate, considering the UX depends a lot on how balanced the maze is in the center position.

I also choose PTH resistors in functions that might be good to change. I have in my inventory a lot of PTH values but not so many SMDs, so I put SMDs only where I was 100% sure I wouldn't need to change after doing tests.

If you see the PCB and schematics have some test points. I add them to facilitate calibration.

PCB

As all components are easy to find and have DIP package, I could even use a breadboard to try its functionality, but I din't see any critical point in the circuit, so I've chose to go straight to the PCB.

Alright, once the circuit was completed I needed to design a PCB. Here there was an extra challenge "make it in a single layer board, with constrains to use a milling machine"

I did the board on Altium designer, all files are attached, my goal was to create it withing the following rules:

After a couple hours on Altium the design was ready to produce!

Assembly/first tests

After finishing the assembly I came up with the following test flow:

I've used an oscilloscope to see the 1kHz output and a two channels function generator instead of a phone for now. Swapping the two input channels could simulate both motors moving in all range.

In the video the signal being simulated with a tweezer is the metalic sphere starting and finishing the puzzle. Take a look in the mechanics, there is a hole to insert the ball and it touches a small spring to start it. Same happens at the end, the ball leaves the puzzle and touches another contact, disabling the motors and stopping the 1kHz output.

Mechanics

The idea here was to design a simple maze, that could be laser cut. I'll post all files soon.


Connecting to a phone

I like to learn new things while doing projects like this one, so I've challenged myself to learn some JavaScript and post a webpage in a https server to read the mic freqeuncy and generate different tones on each audio output acording to the phone's accelerometer.

My option was the 000webhost, and it's live now here: https://wsc2017-hdw.000webhostapp.com/ I'll probably put it in other host because the link simply doesn't work sometimes.

I was just checking the code and seems that some dependencies got updates and its not compatible anymore, I'll fix when I get some time.