Close
0%
0%

Arduino Coin Jar

Permanent Insurance

Similar projects worth following

Thievery no more! .. providing the thief is unfamiliar with electricity.

Notation(s)

1. Iris aperture print modified from (AcE_Krystal) https://www.thingiverse.com/thing:3563742
2. +/-3 days remain in the MacroFab and Mouser Useless Machine Contest - https://macrofab.com/blog/macrofab-design-contest-useless-machine-sponsored-by-mouser-electronics/ -- attempting to squeeze this one under the wire.
3. 150$ borrowed wood faux CTC Prusa i3 has finally begun to act normal - ie - poorly. TLC could only last so long before reaching its temperamental (terrible) twos.
4. For .. uh .. forgot to put in a power supply hole. (>_ლ)
5. Find code much simpler to ponder when the entirety of the project is constructed. As a right hemispheric individual -> dislike coding immensely.
6. Lesson having learnt from the toilet air freshener - distanced the high voltage furthest from components so as to prevent interference - and regardless - some residual was found flickering the servo. Does plain white PLA conduct?!
7. Here is some common sense frequently ignored - filming white PLA on white tables on white backgrounds ... stop it for fricks sakes!

SSEYO Koan Play File - 5.95 MB - 09/03/2019 at 04:38

Download

  • 1 × Arduino Nano
  • 1 × Elegoo PIR Motion Sensor
  • 1 × Transformer
  • 1 × Florescent Ballast
  • 1 × Elegoo 5V Relay Module

View all 10 components

  • Bradley Military Academy

    Vije Miller08/30/2019 at 17:18 0 comments

  • Reverend Slick

    Vije Miller08/29/2019 at 05:44 0 comments

    // Arduino Coin Jar
    // Vije Miller
    
    #include <Keypad.h>
    #include <Password.h>
    #include <VarSpeedServo.h>
    VarSpeedServo jar;
    
    // Pins
    int piezo = A2;
    int red = A3;
    int green = A4;
    int blue = A5;
    int relay = 2;
    int jar_pin = 3;
    int pir = 4;
    
    // Keypad
    const byte ROWS = 4;
    const byte COLS = 4;
    char keys[ROWS][COLS] = {
      {'1', '2', '3', 'A'},
      {'4', '5', '6', 'B'},
      {'7', '8', '9', 'C'},
      {'*', '0', '#', 'D'}
    };
    byte rowPins[ROWS] = {5, 6, 7, 8};
    byte colPins[COLS] = {9, 10, 11, 12};
    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
    
    // Set Passcode
    Password passcode = Password( "947" );
    
    // States
    int closed = 88;
    int opened = 30;
    int open_state = 0;
    int pir_state = 0;
    int motion;
    
    void setup() {
    
      Serial.begin(9600);
    
      // Pin Placements
      jar.attach(jar_pin);
      pinMode(piezo, OUTPUT);
      pinMode(red, OUTPUT);
      pinMode(green, OUTPUT);
      pinMode(blue, OUTPUT);
      pinMode(relay, OUTPUT);
      pinMode(pir, INPUT);
    
      // Keypad Listener
      keypad.addEventListener(keypadEvent);
    
      // Close Jar
      jar.write(closed, 200, true);
    
      // No Buzz
      noTone(piezo);
    
      // No Zap
      digitalWrite(relay, LOW);
    
      // Activate
      // Form of Coin Jar
      while (millis() < 2000)
      {
        digitalWrite(blue, HIGH);
        delay(50);
        digitalWrite(blue, LOW);
        delay(50);
      }
    
      digitalWrite(green, LOW);
      digitalWrite(red, HIGH);
      pir_state = 1;
    }
    
    void loop() {
      keypad.getKey();
      motion_sensor();
    }
    
    void keypadEvent(KeypadEvent eKey) {
      switch (keypad.getState()) {
        case PRESSED:
          Serial.println(eKey);
          button();
          switch (eKey) {
            case '#': check_passcode(); break;
            case '*': passcode.reset(); break;
            default: passcode.append(eKey);
          }
      }
    }
    
    void check_passcode() {
      if (passcode.evaluate()) {
        if (open_state == 0) {
          open_coin_jar();
          passcode.reset();
        } else if (open_state == 1) {
          close_coin_jar();
          passcode.reset();
        }
      } else {
        digitalWrite(blue, LOW);
        digitalWrite(green, LOW);
        while (millis() < 2000) {
          digitalWrite(red, HIGH);
          delay(50);
          digitalWrite(red, LOW);
          delay(50);
        }
      }
    }
    
    void open_coin_jar() {
      pir_state = 0;
      digitalWrite(green, HIGH);
      digitalWrite(red, LOW);
      digitalWrite(relay, LOW);
      jar.write(opened, 200, true);
      open_state = 1;
    }
    
    void close_coin_jar() {
      jar.write(closed, 200, true);
      open_state = 0;
      pir_state = 1;
    }
    
    void motion_sensor() {
      if (pir_state == 1) {
        digitalWrite(red, HIGH);
        digitalWrite(green, LOW);
        motion = digitalRead(pir);
        if (motion == HIGH) {
          digitalWrite(relay, HIGH);
          delay(1000);
          digitalWrite(relay, LOW);
        }
      } else if (pir_state == 0) {
        digitalWrite(red, LOW);
        digitalWrite(green, HIGH);
        digitalWrite(relay, LOW);
      }
    }
    
    void button() {
      digitalWrite(red, LOW);
      digitalWrite(green, LOW);
      digitalWrite(blue, HIGH);
      tone(piezo, 1000);
      delay(250);
      digitalWrite(blue, LOW);
      noTone(piezo);
    }
    

  • Goose

    Vije Miller08/29/2019 at 02:39 0 comments

  • Thomas and Carol

    Vije Miller08/28/2019 at 04:12 0 comments

    Faux bearings to ease weight tension on turning entire base and jar.

  • "Add Project Log" Shd Be At The Top!!!

    Vije Miller08/27/2019 at 16:25 0 comments

    Cheap printer translates to cheap prints - for the one. Not even my printer but pickers can't be choosers - wait - that makes little sense. Pickers are choosers. Hmm. Moral of the story is - aye wish aye had a work shop dot dot dot

    Shout out to https://www.thingiverse.com/thing:3563742 for the existing design of the gear and blade. The jar lid and mount was a lucky caliper guess.

  • Bagel Pin Stripe

    Vije Miller08/25/2019 at 21:37 0 comments

  • Shameless Grounded Plug

    Vije Miller08/24/2019 at 03:05 0 comments

View all 7 project logs

Enjoy this project?

Share

Discussions

Hugh Jazscheens wrote 09/06/2019 at 21:07 point

How about a warning sign that says, "Do Not Touch or Lightning Will Zap You Down" ? The adventurous among us may get the surprise they'd hoped for.

  Are you sure? yes | no

Hugh Jazscheens wrote 09/06/2019 at 16:37 point

With higher voltage and lower current, the spark could be even longer, yet have less impact on the skin. It would just be "for show" only. Or, how about just repeatedly zapping the entry? It may have the added effect of gathering attention to have people put more money in the jar. Seeing a large spark should be enough to chase off any ne'er-do-wells.

  Are you sure? yes | no

Tim Rightnour wrote 08/30/2019 at 18:41 point

I feel that anyone who visits you will just get electrocuted and have a door slammed in their face. :)

  Are you sure? yes | no

Vije Miller wrote 09/01/2019 at 02:51 point

[hermit-ing intensifies] 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates