Arduino XMAS hitcounter by alex_weber
Featured
IMGP2495.JPG
IMGP2499.JPG
Christmas is coming closer, so here is my contribution to put you in the right mood. It is a blog hitcounter, that rings a bell. Literally. It puts a smile on your face, every time someone hits your blog.

It consists of an Arduino board, a bell, a servo and a couple of lines of code in c, python and php. Most parts are fairly common and should be easy to get.


 
Remove these adsRemove these ads by Signing Up

Step 1: Tools and Materials

IMGP2530.JPG
So what is needed?

  • Arduino Board. I got an Arduino Diecimila from Adafruits. In the meantime there are really cheap and handy clones out there, e.g. the really bare bone board from Modern Devices, especially if you want to use them on a breadboard.
  • A servo motor. Any servo will do. I took an old one that was used in my former hobby.
  • A bell. Preferably one that is small enough to shake it with the servo.
  • Two paperclips. A large one to hold the bell and a small one to build the actuator to ring the bell.
  • Wires to connect the servo with the Arduino.
  • A website. In fact it has not to be a website or a blog. Actually everything that can be counted, will work.
  • A PC or a Mac to connect the Arduino board with the blog or website.
You may need an soldering iron, if the wires can not be connected directly to the Arduino.
1-40 of 46Next »
tli4 says: Mar 28, 2013. 8:29 AM
Can you change the code so that an LED Blinks when it gets a hit? Thanks. Please reply soon!
klaurens says: Dec 29, 2011. 9:29 AM
If I wanted to connect a Normal DC Motor to the Arduino which only has two connector pins, how would i do it??
jhall30 says: Jun 18, 2012. 5:29 AM
I wouldn't recommend doing this. There are motor controllers for the Arduino that can handle the current requirements of DC motors.
etylerawesome says: Apr 29, 2012. 11:49 AM
Where is the code that needs to be put into the computer program?
alex_weber (author) says: Apr 30, 2012. 9:44 AM
Take a look at step 5.
cdousley says: Apr 8, 2010. 3:25 PM
where could i get a servo?
klaurens says: Dec 30, 2011. 5:13 AM
Any place that sells Remote controlled Helicopters, cars, etc. Radio Shack will have them too...
cdousley says: Feb 15, 2012. 3:35 PM
Thank you good sir
klaurens says: Dec 29, 2011. 9:38 AM
If I wanted to connect a Normal DC Motor to the Arduino which only has two connector pins, how would i do it??
alex_weber (author) says: Dec 30, 2011. 2:10 AM
You can't because the motor needs too much current. You have to use an H-bridge or a motor shield from adafruit or something like that.
klaurens says: Dec 30, 2011. 5:05 AM
If I wanted to use a Piezo and an LED would the coding be much different??
alex_weber (author) says: Dec 30, 2011. 5:09 AM
Piezo and LED can be driven directly from the Arduino. Maybe look for an Arduino tutorial to learn how to deal with LEDs and Piezos.
SimonUK says: Dec 17, 2011. 1:01 PM
This is such a great idea, and inspired my own interpretation, which is standalone - no computer required. Have a look here:

http://www.instructables.com/id/Arduino-standalone-web-enabled-bell/
PaulCote says: Nov 26, 2011. 7:05 PM
Ring the bell every time someone tweets "Merry Christmas"? Not sure how, though.
Buzzsushi says: Dec 4, 2010. 12:44 PM
Will it work with twitter?
liamviney says: Mar 2, 2011. 9:42 AM
Did you manage to implement this with twitter? and if so would you be willing to share the code?

Thank you
alex_weber (author) says: Dec 5, 2010. 12:36 AM
What do you mean, ring the bell when someone replied to you on twitter?
Yes, that should be no problem.
aeboi80 says: Oct 28, 2010. 9:39 PM
I was looking for the bell and found a bunch of places at google shop - http://bit.ly/aCeJtS
moogbeatz99 says: Oct 14, 2010. 2:19 PM
how would i set up this hit counter thing with a google site? would it work at all? im not planning on actually doing this instructable, i might when i get spare time and money, but i would like to actually know if it would work.....
psychofish25 says: Nov 11, 2009. 4:08 PM
 i'd like to implement this with blogger (http://ilictronix.com), but blogger doesn't support php :(  is there a way I could write to a file with javascript?

hearing this every 15 seconds might get annoying :P
ReCreate says: Jul 7, 2009. 5:04 PM
So what does the python script do when it sees someone visited your site?
alex_weber (author) says: Jul 7, 2009. 11:17 PM
It fetches a small text file from my site. This text file carries the number of hits. If the number of hits is higher than last time, then trigger the bell.
ReCreate says: Jul 8, 2009. 9:46 AM
XD Yes i know that part how does it trigger the bell?
alex_weber (author) says: Jul 8, 2009. 11:24 AM
It sends a signal via serial port to the Arduino. Do you mean that?
ReCreate says: Jul 8, 2009. 1:55 PM
What signal(you are not being descriptive...)
alex_weber (author) says: Jul 8, 2009. 2:23 PM
Take a look at the python snippet:
while (True):
_ counter = urllib.urlopen(myUrl).read()
_ delta = int(counter) - int(last_counter)
_ print "counter: %s, delta: %s" % (counter, delta)
_ ser.write(chr(ord(chr(delta))))
_ last_counter = counter
_ time.sleep(10)

It computes the delta between the last counter value and the current counter value. Say, the old value was 112, now it is 115. Next the delta, 3 is send as byte over the serial port to the Arduino. The Arduino reads the byte and rings the bell three times.
ReCreate says: Jul 8, 2009. 2:32 PM
Ah that makes more sense now.
Maker Shed says: Jun 26, 2009. 12:31 PM
Wow nice Project!
akatsuki666 says: Feb 9, 2009. 3:57 PM
and that thing with the loop (thats a reoccuring problem in alot of skeches)
akatsuki666 says: Feb 8, 2009. 2:43 PM
my arduino barly takes any codes wthout saying error -.- and this one seems to say that... in function ' void loop () ' : error: ' refresh ' is not a member of ' servo '
alex_weber (author) says: Feb 8, 2009. 11:33 PM
Hi Akatsuki666, try deleting the line with refresh. If you are using the latest version of the ArduinoIDE, the method "refresh" is no longer available. Cheers, Alex
akatsuki666 says: Feb 8, 2009. 2:43 PM
help?
luke says: Dec 27, 2008. 7:52 PM
hahah i love it , 5* and faved!

i have to ask , i didnt see it in your description. but what is your your macbook playing ?? it sounds like you have got the termnal to sing! useing the saay command???
alex_weber (author) says: Dec 28, 2008. 1:00 AM
accobra86 says: Dec 8, 2008. 8:38 AM
www.youtube.comGood work. my son (says proud father) made similar use of the RC servos in a Golf Robot RC. Can be found on youtube.com under this name... http://www.youtube.com/results?search_query=golfrobot+sigtuna&search_type=&aq=f
Kryptonite says: Nov 22, 2008. 12:08 AM
Is it possible to hook it up to anything else? say... when some body talks to u on msn and ur in the next room, cud u hook that up? or instructables comments? Just idea, but this wud be soooo neat to try out for them.
alex_weber (author) says: Nov 22, 2008. 1:25 AM
Hi Kryptonite, yes, that would be possible. You would have to modify the python script to fetch an RSS feed for example. Most messaging systems or comments are availble as RSS feed. If a new message or comment is available in the feed, the python script will receive it and notify the Arduino/bell. For the comment feed on instructables, go to your profile and enable your private feed. Cheers, Alex
Kryptonite says: Nov 22, 2008. 2:45 AM
Sweet. thanks for the quick reply. I'm seriously thinking about making this now, cuz I play this game, and I can't tell if somebody want to talk to me I don't know. Then an hour later I go see, and the person has logged off. thanks, Kryptonite.
iman says: Apr 6, 2008. 1:15 PM
wow this is sweet I saw this a while back but I ignored it because I didn't have an arduino but now that I got one this will be my first project :) Thanks!
cr0ybot says: Feb 10, 2008. 10:53 AM
Added to Arduino Group! ;D
1-40 of 46Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!