Arduino Update / Final

Due to a few problems and time keeping I was un able to go through with my original  idea. So I changed my idea to something a lot more simple.

I wanted to use a laser that will automatically moves at a 180 degree angel none stop. To do this I had to use a servo and a laser. I will now go through the steps and coding to how I did this.


To begin with I put together the device. The Arduino uno which is the main mother bored that puts everything together. I then attached the Shield above it.


Once I had done all that I then needed to connected the Servo to the mother bored. I then had to attach 3 wires from that where connected to the servo to the motherboard. The first wire I connected to the “Gnd”. The Gnd is what connects the circuits together to make them talk. I then connected the white wire to the 9 which is what connects the servo and mother bored.

Screen Shot 2017-06-05 at 10.43.55.png

Once I had connected up the Servo I then went into the Arduino software so I could programme the server to move at a 180 degree angle.

This is the code I used to make my arm move.

for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15ms for the servo to reach the position } for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position

To get potion right I had to keep messing with “for (pos = 0; pos <= 180; pos += 1)” what this does is control the movement of the hand on the servo and as I didn’t want the server to do a full 360 degree angle I change it to 180.

Once I had done all that I wanted to add a button to the Arduino so once you see something walk past or move past the Arduino you just press it and it will stop on it. I Will now go through the process I did to do this.


I placed the button on top of the breadboard and connected the brown to from the breadboard to the “gnd” to give it function. I then went on to connect the green wire from the button to the main port so it links to the main motherboard.

This is the code I used to function the button.

buttonState = digitalRead(buttonPin);

if (buttonState == HIGH) {
// turn LED on:
moveArm = false;

} else {
// turn LED off:
moveArm = false;


The red and brown wire links the power from the circuit to the laser which makes this function. The blue wire is connected to the “Gnd”.

The 3v Red laser – Diode Module has no code its just getting a power source which turn the laser on. Ive attached the laser to the servo which moves it at 180 degree angle.

This is a short video of my final out come. I was pretty happy with finished product but I do wish I had a bit longer to add some more functions to it. I would have added a motion sensor to the Arduino so it detects when someone or something goes past the laser. This would have been monitored through the Arduino and will tell you the time it happen.


To begin with I wanted to make an Arduino game that uses light as a memory game and you would have remembered each sequence that the light flashes. You would the repeat that sequence using an analog and point at each direction the flashes came from, if you fail you’ll have to restart. I set out to design my model in cinema 4D and with this I would have 3D printed it and managed to fit the Arduino with in the 3D print. I designed a model that would have been hand held so the Arduino game would have been portable. I wanted a stylish look that would have fit perfectly into the palm of your hand once you held it.  To gain good idea of the model I looked into other devices that are hand held and found some really good designs that helped me in the process of my design. I also had a look at other memory games most of them used language, buttons and some use of light. I felt my idea was rather unique and could evolve into much more than what it was. I wanted to add audio into and a vibration that indicates when you lose. As I had near to zero experience in using Arduino and the Arduino software I had set myself a huge task that I wasn’t actually able to finish my product I set out to do. 

When I was building my first Arduino idea there was much trial and error with the soldering. I kept soldering the wires to the Arduino and they kept becoming loose and breaking of this was problem that kept messing with my time management. As I didn’t have access to a solder I was unable to fix the problem till I was next in university and as this happen multiple times I kept having to wait till I could fix it. This was a major set back in the development of my Arduino.

I looked on the Arduino website and couldn’t find much on how to make sequences using the light. I looked on YouTube for to try and find other people’s work that might have done similar Arduino projects but there was near to nothing with what I wanted to know how to do. I did find some Arduino projects but the project where completely different and didn’t really use the parts I was using. I found one Arduino project and this was a Simon says one. The lights went off and in front of the lights there where these buttons and you would have to repeat the light sequence by clicking the buttons. This was similar to mine but I was using the analog. The issue with this he was show casing the Arduino he made so I was unable to see and use the code in my project that he used. Because of time management I was unable to begin making changes so I had to design a new idea that would fit in with the time and a lot simpler.


This idea was to make a cat toy that you would turn on and automatically move with a laser attached to it. The idea was the laser would appear on a wall or anywhere you put the device really and a cat would try chasing it around. To begin with I had to completely scrap my original idea and find parts that the university had that I could use to begin my new project. I needed an Arduino Uno v3 this is the motherboard that will be connecting everything, this is probably the most efficient one I chose to use before the Arduino was small and was hard for me to do the soldering on. I went onto to attach attached a breadboard on top of the Arduino Uno v3 and what this did was allow me to attach more wires to it. This was a simple process as I just went on to attach the rest of the components till it was all hooked up. Problems began to occur once I hooked everything up as I had never used Arduino before I needed to look on the website to see what connects what. The instruction where very helpful and easy to use. Some of the instruction I needed where not on the site so I had Gareth my teach to help show me what connects to what so I could learn myself.


Once I had hooked all the wiring and components up I had to connect the Arduino to the Mac that the software was on. I had no idea what I was doing but with help from the teacher and YouTube videos, I gained good knowledge of what I was doing. With a lot of trial and error I finally managed to get the servo that I hooked up to move back and forth at a 180 degrees. I then got some tape and taped the laser around the top of the servo. I found the process pretty straight forward till I got to adding the button, the button was for when the laser aims at a object you press it and I will stop on the object. I found it really difficult trying to programmed the button to link in with the laser. I managed to get the button work slightly but once you pressed the button it would top after it completed the 180-degree rotation which was annoying as I didn’t want it to do this. Because of time I was unable to figure out the issue and this really bothered me as I just couldn’t figure out how to get it to work.


What I could have improved on. If I was able to redo this project I would have planned my time management out a lot better as it was a time consuming project having to build, solder and code. It was mainly the soldering and coding that took up most of the time because of all the little problems having to fix the soldering. Then coding to was a time consuming as I had to learn the code from scratch and to keep tweaking till I managed to get the code right once it was all hooked up. One of the biggest problems was when I changed my entire idea because everything I had planned to do was just a huge chunk of time I wasted trying to design an idea that I never ended up doing.


Overall I was happy with my final project. I like the idea of it and if I wanted I feel I could have actually designed it into an actual device that you can use at home. I enjoyed this project and learning how Arduino works but personally I couldn’t really get to grips with it as much as I would like to have.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s