element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 Automatic christmas bell ringers.
  • 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: danielw
  • Date Created: 14 Jan 2019 10:21 PM Date Created
  • Views 3611 views
  • Likes 15 likes
  • Comments 24 comments
  • merryboxesledsch
  • holidayspecial19ch
Related
Recommended

Automatic christmas bell ringers.

danielw
danielw
14 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

 

Intro.

On the run up to Christmas this year, we had a works lunch which involved playing some party games.

One of the games involved each of us having a bell and trying to play tunes. After many mistakes we finally managed to produce something resembling a tune to a resounding cheer.

image

I was convinced and ended up getting a set of the bells for the family.  However I also had an ulterior motive... As it was while trying to pull a tune together I thought I could make this into a seasonal display.

 

In the beginning... 

After rummaging through my many boxes of what is unilaterally called 'junk' by the rest of my family I concluded that I needed to order some RC servos.  I could also have bought a servo controller but I already had a couple of Arduino pro mini boards, so deciding to use one of them, I set to hacking.

 

The project is based on my laptop running a Python program that interprets the musical sequence and outputs the commands over the same FT232 USB COM port as is used for programming the Arduino.  The Arduino receives the commands and moves the servos as required.

 

There is lots of information online as to how to use Arduino, and that's just as well.  I usually write in C as that's what I do for work.  However I wanted to see how quickly I could get something working using the Arduino IDE.  The answer is very quickly!  it's great for hacking something together.  In fact I was quite lazy to see what I cold get away with.  If you go over the code attached below you'll see that I used delay rather than implementing a proper timer using millis the overall effect is that the servo movements hold up the program,  however for this it worked fine, and I never got round to improving it.  Based on the feedback from the family I might be getting round to it for next year

 

I quickly had the Arduino blinking an led when it received a serial character.  I then coded up a small state machine using a switch...case statement.  It looks for a capital S for the start of a message. then it looks for a board number then a channel number.  I did this so I could add more boards in the future if I want to add more servo channels by adding more boards.  If there are any problems then it drops back to waiting for a command.

 

I could test the operation of the comms by typing S11, or S12 into the arduino serial monitor and watching the LED Blink

 

image

 

The Python code opens a serial port and sends a command every time a note is required,  The notes and the timings are stored as a list.  I also used a list to allow me to map the bells to the servo motors and therefore the commands that were sent out.  I didn't have the sermos yet so I added a beep so that I could at least get part of the program running.  I'm not a python guy, but wanted to have a go at something I'm not used to.  I also thought if I had the time I would port it to my Raspberry Pi.

 

And that was it.  For a few days I made the most of the Christmas holiday and tried not to eat too much while I waited for my motors to arrive.

If you want to see the software I've linked it here ->> Merry Boxes and LED's Software.

 

They're here!

A couple of days after Christmas the servos arrived. As soon as I could I connected them to the Arduino using a breadboard.  A quick search of the internet got me a schematic that I could quickly implement.

image

The 1K resistor is there to protect the Arduino I/O if there are voltage mis-matches as the servos will be powered from a separate supply.  The arduino will be powered from the laptop,  the servos will take large current spikes of over an amp when they move.  More than I can take out of the USB Port on my laptop can handle so an external supply is needed.  I'm using my bench supply that can output up to 2A, set it to 5V.  The ground rail of the Arduino and the PSU for the servos is linked so they all have the same 0V reference.  As a precaution I used my Laptop on battery just in case there were some weird ground loops going on.

 

Although the sketch shows one capacitor, I actually added two, a 1000uf and 100nF that I found in my parts box, in a bid to smooth out any spikes.  The reason for using the two is that when the servo starts to move it'll draw a lot of current, and the power supply is relatively slow to respond to the change in current consumption.  The smaller value will help supply a small amount of additional power for very fast or high frequency transients / noise.  With the slower / lower frequency noise being dealt with by the larger capacitor.  When I get the opportunity I'd like to investigate these signals on an oscilloscope to see whether the capacitors are having the desired effect.  They were an add in, just in case.

 

The finished breadboard looked a bit of a mess... Ok a lot of a mess!  Still it works.

image

I wrote the program so I only have to send one command to the Arduino and ring a bell so the Arduino does the timing of the servos.

This works well, but at the expense of having to program the arduino with the relevant servo positions rather than just being able to control everything from the laptop.

 

 

Snow people!

I've got so far but now I need something to ring the bells and what better than some snow people. Luckily I have a son who through the years has been crazy about Lego. So with his permission and assistance we built something to mount the servos to.  Quite how he has amassed so many white pieces I do not know.  However, there were enough to make these three characters.

image

I should add at this point that my son is now 16 and too cool for most things, but still got involved when he saw I was up to something interesting!

 

The servos aren't lego compatible, however I have found that engineers  I mean masking tape can be almost as useful as duct tape at times .

image

 

I found the bells worked best with the servo horn. (Black plastic bit) fitted toward the end of the bell handle to help the bell get a good swing.  Once again masking tape was used to hold it all together.  I chose to leave the screws off the horns so that I could easily re-position the bells on the Snowfolk.

 

image

 

Once it was all put together I had to tweak the timings and movement of the servo movements to get the bells to reliably ring.  This was trial and error until I hit on some values that worked.  I think it could still be perfected somewhat but it worked well enough for a family demonstration! 

 

Last Minute Addition!

 

At the last minute I thought it needed brightening up! so I used the LED output (Pin 13) to drive a ZTX 653 NPN transistor Via a 2K resistor to limit current through the base of the transistor.  I used this high power output to switch the low side of a set of fairy lights on a small tree.  I hastily added it in using wires pushed into the contacts of the battery box for the Fairy Lights.  I set the lights to turn on or off each time a command is received.  I think next time I would opt to give the lights their own command to add more control.  Or perhaps get a bit adventurous with some neopixels.

 

imageimage

 

So It was done!

It's rather bodged together project both my son and daughter got interested and involved, even my wife liked this one! In fact I think I may be getting commissioned by the family  to work on something bigger for next Christmas.  I will probably run it all on the Arduino next time as it's a bit wasteful to have a laptop sat there, Though I might use a raspberry Pi for some IOT shenanigans. I may even hit the sales for some cheap plush toys that may need to be robotized!

 

Here is a video of the finished project and I hope you like it!

 

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

 

If you have any comments / constructive criticism let me know.  I'm a bit new to this blogging lark!

  • Sign in to reply

Top Comments

  • danielw
    danielw over 6 years ago in reply to dubbie +6
    Now that's an interesting project. Hopefully you'll blog it on here. I like when several legs are controlled through a few actuators and mechanisms. It's amazing when the mechanics translate something…
  • danielw
    danielw over 6 years ago in reply to dubbie +5
    I've just had to search for Tobbie... Is this the one? That's awesome!
  • dubbie
    dubbie over 6 years ago in reply to danielw +5
    Yes, this is the one. I want to make my own walking robot so I thought I would look at a few other different designs first. I have previously made a quadraped spider type thing with two servos per leg…
Parents
  • Workshopshed
    Workshopshed over 6 years ago

    Fantastic project. I see that Lego do now have their own servos but they would be a bit big for your design. There are however loads of 3D printed options.

     

    https://www.yeggi.com/q/lego+servo/

    https://www.thingiverse.com/search?q=Lego+Servo

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • danielw
    danielw over 6 years ago in reply to Workshopshed

    I'll be honest,  I thought of 3D printing some clips to hold the bells, I also thought to 3D print snowmen, but it takes away the fun of building lego!

    But I didn't thing to make the servos lego compatible!  Thanks for the links that's a great idea!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 6 years ago in reply to danielw

    Another thing you can do with those micro servos is to open them up and remove the end stop and the circuit board. Then they can be used as continuous rotation by adding a small driver circuit, either a transistor or h-bridge if you want bidirectional.

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

    Andy,

     

    I have taken one apart and thought about doing this, but getting the PCB to fit inside the casing seemed difficult and there didn't seem much point in having the PCB outside. However, lately I have been thinking whether it might be possible to remove all the electronics inside the casing, to leave just the DC motor and gears, and then 3D print a small casing. I am looking for some small DC geared motors that do not cost a fortune.

     

    Dubbie

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

    Andy,

     

    I have taken one apart and thought about doing this, but getting the PCB to fit inside the casing seemed difficult and there didn't seem much point in having the PCB outside. However, lately I have been thinking whether it might be possible to remove all the electronics inside the casing, to leave just the DC motor and gears, and then 3D print a small casing. I am looking for some small DC geared motors that do not cost a fortune.

     

    Dubbie

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • Workshopshed
    Workshopshed over 6 years ago in reply to dubbie

    I just removed the tiny PCB and fed some wires out of the case.

    Old fashioned Japanese Music Box

     

    I have seen some examples of small gear motors but have also been looking at small stepper motors, the kind you get in camera focusing mechanisms or disk drives

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • More
    • Cancel
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