How I hacked my cats with an Arduino
Tags: arduino, iot, robotics, opensource
Published: 2020-02-05 19:19:16

Build an automatic laser pointer for cat for 5€

I have three cats and I love them… and they love chasing the uncatchable dot of a laser pointer. Playing with my three cats takes a lot of time and sometimes I don’t have much time for them 😿
I asked myself, why couldn’t my cats play with their favorite game on their own? Because it requires a human presence. So I decided to give them this opportunity and automated this process.

![cat laser](https://www.datocms-assets.com/21735/1580396085-1cjkdjmzqalj7gewcttwn9q.gif)

I built a laser turret for my cats, programmed to move randomly and connected with Wi-Fi.

I decided to use an esp8266 D1 mini because I think it’s awesome! It’s like an Arduino but it has a Wi-Fi module which allows to connect all your projects to the Internet. It’s small, cheap (2€) and compatible with the Arduino IDE.

![esp8266](https://www.datocms-assets.com/21735/1580396099-1rnfewor8unthxjmabx80sw.jpeg)

It allowed me to connect to Blynk. Now I can launch it remotely and program it with desired time and duration.
Blynk is a free Platform with iOS and Android apps to control boards such as the Esp8266, Arduino, Raspberry Pi over the Internet. It’s really simple to set up and have a working app in less than 5 minutes.

My Blynk app

![blynk app](https://www.datocms-assets.com/21735/1580396093-1lxnaneivyafclxdjudczw.png)

To build your awesome Laser Cat, you need:
To build your awesome Laser Cat, you need:
* A cat
* [A turret](https://fr.aliexpress.com/item/32532784948.html?spm=a2g0s.9042311.0.0.27426c37Dwvknv)
* [2 Servo motors SG90.](https://fr.aliexpress.com/item/32841541380.html?spm=a2g0w.search0104.3.3.24766411jHEjl5&ws_ab_test=searchweb0_0,searchweb201602_5_10065_10068_10843_10059_10884_10887_10696_100031_310_10084_10083_10103_451_10618_10304_10307_10820_10821_10302_526,searchweb201603_45,ppcSwitch_5&algo_expid=946e5d8e-be04-4643-8327-18404e7d01d1-0&algo_pvid=946e5d8e-be04-4643-8327-18404e7d01d1&priceBeautifyAB=0) One for each axis ( X and Y).
* [A laser module](https://fr.aliexpress.com/item/32820864697.html?spm=a2g0s.9042311.0.0.27426c37BEvk25)
* [An Esp8266 D1 mini](https://fr.aliexpress.com/item/32845084675.html?spm=a2g0w.search0104.3.16.3ecf5aa7Mfanue&ws_ab_test=searchweb0_0%2Csearchweb201602_5_10065_10068_10843_10059_10884_10887_10696_100031_310_10084_10083_10103_451_10618_10304_10307_10820_10821_10302_526%2Csearchweb201603_45%2CppcSwitch_5&algo_expid=29d5fe51-73b7-4bd0-997b-bd47e71e9a00-5&algo_pvid=29d5fe51-73b7-4bd0-997b-bd47e71e9a00&priceBeautifyAB=0)

![laser cat](https://www.datocms-assets.com/21735/1580396101-1tfbbygtivgfbcknuzemzsa.jpeg)

Here is my electronic diagram.
![electronic diagram](https://www.datocms-assets.com/21735/1580396090-1fcs2w1r5bqbxlinchatn2w.jpeg)

The “X” servo is attached to pin D5 and the “Y” servo to pin D6 and powered in 5V.
The laser module is attached to pin D7 which allows to power it in 3.3V.
⚠️ Powering the laser module in 5V could hurt cat eyes.


The code is open source and available on  **[GitHub](https://github.com/cynthiahenaff/catLaser)** (don’t forget to add a ⭐️).
https://github.com/cynthiahenaff/catLaser

> Enjoy your cat.

![cat](https://www.datocms-assets.com/21735/1580396095-1o4zl2u-s21epfbwzqtfboq.gif)