Project 3 – the final product

The final form of the third project is shown on the appertaining picture.

Skærmbillede 2014-05-07 kl. 14.58.19

10177231_10154094636885065_7842262354395634737_n

The two boxes have the same dimensions, even though they are designed for two different types of Arduino board – one “ordinary” Arduino and one Arduino Pro Micro. We figured that the bread board of an ordninary Arduino has the same size as a micro Arduino, and we decided to make the boxes equally. The only difference is, that the Arduino Micro needs three AAA batteries, and so we made holes on the side in one box to screw a battery holder in place.

The micro Arduino was problematic to work with, and unfortunately, we didn’t succeed on getting it to work, in spite of massive code-work. We’re still unsure why the error occurred.

The design of the box – what we did and what we could do better

The size and amount of used material, are optimized as much as possible. The first boxes we lasercutted were way too big . We were concerned that there wouldn’t be room enough for all the components, but as we assembled the boxes, we realized that there wasn’t a need for this much space and we decided to make the box as small as possible, so that it would only contain the necessary components. Furthermore we had to consider if we wanted to have a hole for the screen or if we wanted the user to just see through the plexiglass. At first we just wanted to let the screen stay inside the box without a hole, but when we lasercutted the final box-assemblies, we got the chance to make a hole, and so we did. Now we’re happy about that decision. Even though our material is see-through, it’s more userfriendly, to have a visible and easy accessible screen.

The joystick is joined to the box via tiny srews on the top of the box. It is accessible through a hole. The hole is just as big, as the joystick is able to turn all 360 degrees around when needed.

On two of the sides, there’s air holes to make sure that the Arduino wont get overheated. They might be a little too big compared to what’s needed, but that’s something for further work and considerations.

The hole for the gate is also a little too big. This is something we made on purpose to make sure that the port would be able to fit. The size of the hole is also possible to minimalize. When the gate-hole is as big as it is at the moment, then it’s might not even necessary to have the extra air holes on the sides. There will be abundant air flow to prevent the Arduino from overheating.

On the bottom of the box, our groupname and groupnumber is written. This is a nice and simple personal touch to the product.

The code

The program is built as a state machine, which in different cases have different tasks. To initialize, we send a payload with question.ID set to 0. To get a handshake we compare the current input from the network, to see if it is 0. If it is different from 0, we are part of the game and can receive the first question with the answer possibilities. The possibilities is printed to the display so the user can see what to answer. Next state waits for the user to select an answer, and in the next state sends it. From here it returns to the receiving state and the game goes on through this cycle.

The program is controlled by our CSS  “ Current state selector” By combining with a switch statement, we can switch between states and the different tasks needed to be carried out. A runonce instance is set in state CSS=0. This is to join the game, this state is only run when starting the game.

Another approach would be to implement the FSM library from arduino.cc and code cohorently with it. Since the switch is easier to implement from paper and control we choose this method.

For debugging reasons serial monitor printouts has been included in the code, to allow deeper understanding of possible problems during testing.

For future improvement some of the states could be reduced, as they are passive and thus eliminated. The possibility to reset the game without the hard reset on the board, could make the experience more fluent.
Higher up there could be implemented a backwards control signal so everyone sending their package could be informed if it has reached the destination further out the branches of the network. Even more advanced a one connection client-server without any ADHOC to other users may eliminate other pitfalls of testing.

Below is a flowchart showing how it works.

Skærmbillede 2014-05-07 kl. 14.14.37

One thing we weren’t able to get to function was the menu. We created a drawingfunction, which shows the possible answers for a quiz, but we weren’t able to indicate the answers so that the user is able to see, what the he or she has chosen. This is something we will have to work on.

 

 

Joystick box done!

10275952_10202647235476806_8669147863797216083_n

The box for the joystick is finally cut and held together by acetone. We collected the assemblies by holding them together with a hairelastic and injected the acetone on the sides and the corners of the box. In that way we avoided that the whole box got acetone all over it.

We have optimized the size to the minimal and thereof also the amount of material.

The box is rectangular and has air holes on the two long sides. This is to make sure that the  mechanics wont get overheated. Furthermore there are holes for the cables, the screen and the joystick itself. Our groupname and groupnumber are printed on the lower side of the box. This is a nice detail, which gives our box an individual touch without disrupting the userfriendliness.

Arduino Pro Micro caused us a lot of problems and therefor we decided not to go any further with it. Instead, we changed it to an ordinary Arduino board. Before we knew if we were going to use the micro Arduino, we made holes for screws to hold up the three AAA batteries  in one of the boxes (this is also shown on the picture above). When we realised we weren’t going to use the AAA-batteries after all, we removed the batteryholder and therefore there are two screwholes on one side of the box.

 

The lasercutting session part II

The second lasercutting session took place at DTU Campus Ballerup. We had another lasercutting session at DTU Lyngby, but something went wrong during the cutting, and our work was not usable. We weren’t able to get another session at the Skylab until next wednesday, which is the same day we hand in project 3. Because of that, we decicded to go to Ballerup Campus, where we had a contact who could help us with the Laser cutter. He told us, that the Laser cutter was free to use and had lots of available materials.The laser cutting went very well, and we got all our parts perfectly cut.  The pictures below show the work:

The box from project 3 is being cut

The box from project 3 is being cut

10259324_10203027328939595_6743925829363751847_n10313957_10203027328979596_6274753576943091901_n

The components for the Foam-cutter

The components for the Foam-cutter

10308075_10203027328539585_7950093973610420454_n10245561_10203027328579586_1738228632353263683_n

The joystick – a simple overview

In order to create an overview of how the joystick will work, we have created a simple drawing, which illustrates the proces.

Skærmbillede 2014-04-23 kl. 16.50.55

The question is being send from Arduino 1 to Arduino 2, which the joystick is connected to. The options are listed on the screen, and the joystick is being flipped according to the answer in one of the four directions in X-Y-coordinates.  If ,for an example, A is chosen for an answer, the joystick is flipped 45 degrees upward and the answer is being saved on the Arduino 2.

Arduino 2 then sends the answer back to Arduino 1, where the answer is being registred.

 

Laser cutting II

We have now laser cutted two boxes for the joystick and the four plates for the foam cutter. Unfortunaly the boxes for the joystick too big. After they have been laser cutted and we have tried to put in different components, we realized that we could optimize the size of the two boxes a whole lot more. Likewise could the size of the four plates be optimized.

We decided to redesign our CAD models and laser cut again on the following Wednesday.

Even though our work wasn’t usable for the final product, we have gathered great experience on how to lasercut and this will be needed further on in our work.  The pictures below show the laser cutting section.

 

Billede

BilledeBilledeBilledeBilledeBilledeBillede

Laser cutting session

Today we’re in for a laser cutting session at 14-15 pm. It’s taking place in the library. We have two boxes for the joystick-assignment, one for the small Arduino-board and one for the normal-sized Arduino-board.

The design of the box is shown on the picture below.

qzB5E-7TxJyICloDBR9k6wODKFyXrGSJRqFy8XmiwahTx2pYDmWHRfJjckwDr8kAQw=w2266-h856

We also have to laser-cut the four plates for the ball bearings for the foam-cutter.

All in all, we have to lasercut 6 assembled objects.

Before we go, we have to finish the CAD-model and come up with a name for the construction.

The joystick

The joystick is composed of two potentiometers, which acts a a voltage divider when supplied with 5V. To read the tilt to either X or Y direction, the arduino can read and analog value to determine how far the stick has been tilted. When in the middle, the read input is around 508-519 because of noise in the reading. To determine if the user has been tilted, is when the voltage reads higer than 530 or lower than 450 to compensate for noise.The program reads the two values which is put into Analog 1 and 0. If statements determines which carachters that is set to either A, B, C, D. This is sent to the serial window to debug the behavoiur of the joystick. The code reads X values in first, and then Y, since the sticks needs to move more than 45 degress in another direction for the code to choose another character to send. The code can be put directly into the program to work with the rest of the code to determine which input the user has choosen in the quiz.

Skærmbillede 2014-04-16 kl. 17.18.00