Skip to main content
Version: FILS English

Aura Cube

An interactive, IoT-enabled smart cube that is inspired by the classic Magic 8-Ball.

info

Description

The Aura Cube is a reimagined, high-tech version of the classic Magic 8-Ball. When the cube is picked up and shaken, an internal motion sensor detects the movement and wakes the system up from sleep mode. A bed of LEDs pulses for 5 seconds to simulate "thinking" while the cube connects to Wi-Fi to fetch a unique quote from the ZenQuotes API. Based on the ambient room lighting, the OLED screen automatically adjusts to dark or light mode to display the quote. If the internet is down, it falls back to a locally stored list of emergency quotes.

Motivation

I chose this project because it is a highly interactive and fun way to explore embedded systems and IoT concepts. It combines multiple hardware inputs, as motion and light sensors, web API communication, and power management (sleep modes and hardware interrupts) into a single, independent device. Reinventing an old classic toy and creating the modern version of it makes it a great way to learn how modern technology can enhance a simple concept.

Architecture

The architecture is built around a single System-on-Chip that handles both peripheral control and networking. Aura Cube Architecture Schematic

The Central Controller -> Raspberry Pi Pico 2W This is the core of the project. It acts as the central hub that processes all incoming sensor data, manages the power states, drives the display and LEDs, and handles the wireless internet connection.

The Inputs -> Sensors These components gather information from the exterior and send it to the Pico :

  • LIS3DH Breakout (Motion Sensor): Detects physical movement (when shaking the cube). It communicates data over the I2C Bus, but importantly, it also uses a dedicated GPIO Interrupt line. This allows the sensor to instantly wake the microcontroller up from sleep mode without the Pico having to constantly check for movement.

  • BH1750 Digital Light Sensor: Measures the ambient brightness of the room. It shares the I2C Bus with the motion sensor to send light level data to the Pico so the display can adapt.

The Outputs -> Visuals These components provide feedback to the user based on the Pico's instructions.

  • Display: Shares the exact same I2C Bus as the sensors to receive text data (the quotes) from the Pico and display it on the screen.

  • LEDs: Connected via PWM (Pulse Width Modulation) pins on the Pico. Instead of just turning on and off, PWM allows the Pico to control their brightness, enabling the soft pulsing "thinking" effect.

The Power Management System This isolates the raw battery from the sensitive microcontroller to ensure safe operation.

  • Batteries: The raw, mobile energy source for the cube. 3 AA batteries connected in series which will send 4.5V to the Microcontroller.

The External Network

  • ZenQuotes API: A remote web server. The Pico uses its onboard Wi-Fi chip to reach out to the internet, request a random quote from this API, and download the text to show on the display.

Log

Week 7 - 10 April

After my project was approved, I finalized the component list. Initially I was using an STM32 and an ESP32, but after receiving advice from my tutors, I decided to switch to a Raspberry Pi Pico 2W. I ordered everything, and began studying each component. I conducted a few experiments with the components to both test their functionality and learn more through practical exercises.

Week 12 - 18 May

The KiCAD schematic is completed, featuring an upgraded design with dual 74HC595 shift registers. Both the code and the physical assembly development are currently underway. Furthermore, I've started taking the necessary measurements for the 3D modeling of the cube's exterior design.

Week 19 - 25 May

I've finished the code and printed the 3D design. I've decided to use the rgbled to show the state of the process of "fetching the code", so that I'll be able to tell when the quote is from the Internet or from the Default list. After running a few test, to check the connection via hotspot, I've put everything inside the cube and succesfully finished the project.

Hardware

Aura Cube Design and Interior

The hardware setup centers around a Raspberry Pi Pico 2W, which serves as the main controller and handles Wi-Fi connectivity. It is connected to a LIS3DH motion sensor and a BH1750 digital light sensor. The motion sensor sends hardware interrupts to the Pico, waking it from deep sleep when a physical shake higher than a certain value is detected. For visual feedback, 5mm clear blue and white LEDs are connected, lighting to simulate a "thinking" state while the system connects to the internet to fetch a quote.

To display the output, an OLED screen is wired to the Pico 2W. The OLED display, along with the motion and light sensors, communicate with the microcontroller. The system uses the ambient lux data from the BH1750 to dynamically adjust the OLED's display contrast based on the room's current lighting conditions.

Because the cube is a standalone IoT device, it is powered by batteries rather than a constant USB connection.

Schematics

Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe main microcontroller and Wi-Fi module50 RON
LIS3DH BreakoutMotion sensor for wake-up interrupts30 RON
BH1750 Digital Light SensorAmbient light sensing for display mode13 RON
0.96" SSD1306 (128x64) I2CDisplaying the quotes20 RON
5mm Clear Blue & White LEDsVisual "thinking" feedback5 RON
3xAA Alcaline BatteriesMobile power supply20 RON
74HC595IC5 RON
Resistors (220 ohm), Wires, BreadboardBasic electronic prototyping30 RON

Software

LibraryDescriptionUsage
embassy-rpHardware Abstraction Layer for RP seriesCore peripheral management (I2C, PWM, GPIO interrupts)
embassy-usbUSB Device StackProviding USB CDC ACM (Serial) communication over the microcontroller's USB port
embassy-executorAsync Runtime & TimekeepingSpawning asynchronous tasks and handling delays/timers
embassy-tlsTransport Layer SecurityEstablishing secure (TLS) connections over TCP
embedded-hal / embedded-nal-asyncCore Embedded TraitsStandardized hardware-agnostic interfaces for async network addressing, TCP connections, I/O writes, and I2C
cyw43 / embassy-netNetworking stackManaging Wi-Fi connections and TCP/IP sockets for the Pico 2W
static cellStatic Memory ManagementSafely allocating static memory buffers
ssd1306Display driverInterfacing with the OLED screen
lis3dhAccelerometer driverReading G-force data and configuring interrupts
bh1750Light sensor driverReading ambient lux values
serde-json-coreJSON parserParsing the text response from the ZenQuotes API
  1. ZenQuotes API
  2. Embassy Framework Documentation
  3. Raspberry Pi Pico W Rust Guide
  4. Guide to Embedded Rust Programming on Raspberry Pi Pico 2 (RP2350)
  5. Picotool