Facebook counter from old electric meter

We did a physical Facebook like page counter. From the old electric meter. At the heart of the programmable board Iskra Neo from Amperki (analogue of Arduino) and a servo motor of constant rotation.

To monitor the growth of likes, we set up an online camera aimed at the counter, and rendered the button to the likes of the blog. I also like to deal with electronics and manage things through the Internet.

This is the first experience.

How is it done

Electronics for getting likes has already been assembled and tested in the project Amperki, it is enough just to collect. It turned out that it was not so easy when I wanted to do everything on Arduino Uno instead of the Spark. It did not work because of the different principles of working with the UART (the WiFi module receives signals through it). In order not to write a software UART, I had to score on Arduino and use the original Iskra Neo.

The module cannot request the number of likes directly from the fb page, as it does not work with HTTPS. To bypass the restriction on the server hangs a PHP script that finds out the number of likes and is issued as a variable. And the module already addresses the address of this PHP script using AT commands(remember, earlier it was possible to tell the modem ATDP XXX, where XXX is the telephone number and he started calling him? that's what they are)

Electronics was ready, I divided the remaining tasks into two parts:

  • Drive for counter
  • Control program

Drive for counter

It would be great to make an elegant solution to connect the meter with a current supply to the original coil. Then it was possible to leave the rotating disk, and at the minimum interfere with the design. But it is difficult to implement, therefore, postponed until the next version. Now in the counter, a constant-rotation servomotor is attached directly to the gears that rotate the counter.

Control program

First, I calculated how many milliseconds to turn on the motor so that it turns the disk one turn. It turned out about 1650 ms. Immediately it became clear that this figure changes from the voltage in the network (and for some reason it sometimes jumps), and from the reading of the meter's wheels. They were developed about 50 years ago and then plus or minus half of the numbers then did not play a role.

The program needs to know what exactly the counter shows, and we at least have the opportunity to manually adjust it. To find out the exact number of degrees that the motor turned the wheels, you will need a sensor like a throttle position sensor on a car, this is difficult.

Therefore, in the first version, there is an electronic display next to the counter to control the correctness of the readings, and two buttons with which you can manually adjust the counter if it did not run off somewhere. Semi-manual mode, and what to do.

The program provides a variable that stores the number of likes on a physical counter. When you turn off the power, it is stored in the EPROM and when turned on, it is taken back from there.

This is necessary so that when disconnected from the network, they know how much the meter needs to be corrected.

What is the result?

It turned out a cool art object. Before setting up the camera and hanging it on the wall in our room, we put it on display in the common area of ​​coworking.

He is still far from perfect. There is a lack of accuracy, the servomotor sometimes starts spinning by itself when the power is turned on and there is no original rotating disk.

We will improve in the next version.

Also popular now: