INSPIRATION BEHIND PROJECT
I know we all are bored amid this coronavirus pandemic; most of us have plenty of time to work on our skills, or do fun things in my case working on electronics, which I would say is my passion.
I had purchased xiaomi’s Gikker’s cube long time back because I was fascinated to see that it was not a normal rubik’s cube but a smart cube with BLE technology in-built. The Rubik cube connects to an app called Supercube, which can teach you how to solve Rubik’s cube, and there are many fun variation, games, quizzes etc.
IDEA TO IMPLEMENTATION
As most of the such gadget, initially we are very fascinated but later it just collect dust kept lying around somewhere in cupboard.
Recently I started working on ESP32 modules , which are highly used in IoT field because it adds Wi-Fi to your project in some simple steps. After learning some basics of BLE and how it works on code front, I built some basic project application.
I came across one this amazing video on YouTube, which explained that data in this cube is not protected, and how the cube data is directly broadcast when you connect any BLE device for example a mobile.
- Arduino IDE with ESP32 core installed
- Basic terminology about BLE, service, and characteristics
- nrfConnect Nordic App
MAC ID OF RUBIX CUBE
Open nrfconnect APP and twist the Rubik’s cube. MAC ID will be displayed directly on nrfconnect app.
I assume you already have basic knowledge of Arduino and how to use upload program to ESP32. After successful upload, open the serial monitor. ESP32 act as a master device and connected to Rubik’s cube.
ESP32 will connect to MAC ID specified in the code. It will determine required service and characteristics where moves of Rubik’s cube is broadcasted.
You can check the service and characteristic UUID in nrfconnect app
The solution stage data is already hardcoded in the Arduino code. You can code your required outcome in dosomething() function. I activated relay for 5 second in this example, you can add any other function of your choice.