Arduino Jack-o'-lantern - DIY animated eyeball

Поділитися
Вставка
  • Опубліковано 7 сер 2024
  • Is it spooky or cute? 🎃 Carve your own mini-pumpkin with an animated MOVING EYE 👁 using an Arduino! Win your office pumpkin-decorating contest or just make a unique Halloween decoration for your home!
    This is a perfect beginner Arduino project for makers and crafters of all ages (just be careful with the hobby knife!) and requires zero programming or electronics knowledge to get working!
    If you have any questions, just leave a comment below and I'll try to help!
    🛒 Support my channel by using these links to buy supplies:
    X-Acto Knife: amzn.to/2Z25a75
    Ping Pong Balls: amzn.to/3AO7Kuq
    9g Servo Motors: amzn.to/3mTKvKk
    Thick Super Glue: amzn.to/2YZvGhz (I highly highly recommend this stuff!)
    Arduino Pro Micro: amzn.to/3lNyWp1
    Wires: amzn.to/3vk1HN4
    Hot Glue: amzn.to/3p4eFNU
    💻 Download the Example Arduino Code:
    gist.github.com/scottbez1/d68...
    🕑 Timestamps:
    0:00 Intro
    0:21 Cut & glue ping pong ball eye
    0:54 Painting eye
    1:23 Carving pumpkin
    2:13 Wiring electronics
    2:45 Arduino programming
    3:17 Assembly
    3:37 Final result!
  • Авто та транспорт

КОМЕНТАРІ • 37

  • @scottbez1
    @scottbez1  2 роки тому +7

    There are lots of ways you can extend this project too! A few ideas:
    - Add some LEDs to make the eye glow or flicker at night (use UV LEDs and fluorescent paint on the eye for an extra cool effect)
    - Add PIR, ultrasonic, or ToF sensor to trigger the animation when someone approaches (e.g. amzn.to/3pdQ0GG)
    - Add a sound effects board to play creepy noises or make the pumpkin talk (e.g. amzn.to/3BQ07VK)
    - Use a Raspberry Pi and webcam to make the eye follow your movement
    What other ideas do you have?

  • @wojwoj06
    @wojwoj06 2 роки тому +11

    The effect is great. It is both cute and spooky! :) Great job!

  • @rozling
    @rozling Рік тому +3

    Love this! For a halloween game, you can also make a 'retinal scanner' by popping an RFID tag behind the ping pong ball and then holding it up to an eye reader with some red LEDs for a 'laser' effect.
    The correct eyeball can open a door or maybe make a bunch of treats fall out of something :)
    We use this technique in an escape room to great effect - it opens a full-size door with a counterweight attached so that the whole thing slides open and players can go through to the next room

  • @ClassyJohn
    @ClassyJohn 2 роки тому +1

    I really love how simple your project ideas are and your use of relatively common household items/

  • @dannydawson5509
    @dannydawson5509 Рік тому +1

    This project was my entry into arduino. Thank you so much for creating such a super beginner-friendly toy project.

  • @RussellEveleigh
    @RussellEveleigh 2 роки тому +2

    Love it!
    I know you are being tongue in cheek but I think your 'super realistic' 3D pumpkin is actually pretty good too!

  • @gelatinskeleton8745
    @gelatinskeleton8745 2 роки тому

    I have been looking for different ideas for servo driven eyes... this is the FIRST one that is totally different. Thank you.

  • @mandeepdhanoa
    @mandeepdhanoa 2 роки тому

    Superb guide. I made one myself with two eyes in a large one. I'm definitely going to stick to one in a munchkin pumpkin next time

  • @maltoNitho
    @maltoNitho 2 роки тому

    Adorable!

  • @markgreco1962
    @markgreco1962 2 роки тому

    Fantastic project thanks very much

  • @optimus6858
    @optimus6858 2 роки тому

    nice
    hope to see more cool projects :)

  • @RifuSanders
    @RifuSanders Рік тому

    Amazing

  • @I_Eat_Chairs
    @I_Eat_Chairs 2 роки тому +2

    Imma put it in a lemon

  • @necros_is
    @necros_is 2 роки тому

    Terrifying but I like it!

  • @Enica1980
    @Enica1980 10 місяців тому

    So cool! What if I want to do a bunch of eyes? Do you know if there's a motor for that?

  • @234930
    @234930 11 місяців тому +2

    When cutting the hole, would you suggest measuring in metric or imperial or just eye balling?

  • @DeepFriedPenguin
    @DeepFriedPenguin 2 роки тому

    I want to learn how to invent little things like this! PLEASE BE MY TEACHER!

  • @maciej_2812
    @maciej_2812 2 роки тому

    👍

  • @hanfbrot
    @hanfbrot 2 роки тому

    Anyone has an idea how to make the servo more quiet? I’ve heard that you could let it move in really short steps, you wouldn’t even notice that it’s basically on-off-on-off while moving but would be more quiet

  • @Jay-yy9ol
    @Jay-yy9ol Рік тому

    Hi. How would you make this but add a motion sensor that will direct the eye to someone walking by? Thanks.

  • @EdgedPixie
    @EdgedPixie Рік тому

    So that's where the OmegaMart Lemons went...

  • @ledogu
    @ledogu 2 роки тому

    Thank you for sharing. I am trying to get multiple eyes moving at the same time. I currently have two servos hooked up. I can get each eye to move through the routine one at a time. Eye one moves through it routine, it stops, then the second eye goes through the routine, stops, then back to eye one.
    How do I get multiple eyes moving at the same time?

    • @scottbez1
      @scottbez1  2 роки тому +1

      Great question. It depends how you want to the eyes to move:
      - if you want them to move identically at the same time, you can just connect them both to the same Arduino pin and use the original code
      - if you want them both to *move at the same time* as each other, but *to different angles*, you could make another "pos" array to have another set of positions for the second servo, and then just duplicate the s.write(pos[i]); line to also set the second servo based on the position from the second pos array
      - if you want them to move *completely independently* of each other, you'll want to start with the second code example, which implements the animation using millis() instead of delay(). delay() needs to be avoided in this case since a delay() while animating the first motor completely pauses execution of the code, meaning the second motor wouldn't be able to animate during that time. In the second code example I'm blinking an LED while the motor is animating, but you could replace that LED blink code with a second copy of the motor animation code (meaning you'd need separate copies of animationStep, lastAnimationMillis, pos, and d to keep track of the second motor's animation). Basically the main loop would first check if it's time to move the first motor and then check if it's time to move the second motor, and then loop and do that all over again. This way the code is always running and looping, which allows it to keep track of the 2 separate animations simultaneously instead of only being able to run one after the other.
      Let me know if that makes sense, or if not I can try to whip up a full code example this weekend.

  • @memphys316
    @memphys316 Рік тому

    This is my first project with a servo. Did you connect to analog or digital pin 6?

  • @hammy9906
    @hammy9906 2 роки тому

    hey! i love this and would like to try the same moving eye idea with my own little boxy robot, but im kinda new to coding and arduino. Do you think an arduino UNO Rev3 and 2 servo motors would be too hard to code? Id like to have some tips if you can share.

    • @scottbez1
      @scottbez1  2 роки тому +1

      Yep, shouldn't be too hard to code! If you want the 2 servos to move identically you can actually just plug them both into the same pin and not change the code at all. If you want them to move independently at different times or in different directions, then you'll want to start with the second code example, which implements the moving eye without using delay() which is necessary if you want to add a second motor with a different animation pattern. If you get stuck, just send me a reply and I'm happy to help more!

    • @hammy9906
      @hammy9906 2 роки тому

      @@scottbez1 hey! Im back and i think i have everything planned out but i just have 1 question. I dont quite get how to power my arduino and the servos. After plugging the servo in 5V and the other sockets can i just plug the board into any power source or will that cause problems? I have some batteries with beds for them which i can use, or just my powerbank lol.

    • @scottbez1
      @scottbez1  2 роки тому +1

      @@hammy9906 hmmm, I would probably try the USB power bank.
      Often you'll see recommendations online *not* to power servos with just the USB port because they can draw more current than USB can supply, and that's usually good advice. But since this project uses a micro servo and it's not actually doing too much work, it should use a small enough amount of current to be able to get away with USB power.
      The issue with using the DC power jack on the Uno is that the 5v regulator on the Uno is inefficient and will get *very* hot when powering a servo, so I'd generally not recommend trying that.
      However, since you're using 2 servos instead of just one, there's a chance it may draw too much current for USB and you could run into issues like motors twitching or the Arduino may restart randomly or behave erratically. If that happens let me know and I'll try and come up with some alternative suggestions.

  • @markgreco1962
    @markgreco1962 2 роки тому +1

    Thought with the extra pins could add an LED I'm not a coder so just mashed the Blink sketch in and it seems to blink but kind of randomly. Would love an LED Flicker at some point. THOUGHTS??
    i'm using a nano
    #include
    Servo s;
    int pos[] = { 90, 80, 65, 120, 105, 110, 98, 68, 84, 74};
    int d[] = {3000, 500, 1200, 1530, 700, 200, 800, 450, 300, 670};
    void setup() {
    s.attach(6); //

    • @scottbez1
      @scottbez1  2 роки тому +2

      For simplicity, my code and the blink sketch both use "delay" to pause between actions - this makes the code easy to understand, but the downside is that delay() pauses *all* execution, meaning you can't have a blink running concurrently with the motor animations using that style of code.
      The solution gets a little more complex: instead of taking an action (moving the motor or turning an LED on/off) and then pausing execution completely, you can use millis() to keep track of the *time* that you last took an action and then *continuously* (without ever pausing) compare that against the current time to decide if it's time to take another action yet.
      There is a "blink without delay" example you can look at that will get you halfway there, avoiding delay() for blinking the LED, but without also converting the motor movement code to use millis() instead of delay() it still won't work as you'd hope. Let me see if I can whip up some updated code to share that doesn't use delay()...

    • @scottbez1
      @scottbez1  2 роки тому +1

      Sorry it took a little while; got distracted. I've published a new variant of the code that uses millis() instead of delay() and includes a basic LED blink during the motor animation: gist.github.com/scottbez1/d68e9048606fb9d0f8a1b374c207c1b5#file-pumpkineyewithoutdelay-ino
      Let me know if you have any more questions! Cheers!

    • @markgreco1962
      @markgreco1962 2 роки тому

      @@scottbez1 THANK YOU This helps ! now i will teach myself to make the LED flicker. ALSO this winter making 12 split flaps.

    • @adamwalsh7804
      @adamwalsh7804 2 роки тому

      Can this be done on a d1 mini. I have loads lying about

    • @scottbez1
      @scottbez1  2 роки тому

      Absolutely! Just tried on a D1 mini and it works great!

  • @dusanzdravkovic8010
    @dusanzdravkovic8010 2 роки тому

    I wanted to like the video, but I can't make myself ruing the 256 like count...