OVERVIEW
In an effort to save money, I created a difficult wallet to bombard you with guilt-inducing questions and will only unlock if you’ve proven your desperation and need.
- Wallet exterior with “yes” and “no” buttons, reset button, servo latch, LCD screen, and coin/cash slot
- Servo controlled rotary latch
- Locked out screen
- Living hinge details
- Opening the wallet
- Wallet interior
Process
- In my initial prototype, I developed my code and electrical components before focusing on the design aspect. I had also imagined a more complex rotary latch to keep the wallet locked.
- An early (and broken) test of using a living hinge. I ended up testing hinges of varying lengths and cuts on scraps of plywood to determine the best fit.
- After cutting what I thought would be my “final” design, I realized all my electrical components would not fit in the box. Following some confused soldering attempts, I connected everything to a smaller breadboard with shorter wires to save space.
- In the end, I gave in to cutting a larger box so I could fit all my components comfortably. This is also when I had the idea of using zip ties to keep my electronics compact and prevent the wires from falling out of the Arduino.
Discussion
While the double transducer gave me the opportunity to test sensors and different technologies, I was glad this project allowed me to explore more aspects of the physical structure. In the critique, there was a positive response to the design of my case. I received comments such as, “Very finished design!” and “Clean and smooth. I want to actually use this in my everyday life.” I’m happy that all the work I put into the final box paid off and that people appreciated the design. While I ideally would have covered the wires with an interior casing instead of zip-tying them under the lid, I’m satisfied with how it looks and enjoyed experimenting with latches and living hinges.
During the process, I was excited work with laser cutting in a way I had never considered and had fun testing how different cuts, dimensions, and materials affected the living hinges. One mistake I kept making, however, was underestimating how much space I needed in the box for all my electrical components. After spending hours trying to figure out how I could fit everything into the tiny box I had already cut, I finally gave in and created a larger case. In addition, from learning how to use the LCD screen with just internet resources, I feel a lot more confident in my ability to teach myself more about the Arduino and it’s capabilities for future projects.
If I had a chance to make another iteration, I believe I could get more complex with the coding of the questions. Instead of asking the same 5 questions every time and counting the “yes” responses to open the box, I think it would be more exciting if the responses affected the questions being asked (i.e., “Is this food related?” [Y]> “This isn’t another late night Chipotle run, is it?”). I’d also like to address the issue of my box locking me out due to technical failures. During my demonstration, my reset button came unpinned and prevented me from reopening the box. While my first thought was to solder everything to keep wires from coming loose, I received some interesting suggestions for an “emergency latch to bypass the lock.” Although it would probably still be helpful to solder my wires, I think the emergency latch would be an exciting and helpful solution to this common problem. In spite of all these alterations I would like to make, I enjoyed this project for giving me the opportunity to explore different making techniques and their relationship to physical computing.
SCHEMATIC
code
- <span class="com">// Reluctant Wallet</span><span class="pln">
- </span><span class="com">// Eliza Pratt</span><span class="pln">
- </span><span class="com">//Description: This project asks a user questions about their potential spending on an LCD</span><span class="pln">
- </span><span class="com">//and keeps a counter of the "yes" and "no" responses that are input through buttons. </span><span class="pln">
- </span><span class="com">//Depending on the user's responses, a servo will rotate to "open the wallet". </span><span class="pln">
- </span><span class="com">#include</span><span class="pln"> </span><span class="str"><Wire.h></span><span class="pln">
- </span><span class="com">#include</span><span class="pln"> </span><span class="str"><LiquidCrystal_I2C.h></span><span class="pln">
- </span><span class="com">#include</span><span class="pln"> </span><span class="str"><Servo.h></span><span class="pln">
- </span><span class="typ">LiquidCrystal_I2C</span><span class="pln"> screen</span><span class="pun">(</span><span class="lit">0x27</span><span class="pun">,</span><span class="pln"> </span><span class="lit">16</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">);</span><span class="pln">
- </span><span class="typ">Servo</span><span class="pln"> myservo</span><span class="pun">;</span><span class="pln">
- </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> YESBUTTON </span><span class="pun">=</span><span class="pln"> </span><span class="lit">2</span><span class="pun">;</span><span class="pln">
- </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> NOBUTTON </span><span class="pun">=</span><span class="pln"> </span><span class="lit">3</span><span class="pun">;</span><span class="pln">
- </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> SWITCH </span><span class="pun">=</span><span class="pln"> </span><span class="lit">4</span><span class="pun">;</span><span class="pln">
- </span><span class="kwd">bool</span><span class="pln"> yOn </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
- </span><span class="kwd">bool</span><span class="pln"> nOn </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
- </span><span class="kwd">bool</span><span class="pln"> off </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
- </span><span class="kwd">int</span><span class="pln"> yCount </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> </span><span class="com">// yes counter</span><span class="pln">
- </span><span class="kwd">int</span><span class="pln"> nCount </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> </span><span class="com">// no counter </span><span class="pln">
- </span><span class="kwd">int</span><span class="pln"> qCount </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> </span><span class="com">// number of questions asked</span><span class="pln">
- </span><span class="kwd">int</span><span class="pln"> pos </span><span class="pun">=</span><span class="pln"> </span><span class="lit">75</span><span class="pun">;</span><span class="pln"> </span><span class="com">// "locked" servo position</span><span class="pln">
- </span><span class="com">//Questions are split into two arrays so all text will display on the LCD without scrolling</span><span class="pln">
- </span><span class="typ">String</span><span class="pln"> question</span><span class="pun">[</span><span class="pln"> </span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"Do you even want this?"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"Is it on sale?"</span><span class="pun">,</span><span class="pln">
- </span><span class="str">"Will you regret not buying this?"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"Will this make"</span><span class="pun">,</span><span class="pln">
- </span><span class="str">"Would you save it from a fire?"</span><span class="pln"> </span><span class="pun">};</span><span class="pln">
- </span><span class="typ">String</span><span class="pln"> question2</span><span class="pun">[</span><span class="pln"> </span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"this?"</span><span class="pun">,</span><span class="pln"> </span><span class="str">""</span><span class="pun">,</span><span class="pln">
- </span><span class="str">"not buying this?"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"your life better?"</span><span class="pun">,</span><span class="pln">
- </span><span class="str">"it from a fire?"</span><span class="pln"> </span><span class="pun">};</span><span class="pln">
- </span><span class="kwd">void</span><span class="pln"> setup</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- </span><span class="typ">Serial</span><span class="pun">.</span><span class="kwd">begin</span><span class="pun">(</span><span class="lit">9600</span><span class="pun">);</span><span class="pln">
- pinMode</span><span class="pun">(</span><span class="pln">YESBUTTON</span><span class="pun">,</span><span class="pln"> INPUT</span><span class="pun">);</span><span class="pln">
- pinMode</span><span class="pun">(</span><span class="pln">NOBUTTON</span><span class="pun">,</span><span class="pln"> INPUT</span><span class="pun">);</span><span class="pln">
- pinMode</span><span class="pun">(</span><span class="pln">SWITCH</span><span class="pun">,</span><span class="pln"> INPUT</span><span class="pun">);</span><span class="pln">
- myservo</span><span class="pun">.</span><span class="pln">attach</span><span class="pun">(</span><span class="lit">9</span><span class="pun">);</span><span class="pln">
- </span><span class="com">//at setup, light up LCD and print first question</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">init</span><span class="pun">();</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">backlight</span><span class="pun">();</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">home</span><span class="pun">();</span><span class="pln">
- screen</span><span class="pun">.</span><span class="kwd">print</span><span class="pun">(</span><span class="pln">question</span><span class="pun">[</span><span class="pln">qCount</span><span class="pun">]);</span><span class="pln">
- myservo</span><span class="pun">.</span><span class="pln">write</span><span class="pun">(</span><span class="pln">pos</span><span class="pun">);</span><span class="pln">
- </span><span class="pun">}</span><span class="pln">
- </span><span class="kwd">void</span><span class="pln"> loop</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- </span><span class="kwd">int</span><span class="pln"> yes </span><span class="pun">=</span><span class="pln"> digitalRead</span><span class="pun">(</span><span class="pln">YESBUTTON</span><span class="pun">);</span><span class="pln">
- </span><span class="kwd">int</span><span class="pln"> </span><span class="kwd">no</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> digitalRead</span><span class="pun">(</span><span class="pln">NOBUTTON</span><span class="pun">);</span><span class="pln">
- </span><span class="kwd">int</span><span class="pln"> on </span><span class="pun">=</span><span class="pln"> digitalRead</span><span class="pun">(</span><span class="pln">SWITCH</span><span class="pun">);</span><span class="pln">
- </span><span class="typ">Serial</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">on</span><span class="pun">);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">home</span><span class="pun">();</span><span class="pln">
- </span><span class="com">//ASKING QUESTIONS</span><span class="pln">
- </span><span class="com">//display current question on LCD</span><span class="pln">
- </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">qCount </span><span class="pun"><</span><span class="pln"> </span><span class="lit">5</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- screen</span><span class="pun">.</span><span class="kwd">print</span><span class="pun">(</span><span class="pln">question</span><span class="pun">[</span><span class="pln">qCount</span><span class="pun">]);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">setCursor</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="kwd">print</span><span class="pun">(</span><span class="pln">question2</span><span class="pun">[</span><span class="pln">qCount</span><span class="pun">]);</span><span class="pln">
- </span><span class="pun">}</span><span class="pln">
- </span><span class="com">//AFTER 5 QUESTIONS</span><span class="pln">
- </span><span class="kwd">else</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">clear</span><span class="pun">();</span><span class="pln">
- </span><span class="com">//if at least four responses were "yes," rotate servo to let them in</span><span class="pln">
- </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">yCount </span><span class="pun">></span><span class="pln"> </span><span class="lit">3</span><span class="pln"> </span><span class="pun">&&</span><span class="pln"> </span><span class="pun">!</span><span class="pln">off</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- screen</span><span class="pun">.</span><span class="kwd">print</span><span class="pun">(</span><span class="str">"Fine."</span><span class="pun">);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">setCursor</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="kwd">print</span><span class="pun">(</span><span class="str">"you can come in."</span><span class="pun">);</span><span class="pln">
- myservo</span><span class="pun">.</span><span class="pln">write</span><span class="pun">(</span><span class="lit">20</span><span class="pun">);</span><span class="pln">
- </span><span class="pun">}</span><span class="pln">
- </span><span class="com">//With less than 4 "yes"s, display sorry message and turn off device</span><span class="pln">
- </span><span class="kwd">else</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- screen</span><span class="pun">.</span><span class="kwd">print</span><span class="pun">(</span><span class="str">"Sorry."</span><span class="pun">);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">setCursor</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="kwd">print</span><span class="pun">(</span><span class="str">"Not this time."</span><span class="pun">);</span><span class="pln">
- delay</span><span class="pun">(</span><span class="lit">5000</span><span class="pun">);</span><span class="pln">
- turnOff</span><span class="pun">();</span><span class="pln">
- </span><span class="pun">}</span><span class="pln">
- </span><span class="pun">}</span><span class="pln">
- </span><span class="com">//if "yes" button is pressed</span><span class="pln">
- </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">yes </span><span class="pun">==</span><span class="pln"> </span><span class="lit">0</span><span class="pln"> </span><span class="pun">&&</span><span class="pln"> </span><span class="pun">!</span><span class="pln">yOn</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- </span><span class="typ">Serial</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"YES"</span><span class="pun">);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">clear</span><span class="pun">();</span><span class="pln">
- yOn </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">;</span><span class="pln">
- yCount</span><span class="pun">++;</span><span class="pln">
- qCount</span><span class="pun">++;</span><span class="pln">
- </span><span class="pun">}</span><span class="pln">
- </span><span class="com">//if "no" button is pressed</span><span class="pln">
- </span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">no</span><span class="pln"> </span><span class="pun">==</span><span class="pln"> </span><span class="lit">0</span><span class="pln"> </span><span class="pun">&&</span><span class="pln"> </span><span class="pun">!</span><span class="pln">nOn</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- </span><span class="typ">Serial</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"NO"</span><span class="pun">);</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">clear</span><span class="pun">();</span><span class="pln">
- nOn </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">;</span><span class="pln">
- nCount</span><span class="pun">++;</span><span class="pln">
- qCount</span><span class="pun">++;</span><span class="pln">
- </span><span class="pun">}</span><span class="pln">
- </span><span class="com">// reads buttons as "off" when unpressed</span><span class="pln">
- </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">yes </span><span class="pun">==</span><span class="pln"> </span><span class="lit">1</span><span class="pun">)</span><span class="pln"> yOn </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
- </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">no</span><span class="pln"> </span><span class="pun">==</span><span class="pln"> </span><span class="lit">1</span><span class="pun">)</span><span class="pln"> nOn </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
- </span><span class="com">//if both buttons are pressed, close latch and turn off screen</span><span class="pln">
- </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">yes </span><span class="pun">==</span><span class="pln"> </span><span class="lit">0</span><span class="pln"> </span><span class="pun">&&</span><span class="pln"> </span><span class="kwd">no</span><span class="pln"> </span><span class="pun">==</span><span class="pln"> </span><span class="lit">0</span><span class="pun">)</span><span class="pln"> turnOff</span><span class="pun">();</span><span class="pln">
- delay</span><span class="pun">(</span><span class="lit">50</span><span class="pun">);</span><span class="pln">
- </span><span class="pun">}</span><span class="pln">
- </span><span class="com">///when "turned off", turn off LCD display and reset servo position</span><span class="pln">
- </span><span class="kwd">void</span><span class="pln"> turnOff</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
- off </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">;</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">clear</span><span class="pun">();</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">noDisplay</span><span class="pun">();</span><span class="pln">
- screen</span><span class="pun">.</span><span class="pln">noBacklight</span><span class="pun">();</span><span class="pln">
- myservo</span><span class="pun">.</span><span class="pln">write</span><span class="pun">(</span><span class="pln">pos</span><span class="pun">);</span><span class="pln">
- delay</span><span class="pun">(</span><span class="lit">500</span><span class="pun">);</span><span class="pln">
- </span><span class="pun">}</span>
Comments are closed.