Here I explain my roll in the project, the electroncis part. I searched how it works the jack and how to implemented in our project, and I did also the connections with the drives and the program to our machine.

Jack connection

Jack connection

To do the photos with the mobile we search how it works the stick selfie, we saw that we need a jack with 4 'pins' and to take the photos it is necessary has the same voltage in the MIC pin and the GROUND pin. This page is very useful to understand how it works. I took the jack of an audio jack, I take out the headphones and the microphone, and with a tester I identify the pins. In our case, the jack is OMPT Standard (but also exist CTIA Standard, the pinout of this change the ground for the microphone), which has this pinout:

First, I connected the wire with a limit switch. I tried with my mobile, but it didn't work. I search a little more and I found that in some mobiles it is necessary an app. I download the app SelfieShop Camera and I configurated. To do it, open tha app and on the top-right there is the configuration (three bars), click on it. Here, you has to go to Monopod connection wizard, there are three pages, in the first one, click next, in the second one it has to detect the button, press the limit switch, on the third one click next if it has detected the button to shoot the photos.

It is possible it does not work with some mobiles, I tried with a SAMSUNG and BQ it works with the first one but not for the second one.

For the program with Arduino, we took out the limit switch and we put a relay, whcih use three wires, the VCC (5 V), GND and IN, the last one to connect with the pin number 3 of the Arduino.

Drives connecctions

We had three steppers, which needs a driver. While we did the test, we used two differents drivers; A4988 and DRV 8825. The connections of these drivers are:

Drier A4988 connections Drier DRV 8825 connections

We used the pins between 8 to 13 of the Arduino to control the steps and directions of the three motors.



Arduino program

Program for the machine

Something about programming to understand the program:
The while loops will loop continuously until the expression inside the pharentisices becames false.


The if tests whether a certain condition, and depending on it, it do an action or other.


The % is used to obtain the remainder of a division.


The Arduino's program are structure with three parts. The first one is to declare the constants and variables. The second one, to initialize the digital pins, for example as INPUTS, OUTPUTS, etcetera. The last one, where there is the different steps of the main program.

As I said before, firts I declared all the cosntants and variables of the program, which are the number of the direction and step pins for the three motors and the pin to take the photo. Also, there is the steps, which is the number of steps to do a revolution and the stepDelay, with this variable it is possible to modify the speed. The second one, I configured the different pins of the Arduino as a OUTPUTS. Finilly, I did the program. This program, turns the platform and stops every 36 degrees to take a photo, when it finish the first revolution it stopped and the arms go up 36 degrees and stops to do another time the revolution of the platform taking the photos, when it finish, the arnms go up another 36 degrees and repet another time the revolution of the platform. in that way, we obtain 30 photos of the object, and we can obtain the 3D of it.

First, we activate the direction of the motor, you can put LOW or HIGH, depend in which direction you want that the motor turns. As I said before, the stepDelay is to modify the speed. The y variable is the number of steps of the arms motors, I initialized as a 0, and I did the first loop, which loops continuously when the y is between 0 and 40 (as we known, 200 steps are 360 degrees, so between 0 and 72 degrees). Now there is the first if, which has two conditions, first when (y % 20) == 0, this will be true when the y is a multiple of 20, so in 0, 20 and 40 ( 0, 36, and 72 degrees) and the second condition is when it does not achive this one. In the first case, there is another while loop, which it loop consinuously betwwen 0 and 200, that is a revolution of the platform engine. In this loop it will move this motor except when the x variable (which is the number of steps of the platform motor) is a multiple of 20 (in 0, 36, 72, 108, 144, 180, 216, 252, 288 and 324 degrees), in that case it will shoot the photos. In the second case, it will move the two arms motors.

Documentation of the machine

week 11 (RAR)

Previous assigment Home Next assigment