Non-Sufficient Bacon/ INsufficient Bacon
Materials and links:
- Arduino
- TM 1637 - 4 digit/7segment display or Smaller digit display
- Matte Black LED display
- infared sensors or
- IR BreakBeam sensor
- 10 led strip *(if not using the display, or as timer?)
- Pig body itself (pre-made or not?)
- small speaker
Project Idea: NON SUFFICIENT BACON
(haha cause bacon means money too):
I want to create a piggy bank that charges you if you do not feed it fast enough, acting like an NSF fee (Non-Sufficient funds). A display on the front will show the current amount in your bank, and charge you if you miss the timer. Every coin you pass through restarts the timer and adds a small amount back to the fund.
A timer noise will tick (or led lights go out) until a coin is put into the slot. If a coin is put within the time limit, (still deciding if it should be 30 seconds quick or 5 minutes long) the pig will make a noise and add 5 to the total. If nothing happens before the time runs out, the pig will say something (not sure what yet, maybe TOO LATE or something) and deduct 20 from the total.
It will all be contained within the pig hopefully, maybe a cord to a power source at the most. Was also visualizing it sitting on a bed of insufficient receipts or withdrawal receipts.
*also LEDs or display could be switched based on what works better
Sketches?
Design idea - REAL LIFE ACTOR -
Drawn out code logic
Things to consider:
- use LEDs for visual countdown? for funds level? at all?
RANDOM IDEAS THAT ARE PROBABLY TOO CRAZY:
- sculpting the pig
- creating a loonie "shoot" where the coin would go through the pig and into a bucket underneath labelled "Paycheque"
Helpful tutorials?
Progress?
trying to work on it. running into a few problems here and there but mostly battling life atm. Trying to simplify the project to be able to make it simply. Having a lot of issues getting the 7segment displays to function correctly.
--
Code so far for the LED visual timer that turns the leds on one by one from left to right from green to red. This is reset by the IR sensor after flashing all lights green once. If the timer reaches one minute without getting triggered by the IR sensor the lights will flash red and then restart.
Running into issues that I am still have troubles with, The ir sensor is not working correctly, it is not reseting the timer and flashing the lights green.
Version 1: neopixle. Version 2 fastled (is only the visual timer on its own with a flash red b4 restart)
I am still tinkering with the digit display code. and the pig body has begun to be created as well.
Working on completing all 3 code sets separately before putting together:
Code for visual 1 minute LED timer || starting from off, turning on one by one until all on || from left to right || from green to red || Looping -> updated below to use different library and be smoother of a transition.
Moving away from this code
Code for digit display, working correctly on its own. Running on a 1 minute loop - if timer completes it decrements by 10, if the ir sensor is triggered it adds 5 and resets the timer.
Updated code that Added a button to reset the displayValue to 0.
videos of code working separately
Final codes to put together:
Digit display:
IR breakbeam triggered = +5
1 minute cycle completing with no trigger = -10
button = reset displayValue to 0
Code:
Visual LED timer
1 minute looping sequence
lights LEDs from left to right in a green to red gradient
Code:
WORKING CODE (kinda, not perfect but hey, pretty good)
Finished Code (or at least finished for the moment :) )
Comments
Post a Comment