DUCK!

by chloepunkari in Circuits > Arduino

98 Views, 0 Favorites, 0 Comments

DUCK!

thumbnail_IMG_0062.jpg
thumbnail_496851AF-4C6F-4A25-972A-3C938EDC3C4B (1).jpg
thumbnail_3DBD77A7-6D9A-4074-8C10-9562C840DFF7.jpg
thumbnail_3FB47087-8CC4-4863-8231-6414452E2EF0.jpg
DUCK!

DUCK! is a vending machine like no other. Falsely advertising snacks of the highest demand, this machine is secretly armed with the pawns of the Master Fowl. Getting angry at the fake display and hitting the machine will not bode well for you, unless you can endure the annoyance that is the Master Fowl's favourite tune. Finally fed up with this useless piece of furniture? Feel free to walk away, but make sure to watch your back... or be ready to react when someone yells, "DUCK!"

Supplies

Circuit Components.jpg

Mechanical Components:

x1 Arduino Uno

x1 830 tie points breadboard

x1 Mini breadboard

x1 Piezo pressure sensor

x1 Active buzzer

x1 Ultrasonic distance sensor

x1 Solenoid

x1 Flyback diode

x1 TIP120 transistor

x1 12V battery case (fits 8 AA batteries)

x8 AA batteries

x1 9V DC battery

x1 9V battery adapter

Jumper wires (as needed)

Male to female jumper wires (as needed)


Building Materials:

x3 1/8 in. (3 mm) birch plywood (18 in. x 32 in.)

x1 1/4 in. (6 mm) clear Plexi-Glass (8 in. x 10 in.)

x1 Printed photo of the highest demand vending machine snacks

x1 3D printed Master Fowl (or machine topper of your choosing)

x5 1" diameter rubber-duck bouncy balls (or any pawn of your choosing)

x3 Door hinges

x1 Empty paper towel roll

Electrical tape

Superglue


Equipment:

Computer

3D Printer

Laser Cutter

Printer


Computer Programs:

Arduino IDE

TinkerCad

Rhinoceros 3D

Virtual Understanding

small attempt.jpg
482742625_676327701582391_5691312093597319609_n.png

We recommend using TinkerCad to assist in the design of the circuit and avoid physical damage to components, an example of our circuit is included above for your reference. The DUCK! machine utilizes two sensors and two actuators:

Sensors:

  1. Piezo pressure sensor - notices when machine is hit out of frustration
  2. Ultrasonic distance sensor - recognizes when user walks away from machine

Actuators:

  1. Active buzzer - plays 3 of the Master Fowl's favourite tunes, each sound is triggered by the piezo sensing a first, second and third hit to the machine
  2. Solenoid - retracts and releases, hitting loaded pawn and launching it at the retreating user, triggered by the ultrasonic distance sensor noticing user leaving


Method:

Testing the sensor-actuator functions and relationships step by step is, from our and the Master Fowl's experience, the most efficient way to troubleshoot and arrive at the final circuit which should work something like:

The piezo pressure sensor is the first in the lineup, sensing the primary user interaction: hitting the machine. Since the piezo senses variance in force and vibration through pressure changes, it picks up the vibration of the hit to a variable degree of sensitivity of your choosing. This sets off our first actuator, the active buzzer.

The active buzzer plays a different tune for for each hit (for up to 3 hits of the machine), the final being the Master Fowl's top song of choice, to annoy the user enough for them to leave, enacting the secondary user interaction. The ultrasonic sensor, our second sensor of the machine, notices when the user begins to retreat, through the time increasing between the transmission and reception of emitted ultrasonic waves. When the user reaches a specified distance away (the time to receive the emitted waves reaches a certain value) our second actuator is triggered and the moment is here for... THE PAWN ATTACK!

At the distance of choice, specified by you (or your machine Master), the solenoid leaps in action, propelling the loaded pawn out of the vending machine and towards the unsuspecting back of the retreating user.

For your convenience, or incase you have a machine Master even more impatient than ours, our final code is attached below.

Now, you just have to build it!

Assemble Mechanical Components

whole.jpg
arduino.jpg
full circuit.jpg
solenoid circtuit.jpg
uds.jpg

Replicate the TinkerCad circuit using the mechanical components listed under Supplies.

A few things to note:

  1. Attach the piezo sensor to the breadboard with long wires - to allow for placement where the machine will be hit (on a wall, on the roof, or under your machine topper)
  2. Place the ultrasonic sensor on the edge of the breadboard - so it can be positioned to see out of the front of the machine encasement when assembled
  3. Use extra long, or attachable wires (male to female jumper wires or alligator clips) to connect the solenoid to the breadboard - to allow for easy movement and flexible placement).

Troubleshooting:

  1. Piezo not sensing accurately? Try changing the sensitivity or placing it between two objects!
  2. Solenoid not pushing your pawns with enough force? Try using a transistor that amplifies the weak electrical signals by a greater amount or a higher voltage power source!
  3. Pawns not launching high enough? Try increasing the angle of your ramp to increase the height of the pawn's apex!
  4. User not leaving? Play a more annoying song! - Courtesy of the Master Fowl

Design and Build the Vending Machine

GetAttachmentThumbnail.png
GetAttachmentThumbnail.png
angle model.jpg
thumbnail_IMG_0101.jpg
model with no arduino.jpg
thumbnail_21130A14-4269-4F3C-B94A-B5AB6F27F4EF.jpg
thumbnail_A285DE7D-0752-4507-B918-58DA37DAA1A8.jpg
thumbnail_C60BCFB3-7A76-4342-ABB0-D1495A8DA368.jpg
thumbnail_D525865F-89DB-46F6-8BFB-E2CF0E85C171.jpg
thumbnail_7530CA92-9073-42E2-AB66-8E88C56EE7F5.jpg
thumbnail_53453E58-CA8C-4D39-9A17-719998450496.jpg

NOTE: It will be helpful to have the mechanical components fully assembled and nearby for this stage.

We decided to work with the Master Fowl and the rest of the design was based on what he desired.. feel free to work with a less controlling vending machine Master, or none at all, and base your design on your heart's (or your snack's) desires. Following the Master Fowl's requests we modelled the vending machine in Rhino 3D and set up a laser cutting file. After laser cutting, it's a relatively simple assembly process (we used superglue and just followed our model and laser layout) - organizing your laser cutting layout in a way that is clear for assembly will save time and confusion in the assembly process.

The important design features to include, regardless of who's calling the shots, are:

  1. Faux display of your choice of top tier vending machine items
  2. Top shelf for the Arduino Uno and breadboard to sit on, located at a suitable height for the piezo to reach the location you wish the machine to be hit
  3. Holes cut in the front panel, lining up with the ultrasonic distance sensor
  4. Loading channel for the Master Fowl's pawns (rubber-duck bouncy balls)
  5. Launch ramp (located under the loading channel) with a dock for the solenoid at the back, a small lip to keep the loaded pawn from rolling backwards and walls to keep the pawn moving straight
  6. "Make sure to angle this up towards the front so the pawns launch upwards at the impatient, ungrateful, easily annoyed, weak, retreating user" - the Master Fowl
  7. the Master Fowl is right, albeit rudely, but you may need to experiment with the angle to find an appropriate balance between angle and clearance of the loading channel
  8. Faux snack outlet cutout in the front panel for the pawns to discreetly launch from
  9. Attach the back panel with hinges to allow access to the mechanical components and to reload the pawns

If you seem to find yourself here under similar circumstances (being controlled by a wrathful duck) feel free to follow the laser cutting guide and colour coded assembly attached below, we wish you and your mental health luck with your duck!

Installing the Circuit

thumbnail_602CD82A-2C6D-4039-A128-9994D5C8BF5A.jpg
thumbnail_E146421F-1317-4AC3-A037-273FDB919752.jpg
thumbnail_221CA95F-1191-4AFB-82E2-713A905164BD.jpg
thumbnail_4F4D29DC-CB76-40D0-ABBE-2323992DB2F9.jpg
thumbnail_5D1E7A1A-EF6D-41D3-AAA6-8E961C1F9E17.jpg
thumbnail_IMG_0065.jpg
FR79HI4M85XKSKR.jpg

Once your vending machine enclosure is built, install your mechanical systems where you've allotted space. This is where you can experiment with the placement of boards and length of wires for elements such as the piezo sensor and solenoid.

In this stage you may encounter some design malfunctions, feel free to add or edit your design to make your circuit system fit in a way that works for you!

A few things we modified:

  1. A sliding locking system on the back door to keep the Master Fowl from messing with the wires
  2. Extra support underneath the ramp and breadboard for more stability

Conclusions

Throughout the process of the DUCK! machine design and construction, many lessons were learned... such as picking a more cooperative team lead (don't tell the Master Fowl). Some of the technical lessons include:

Setting the sensitivity of the piezo sensor

Difficulties

  1. This was an important aspect to figure out as it determined how hard and where to hit the machine. We played around with this feature and ended up attaching it to the roof underneath the Master Fowl as the pressure from pressing him set off the sensor.
  2. A higher sensitivity means a light and off target hit will trigger the piezo sensor
  3. A lower sensitivity means a harder hit on the location of the piezo will be necessary to trigger the piezo sensor

Realizations

  1. If we were to recreate this project we would ensure the piezo sensor had a more secure placement to increase the consistency in the received sensor readings


Increasing the force of the solenoid launch

Difficulties

  1. This proved to be a difficult task as the solenoid, despite being quite compact in size, required a much greater voltage input than we initially thought in order to hit the pawns with enough force to launch them properly. We arrived at using a TIP120 transistor and a 12V power source (instead of the original 2N2222 transistor and 9V power source)

Realizations

  1. If we were to recreate this project we would use a stronger solenoid to produce a greater power output for the launch.


Perfecting the launch ramp

Difficulties

  1. Arriving at the desired launching ramp angle was a process of trial and error. The most successful set up included an angle of around 45 degrees, this positioned the pawns at a great enough incline to launch them up into the air.
  2. Additionally, we needed to alter the location of the side walls to make sure the pawns were being loaded into and staying in the middle of the ramp and thus being struck in the center by the solenoid.

Realizations

  1. If we were to recreate this project we would look into moving the dispenser void higher up the machine, this would further increase the pawn's initial height and maximum launch range.


Solenoid overheating

Difficulties

  1. An issue we kept running into was the solenoid overheating and malfunctioning, we did our best to work around this by letting it cool between trials
  2. we also tried using a stronger resistor but this led to further malfunctions

Realizations

  1. To solve this problem in the future we would use a better suited resistor and use a larger solenoid which could handle the prolonged period of use and trials.


Wiring malfunctions

Difficulties

  1. As with many small circuit projects, the wiring for this machine was rather sensitive and we ran into issues of wires disconnecting and shifting
  2. We did our best to solidify the connections through the use of electrical tape wrappings and using male to female jumper wires

Realizations

  1. To fix this problem in the future we would utilize stronger connection methods, such as soldering, and full length wires to avoid connecting multiple wires together


Next Steps

Feeling fancy? Have an ambitious (and supportive) team lead and want to take it to the next level? Try adding some of these features to elevate your useless vending machine to a new tier:

  1. Add another interaction - maybe the user needs to push some buttons
  2. Add a variety of output objects - multiple points of launch and multiple types of pawns
  3. Have fun and use your imagination.. but make sure it's still useless!

Credits

Team: Nathania Nagarajah, Ailsa Li, Zahra Robertson, Chloe Punkari

Class: ARC385: Physical Computing - John H. Daniels Faculty of Architecture, Landscape and Design

Professor: Maria Yablonina

TA: Brian Slocum