# Octopus Flex PCB (SulaJalmari)

nRF52840-based flex PCB project with a shape of an octopus. Because why not. You can read the story from [final.md](final.md).

<img src="pics/device_diagram.png" height=800> 


## Hardware specs

* **Board Structure:** 2x Flex PCBs (acting as the octopus head and legs) and 1x FR4 PCB (acting as the base board).
* **MCU:** nRF52840-QIAA (soldered directly to the flex PCB with a stiffener on the reverse side).
* **IMU:** ICM-20602 accelerometer (shares an interrupt line with the light sensor).
* **Light Sensor:** XYC-ALS21C-K1 I2C ambient light sensor (shares an interrupt with the IMU).
* **Leg LEDs:** 8x Blue LEDs running at 2mA (LED0603-RD).
* **Eye LEDs:** 2x Addressable RGB LEDs (WS2812B-2020).
* **Power & Battery:** TP4054 50mA battery charger, ME6211C22M5G-N 3V3 LDO, and XC6206P362MR 3V6 LDO (dedicated to the addressable LEDs).
* **Connectivity:** Bluetooth with a minimal PCB trace antenna, USB-C for power/programming/serial, and a 5V rail to chain multiple devices together.
* **Audio & Haptics:** Buzzer with a driving transistor, plus a footprint for a vibration motor (motor ultimately not installed in the final version).
* **Interface:** 2x tactile user buttons, 1x tactile reset button, and an on/off switch.
* **Debugging:** Base board debugging pins compatible with a standard ~$3 DAPLink debugger via pyOCD/OpenOCD.
* **Aesthetics:** Silkscreen suction cups and mouth.

> Schematics and gerbers are under [Hardware/V3](Hardware/V3)

<img src="pics/smack.gif">

## Fun facts

### Fun Things
* Because the assembled PCBs take the physical shape of an octopus, the whole device wobbles when shaken.
* When the device is wobbling and the LEDs are running PWM, the movement actually allows you to see the PWM cycle with your naked eye.
* The IMU is mounted in the very top of the head. This means you can tap the top of the device, and the accelerometer registers it as a physical button press.

### Flaws
* During "stress testing" (read: repeatedly slamming it against the base board), some of the MCU pins eventually detached. Please don't torture the electronics!
* The vibration motor was mostly unnoticeable, leading to its removal from the final assembly. (Pins to connect a motor still exist)
* Transporting an assembled device safely is tricky.

## Software

> Checkout [chill](https://git.aintmina.org/aintgit/chill) project for building zephyr app with MCUboot.

## History

### Idea
Paper cutout with magnet connections.

<img src="pics/paper_model_v1.jpg">

### First prototype

<img src="pics/prototype1-3.jpg">

### Second prototype

<img src="pics/Device1.jpg">

### Final version

<img src="pics/final_device.jpg">