My kid was offered a cheap unicorn shaped lamp. It has RGB LEDs with some effects, an IR remote and an internal battery that allows it to run unpluged from the wall.
Seems to be exactly this model.
Of course I had to tear it down, no way I was going to “just use it” as intended.
Teardown
The solder jobs on the PCBs were out right criminal.
The battery seems to be an 18650 LiPo. It has what seems to be a thermal sensor next to it. The soldering job on the “BMS” is a botch job that scares the shit out of me, how is this crap a product marketed for children?
Reverse engineering
After some multimeter action
SOC pinout:
- Bottom button
- IR Pin 1
- IR Pin 2
- VCC
- NC
- White LEDs
- NC
- Switch 2 Pin 1
- Switch 2 Pin 2
- NC
- GND
- RGB Pin 1
- RGB Pin 2
- RGB Pin 3
ESPHomeification
I targeted a MVP. I’m ditching the IR remote and the movement sensor. I’m keeping the LEDs and the bottom button.
The bottom button is useful to turn it on and off without reaching for the phone or another controller.
status_led:
pin:
number: GPIO02 # GPIO02 is mapped to D4, so they are the same thing
inverted: true
light:
- platform: rgbw
id: rgbw_led
name: "RGB LED"
red: output_red
green: output_green
blue: output_blue
white: output_white
effects:
- random:
- pulse:
- flicker:
- strobe:
output:
- platform: esp8266_pwm
id: output_white
pin: D1
- platform: esp8266_pwm
id: output_blue
pin: D2
- platform: esp8266_pwm
id: output_red
pin: D3
- platform: esp8266_pwm
id: output_green
pin: D5
binary_sensor:
- platform: gpio
name: "Button"
pin:
number: GPIO12
inverted: true
mode:
input: true
pullup: true
on_press:
then:
- light.toggle: rgbw_led
Final result
Yeah… It turns out it works.
But…
Don’t overestimate the destructive power of a baby that is curious about a new toy. My flimsy solder joints never stood a chance.
It now stands destructed in the pile of projects on my desk.