element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Merry Boxes & LEDs
  • Challenges & Projects
  • Project14
  • Merry Boxes & LEDs
  • More
  • Cancel
Merry Boxes & LEDs
Blog JackBox #3 : Opening and Closing the Lid
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Merry Boxes & LEDs to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dubbie
  • Date Created: 4 Jan 2019 6:01 PM Date Created
  • Views 4051 views
  • Likes 10 likes
  • Comments 5 comments
  • merryboxesledsch
  • merryboxandledch
  • holidayspecial19ch
  • merryboxesledch
  • arduino
Related
Recommended

JackBox #3 : Opening and Closing the Lid

dubbie
dubbie
4 Jan 2019
image

Merry Boxes & LEDs

Enter Your Project for a chance to win a Maker Tool Kit, an Oscilloscope Grand Prize for the project that brings the Most Joy to the Heart, and Gift to Gives!

Back to The Project14 homepage image

Project14 Home
Monthly Themes
Monthly Theme Poll

 

I decided to go for a second lever on the lid opening mechanism for the Jack in the Box Merry Boxes and LEDs event, rather than adding a bulge to the lid itself. This all went well until assembly when I realised that I had forgotten to subtract the height of the lid fixing hinge from the length of the second link. I did initially think I might just make and print a shorter version but then I thought 'Why not just cut the existing link down to size'. It was much quicker and cheaper, plus if it was still too long I could just cut another bit off. However, all I had to do was to remove the amount added by the hinge for the lid and it fitted, maybe not perfectly but it worked so I left it at that. All that was needed now was a programme for an Arduino Nano which just used the Servo.h library to cycle the servo backwards and forwards between the two extremes. Programme listing below.

{
int lidvalue;

  lidvalue = 0;
 
  for (lidvalue = start; lidvalue <= end; lidvalue++)
    {
      lidopen.write(lidvalue);                   
      delay(stepdelay);                      
    } /* for */
delay(1000);
  for (lidvalue = end; lidvalue >= start; lidvalue--)
    {
      lidopen.write(lidvalue);                   
      delay(stepdelay);                      
    } /* for */
delay(1000);
} /* loop */

 

I stuffed all the mechanism into the box, apart from the Nano, proto-board and batteries - which don't fit! Initially nothing seemed to happen and there was just a lot of servo buzzing. With the lid shut you cannot see what is happening. After a bit of testing of the servo outside the box I realised that I had accidentally used a continuous rotation servo which was just stalled. It got quite warm so I hope it still works. I then tried a proper micro servo but it made some crazt backwards and forwards movements when first turned on. There didn't seem to be any fault with the programme so I tried another servo that I need worked. It turns out that the new servos I purchased just before Christmas might all be duds. I tried two and then gave up with them. I might send them back or just keep them for small DC motors. Once that problem was solved the lid would then open and close. See below for the initial testing. It sort of works

 

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

It doesn't work properly as nothing happens for a while and then the lid shoots open halfway and then operates nicely to fully open and then close where-upon it waits a bit and then shoots open again. After carefully looking at what was happening, which wasn't easy as the lid wasn't open, I realised that the base holding the servo motor was lifting away from the bottom of the box until it jammed and then it would open the lid. I also realised that the hinge connecting the second link to the lid was too near the lid hinges which fixed it to the box, so that too much torque was required to start it moving. Rather than fix the servo base permanently into the box (who knows what problems I might encounter in the future which might require its removal again) I just used tow lumps of Bluetac on top of the base and pushed them in hard to hold the servo base down. I also moved the hinge as far away from the lid hinges as possible. The result was that it now quite smoothly opens and closes the lid.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

Next step is to start adding the decoration and LEDs.


Dubbie

  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 6 years ago +6
    dubbie , you can format your Arduino sketch source in the blog by using the C++ formatting option. Select the code in the editor, press the >> button, and select syntax highlighting -> c++
  • balearicdynamics
    balearicdynamics over 6 years ago +4
    Great! Can I suggest in the final version of making a hole somewhere to the bottom for the servo control cable? Just about your issue on the servos. Take into account that - probably most, mine all - the…
  • genebren
    genebren over 6 years ago +3
    Very cool. The lid mechanism is working quite nicely, well done! Looking forward to your further updates. Good luck and keep up the good work! Gene
Parents
  • genebren
    genebren over 6 years ago

    Very cool.  The lid mechanism is working quite nicely, well done!  Looking forward to your further updates.

     

    Good luck and keep up the good work!

    Gene

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • genebren
    genebren over 6 years ago

    Very cool.  The lid mechanism is working quite nicely, well done!  Looking forward to your further updates.

     

    Good luck and keep up the good work!

    Gene

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube