Category: General Posts

Midterm Lock


Video Link

Code Link

I made a lock that requires three things to unlock. The first is an angle from a potentiometer shown by the rotation of the outer ring. The second is a number from one to three based off of the amount of presses a switch gets. Finally, the last is a shade from black to white based off of a light sensor. The lock is set at the beginning by setting all the values in as you would unlocking it and pressing the ‘S’ key. After that the lock will randomize to prevent itself from automatically unlocking itself.


In terms of the process I was originally going to make sort of bomb that would set off something annoying or scary but I couldn’t think of anything. Afterwards I came to this idea after looking at what I had and doing some sketches. The lock design was just going to be the angle, color and number side by side as shown in the sketch below but I changed it afterwards. It was also going to have two buttons instead of one but I found it unnecessary and limiting.


For next steps I would probably make it wireless and work on someone else’s computer rather than my own for better impact. If I were to make this a full on product then I would need to move away from the breadboard and go for a printed circuit with a nicer design. I’d also need to make the unlocking feature more normal and general purpose.


Physical Computing Midterm: CipherBot

Project Title: CipherBot

Description of Prototype: The CipherBot is a high-level locked robot that has locked away its little heart. In order to open the bot, all three locks must be solved. The first lock is a combination lock, while the last two are ciphers. The second lock is the Tap cipher, while the third lock is the Polybius Square cipher. To unlock the first lock, the dial must start from 1, and rotate to the desired value. After each number is set, the knob must return to 1 before dialling the next combination value. The Tap cipher is solved by transforming the clue into an English word, and then solves it using the tap code in order to unlock the second lock. The third cipher requires the same action as the second cipher, but using the Polybius Square methods. 

Image of Final Product:


Decoding Combination lock:

  1. Reset the dial to 1 if it is not in that position.
  2. Dial to the first combination value.
  3. Reset the dial to 1.
  4. Dial to the second combination value.
  5. Reset the dial to 1
  6. Dial to the third combination value. Leave the knob untouched after dialling to the right number. A green LED will indicate if the first lock is solved or not.

Decoding Tap Cipher:

  1. Look at the clue, and write out an English word for it. Maximum 6 letters.
  2. Using the given Tap Chart, locate the coordinates of each letter, starting from X, and then Y.
  3. Start with the first button to the left. Press it according the value of the first X coordinate. When that is done, press the number the Y coordinate represents. (Example: if coordinates are (3, 5), press on X three times, and then on Y five times). Repeat to the end of the end of the cipher. Hit submit (last button) when completed. A green LED will indicate if it was solved or not.



(Polybius Square:

Decoding Polybius Square Cipher:

  1. Look at the clue and out an English word for it. Maximum 6 letters.
  2. Using the given Tap Chart, locate the coordinates of each letter, starting from X, and then Y. Write out the coordinates with all of the X values at top, and Y values at the below the X values.
  3. Read out the numbers horizontally. That is the password.
  4. On the first button to the left, press it the amount of times it represents the value in the answer. (Example: if the first coordinate is two, click on the first button twice.)
  5. Click on the middle button to submit the value. Repeat steps 4 and 5 for all of the Polybius values. Hit the last button (submit) when code is complete. A green LED will light up indicating finished solving the bot. The bot-gate will be unlocked.polybius-square

    (Tap Code:

Image of Final Circuit:


(This image is the halfway point of the circuit building)


(Final circuit top view)


(Final circuit front view)

Final Video:

Solve password:

Reset Password:

Link to final code:

Circuit Diagram:


Notes on Process: 

Looking to the combination lock idea, I decided to make a complex locking mechanism that takes one time and effort to decipher in order to open the box/bot. I started to look into different codes such as the Morse code, which eventually landed me on a page with a list of cipher codes.

List of Ciphers:

I started to read into each one to see which ciphers are doable using only sensors, buttons, LEDs, etc. Since the alphabet one would have been difficult to use or test using a count system on a button, I looked for ones that contained numbers. I finalized with one combination lock, the Tap Cipher, and the Polybius Square Cipher.


I started coding the combination lock for the bot with the potentiometer. I created a code that works similarly to a Dudley’s lock, but unfortunately had to be truncated from the final product because the delay disturbed the rest of the program.

Code for original combination lock:

I bought some parts that would be added to the final product. When testing, two short circuits occurred and started causing my new potentiometer to sizzle and smoke. None of the parts were damaged, fortunately, but precautions have to be taken in case the potentiometer is broken.

After testing the parts, I started coding the tap code. When that was finished, I coded the Polybius Square code. Due to me not planning out the Polybius Square code better, I made a function that turns all user inputs into a Polybius Square cipher, rather than checking for if the answer the user entered was accurate. This code had to be restarted.

Code for original Polybius Cipher code:

When I was testing the code, the potentiometer and the RGB LED became very uncooperative, where the RGB LED seemed to conflict with the signal being send to the potentiometer. For that reason, the RGB LED was replaced by regular red and green LEDS.


I started coding the password resets after all of the codes worked with each other. I programmed each reset to be similar to how the user would solve the code. A separate file was made in order to ensure that the final product would not error.

Code for all password resets:

Finally, all of the code was combined to a large file. I considered looking into creating classes or libraries to separate the code so it will be easier to use, but it required a lot of external files, which became too time consuming to figure out.

Link to tutorial for libraries:

In the end, the code had a lot of errors where each lock was not communicating to one another and the set passwords did not change each code accurately. I created Booleans within the code in order to keep track of which lock the user has to decipher first. If the user gets it wrong, it will always reset itself back to the original state, making it a high-level, but brutal security bot. There were also minor errors where the potentiometer would disconnect for a brief millisecond or so, causing the locks to reset themselves. I used minor delays to stop it from disconnecting too often.

Screen Shot 2015-02-11 at 9.51.39 AM

Although the program slows down by a bit, the potentiometer sometimes draws an odd amount of power, causing it to remain at the value of two even though the knob is set at the mapped value of one. This issue does not seem to be able to be fixed with code; rather it may need an external battery to power some of the items on the board. The issue remains unresolved due to the error occurring only momentarily, as well as the potential point of burning some LEDs and the potentiometer again.

Screen Shot 2015-02-11 at 9.46.57 AM

 I have created many project files throughout the progression of the assignment in order to understand and maintain each section of the bot’s capabilities. The code for each is found in the repository of the following link:

Prototyping Notes:

I started to consider how the box would be locked as soon as I got the assignment. I took a trip to Active Surplus, Creatron, and Dollarama to get inspiration of what I can use. I came across a lock that seemed to work well as a latch if I attached it to a servomotor.


I tested the lock with the sweep code to see if works as a latch. The results were beneficial to the project.

Through out the process of building the casing, I tried to keep the ratio to the sketches I had for the robot, but due to unforeseen errors of the code, that took longer to fix, causing less time to plan out the casing. This meant I had to plan as go, which lead to a few broken material that could not be used due to size issue or detail problems.





However, planning as I went along did speed up the process for me by a bit since I got to visualize how the pieces would turn out. Eventually, the CipherBot is completed.



Next steps:

The next step to this bot would be to incorporate a few more ciphers to make the bot even more complex. I want to portray that to get to the item inside the bot and assuming the item is precious, the more precious the item, the item is more protected. On the coding side, I intend to look into libraries and classes to properly section each part of the code to make it more comprehensible. I will also try to look into adding the use of other tools and sensors to make the functionality and the surprise to make it more entertaining.


Combo Lock Spinning Hat Man

The prototype is an example of a simple combination lock using three buttons. Upon entering the correct combination, the hat is spun about by a DC motor.

Initially my ideas were more ambitious, but the painstaking tedium of assembling the parts in such a confined and self-contained fashion proved more difficult than expected, sucking up most of the time I had to spend on the project. Using the Arduino in a physical and not screen oriented fashion proved to be a challenge for me.

I would like to be able to add more inputs such as switches to create a more complex and difficult to crack password.

midterm_bb 20150210_021454


Final Prototype

Materials Use:

  • Arduino Uno
  • Breadboard
  • 1 LED
  • 3 Resistors
  • 1 Pushbutton
  • 1 Servo
  • 12 Wires
  • Paper
  • Glue
  • Stuffing
  • Thread
  • Needle
  • Ribbon
  • Tape


photo 3-2

Description of Prototype

This prototype is a game that has the objective of feeding the bunny 6 carrots in 30 seconds. The timer is indicated through the tone coming from the speaker, when the tone stops the game is over. The game starts by the push of the red button.


photo 1-4

The process was fairly simple in terms of getting the speaker, led, and servo connected to the Arduino and the coding had many references to help.

The most difficult part was making the servo stay on the bunny to make the mouth open and close, as well as attaching the jaw of the bunny to the top of the bunny’s head. To attach the two pieces I used thread and a needle and just sewed it together; this isn’t the best or sturdy way to attach it but it was the more efficient way at the time.

After testing the bunny a few times the thread came out, so I ended up hole punching holes and threading ribbon through it, tying it In the back to secure it.

As for the servo I just used a bunch of tape to hold it in place on the bunny.Since the bunny was too light I also had to use a ballon weight to give the bunny some weight to stay stable while the servo is moving.


Circuit Diagram



Screen Shot 2015-02-11 at 11.10.34 AM

Coding Link:


Next Steps


My next steps are to definitely make the piece less fragile for instance the hole punches and ribbon were far too fragile to hold the two pieces together for long, it is only a matter of time before it falls apart. In the future I would also add a time either on screen, or have a motor turning an hourglass when the game begins. Lastly I would make the box that the arduino is in looking more incorporated into the bunny theme, such as use green tissue paper on top of the box to look like grass.




LEDSprint is a two-player head-to-head reflex game. Players must hit the button that matches the current colour of a rapidly changing RGB LED to light up their row of standard LEDs before the opposing player can light up their own. However, for each incorrect button press the player is set back one LED. The game therefore is a fast paced duel of both co-ordination and reflex.


Arduino Uno

Sparkfun TLC5940 LED Driver

Adafruit Proto-Board

ON-ON Switch

Common Cathode RGB LED

12V 1A Switching Power Supply

6x Arcade Buttons

16x White LEDs




One of the most important aspects of LEDSprint from which I started my work was the idea of approachability. I wanted the design to be simple and visually intuitive. As such the interface design became my starting point. After sketching out an initial drawing of the game’s interface I compiled a list of components needed based on that drawing. After collecting and measuring the necessary components I began to layout the blueprints for the game’s case.


The design was then laser cut onto black acrylic plastic. I then used white acrylic paint to fill in the engravings of the case so the indicators I designed would be easily discerned by the players. Using a breadboard I began to prototype the switching RGB LEDs code. During this first iteration of the prototype I used a common anode RGB LED, rather than a common cathode RGB LED. Common anode requires the values to be reversed so each colour can be mixed according to standard RGB output. As a result, in the final design I opted for a common cathode RGB LED to remove the need to map those values and keep my code as concise as possible. Another oversight I made while designing the interface was failing to create a circuit diagram before I collected my components.

I realized at this point that I did not have enough digital pins to accommodate for the amount of LEDs I meant to control. I then considered either using an Arduino Mega instead of my Arduino Uno, or alternatively using an LED driver to attach all of the standard white LEDs to. I found the Sparkfun TLC5940 LED driver to be the best fit for my use. Using this component I could reference 16 LEDs on separate channels in my code. However this also meant that I would have to sacrifice one of the PWM pins needed for each of the RGB outputs. Because the design only needed to mix blue and red to create the pink indicator colour, I could move the green output to an open digital pin to resolve this issue.


I then arranged each standard LED on an Adafruit breadboard style Proto-Board so it could be soldered directly into the proto-board and remove extra wires needed to attach all 16 LEDs. The proto-board could then rest closely against the top of the case and leave room for the rest of the components and their wiring to be soldered and connected to the pins of the Arduino Uno. After the construction was complete and fitted into the case, the stiffness of the wires ended up increasing the overall height of the hardware and required the box to be re-designed to accommodate. Although advertised as an LED driver, the TLC5940 is most commonly used for Servo motors. As such the library associated with the component was configured for use with servos and not LEDs. This caused the code to function improperly. After spending time reconfiguring the library, the code then allowed the LEDs attached to the component to run as instructed.


Arduino sketch available on GitHub


In future iterations of LEDSprint I would like to add audio feedback to accompany the visual feedback present in the game already. I would also like to create a more pronounced winning result to make the experience more entertaining and satisfying to players; likely in the form of a tune and accompanying LED animation sequence. I would also revise the interface, perhaps using colour to better distinguish each player’s row of LEDs from one another. And finally, examine alternative power supply options to make the game more portable.




Week 2, Friday class

A business plan is something that will help the business for the future and it’s to help focus on the objective, helping the business reach their goal. I believe that the advantages of compiling a business plan are that the end result will be more successful because there are goals and objectives that the company needs to list in order to get to where they want. By writing a business plan the company can achieve their operation and their financial situations. By creating plans, it will be easier to know if the path is going the right way, and if there is an issue, another plan can be followed.


Business plans may fail because perhaps what one thought was a good idea was not actually a good one. For example, one can be thinking about something, that may seem right, until the business actually brings it to reality, and that’s when you realize that it may sound good, but it is not as easy as it sounds. Also, one may plan a business plan but during the midst of it, there may be an obstacle that the company would have to face, and in that, they would have to create another business plan. Business plans are just plans to help for strategies, but they may not always work. This may change because what one may imagine while they plan, won’t be a reality.


The readings from Sahlman and Pirouz will help when I write my final report because they teach what it’s like to form a business and how to write a business plan. They talk about what to think for planning, and to also think ahead of the obstacles and what you may face. They help to write this final exam because one will need to know the details towards their business such as who they will sell their product to, what to sell, and what obstacles could they possible come into contact with in their way of success. These are important things to think about because it comes into detail of planning. It talks about the negative and the positive and the realities business may face while aiming to be successful. I will continue to look forward into the environment, into what factors could come into conflict and getting advice from experts.


An example of a successful indie game is a game called “Papers, please,” by Lucas Pope. This was named the top Indie game of 2013 on Forbes and I believe that it is successful because of it’s message, “that low-level employment is very little fun.” I think that this is successful because they carry out a great plan, aiming the audience towards everyone, and also creating ads. Watching their ads inspires me to make a great demo video because watching their ad about their game made me interested in Papers, please.

Week 2, Tuesday class.

My experience towards the business structure and functions are slowly turning towards it’s process. I am finding that the business would be more successful in the matter of have great product design. One will always think about innovation and try to make a product better than the next. An example of this is the iPhone where it started as a successful product but only became better for the buyers and other users. Towards my business, product design would be essential because even though the users and buyers do not know what the product is, in reality, the design will catch their eye first. In terms of functions, online promotion and branding is the main strategy.

The three industrial revolutions are first, the industrial revolution, which took place in 1760, and focused towards mechanized machines. This changed business structures and functions with the improvements of cotton mills and the increase of farming increase production. The second industrial revolution took place in 1850, which talked about improvements in driving machines. These changed were toward steam engines, production lines and electricity. The third is the new industrial revolution, which focused towards web culture. This changed business structures and functions through Internet changes and technology.

It is important to know the history of business in the Maker Economy because it helps us improve as we work for the business, in terms of leaning towards innovation and understand what the pros and cons are towards any situation. It is important to know what worked and what did not so that the business will become more lenient in the future.

It is important to have a solid financial breakdown of business activities because for the business, they need to know about how much it would cost, their budget and the funding they need in order to complete a successful business. They need to have their goals and budget set to have a more situated idea. It would be a great start to understand where you are getting your money from, connections through friends and getting a few funds to start a business. It is good to have a detailed costing analysis because one needs to know how much they will spend to know how much they will make. Good financial records are also crucial because it is great to have a good estimate and know how much one will make in return as well as have ideas for the money in the future. The cost of production is calculated, knowing how much a piece of material would cost and looking at other market demand prices that would come into comparison.

The four P’s are product, price, place and promotion. These are all important to consider because these are the tools used when determining the brand’s offering and it requires a balance. Product is important as for it determines how important and what the product is that you’re selling. Price is important as well because that is how you make your business. It understands how much the business is going to spend in manufacturing the material, and understanding how much money one will make. We are also looking whether the price is justifiable for the buyers to purchase the product. Place is important because it solely depends on where the marketing will take place, whether it take place on social media, through blogs, twitter or facebook or in person, plays a big part in advertising the product. The last is promotion, which also falls into the last one, promoting the business. It’s either promoting through telemarketing, through social media and through online ads.

It is important to use a range of marketing techniques because focusing towards one technique does not do the business justice. The business cannot solely depend on a certain technique to reach their business goal because it may not work. Whereas using a broad range of marketing techniques may focus on other, stronger ways of finding things out that would be more successful for the business.

An example of a business that has an interesting and effecting marketing or sales strategy is like I said before, Apple Inc. I believe that this has an interesting marketing and sales strategy because the designers are constantly revolving themselves around innovation and how to make things better. They understand that the product looks better, and has a sleeker design, and has more applications. Their demo video is easy and simple, and not so complicated to follow, and understand that it is useful for everyday and anything comes clutch.

Hello world!

Welcome to OCAD University Blogs. This is your first post. Edit or delete it, then start blogging! There are tons of great themes available for you to choose from. Please explore all of the options available to you by clicking the “Site Admin” link, which will take you to the powerful blog administration interface, which only you have access to.

Have fun blogging!

Use of this service is governed by the IT Acceptable Use and Web Technologies policies.
Privacy Notice: It is possible for your name, e-mail address, and/or student/staff/faculty UserID to be publicly revealed if you choose to use OCAD University Blogs.