Instructables

Arduino powered Lucky Cat as physical Webcounter

Featured
Picture of Arduino powered Lucky Cat as physical Webcounter
Everybody wants to know how many pageviews your own website has. But see what's happening you need some analytics code and stuff like this. I wanted to be connected to the wold when I'm sitting on my couch so I connected my Lucky Cat to the internet.
Whenever someone visits a page on my website www.janhimself.de the cat waves it's arm for a while. At night though I need some silence. So I built in a RGB LED which changes its color whenever a new pageview happens.

All you need is:
a Lucky Cat
an arduino ethernet
a RGB LED
two small yellow LEDs
a light sensor
a servo
and a two digit seven segment display (I harvested mine from an old stereo and built a little circuit using some resistors and two shift registers)
 
Remove these adsRemove these ads by Signing Up

Step 1: The Servo

The mechanical part is easy: opening up the cat you can see the counterweight of the arm. When the servo turns, the spring hits the counter weight of the arm and the arm swings for something like 20 seconds. I use some hotglue and part of a small plastic thingy to place the servo beneath the cats mechanics.
(I coded something like a time delay into the software part, so that the servo does only swing the arm once every 20 seconds. So if there would be multiple pageviews in that time, the counter would count them, but the arm just moves every 20 seconds until the work is done)

mischka1 year ago
The "Lucky Cat" is a cool display! Nice project.
koogar1 year ago
Hi Janwil ,

i love the idea of storing a .gif and counting the requests for it .Its a nice workaround for people who don't have a host that supports scripts such as google blogger.Could i request the sketch pls ? as i have a bell here waiting to ring when i get a hit on runawaybrainz.blogspot.com ,but till now it hasn't been possible .

Best Regards

Rupert
janhimself (author)  koogar1 year ago
Hi Rupert,

the only thing you have to include into your blog or website is a gif, pointing to the arduino. I used dyndns to get something like a "fixed" ip, so the url for the gif is like mywebsite.dyndns.org/192.168.178.188/counter.gif where 192.168.178.188 is the arduinos ip here in my homenetwork. Include the gifs url into your website and it will be directed to the arduino. On the arduino site you'll need to include the part of the sketch here in the instructable starting with // listen for incoming clients... 

Nice blog you have there
Jan
billbillt1 year ago
"lucky Cat" is something new and cool to me...
very cute, love the idea! can you explain a little more about how you set this up? there is in image on your page that you have stored in the Arduino? where are you hosting the other files on your site? can you post a link to the site?
thanks!
janhimself (author)  amandaghassaei1 year ago
The setup on the website is easy: there's just a .gif pointing to the url of the arduino:

The ip of the arduino here in my homenetwork is determined within it's sketch. So whenenver a browser asks for that .gif it's directed right to the arduino. The arduino does recognize that and send's back an 200ok line to the browser so that the browser finishes loading the website. So there's never a real image send, it's just used to point the browser to the arduino.
ok, thanks for the info
ALso what are the colors you explain in the beginning such as red pin etc, are these part of your shift register pins? Im curious as to your basic display counter with the 2 7 segment displays do you have more info on that circuit?
Anyway cool idea!
janhimself (author)  hankenstien1 year ago
The colors are the variables for the RGB LED which lights up at night instead of waving the cats arm.
The seven segment displays setup could be part of another instructable I think. basically its 14 LEDs which are controlled by the arduino. Normally one would have to use 14 pins on the arduino, but with using shift registers, you just have to use three arduino pins to control the LEDs. I'll search for my notes on that and jot it down in another instructable