It is with great pleasure that i can finally share this project with you!
When I first started with home assistant I knew nothing about electronics automations or any of this stuff. I followed tutorials and did what I could following Bruh at first until he mysteriously disappeared… if you’re out there Bruh hope you’re well… Then Dr.Zzs, digiblur etc…
Learning from all them, came in handy when I injured myself, pushing me to buy a bunch of sensors and gizmos and put together my version of the Bruh multisensor… but way cooler
So I thought i’d share back too.
I give you Artoo:
I bought a Die cast R2D2 and gutted it with a dremmel.
I took out all the unnecessary metal, but leaving enough to attach a servo with some glue.
it was tedious but it came out great.
In the dome i added a bunch of tiny leds in such a way that the little probes that stick out are functional.
I also added some RGB leds.
There’s a bunch of sensors: a BME 280, an mpu6050, a resistive light sensor on the top of his head, a capacative touch pad on the front (some copper I smashed soldered to a wire poked through the body), a DF player and the SD card , loaded with R2D2 sound effects and Star wars sounds & songs, is accessible from behind without having to open up the body, a PIR sensor that I placed in the dome in the same spot where there is a lens like indentation (i used a black PIR cover cut to fit), and last but not least a SERVO to move his head!!! (it took me a year to figure that one out… so many issues lol but now you can make one!)
There’s also a micro usb female jack embedded in the back, so that you can power him and flash him using a usb cable; I think you can also get tracks to play from usb but i haven’t tried that yet.
All this powered by a Tinypico ( i tried several boards this was the winner)
I have a tiny battery since there’s a BMS and monitoring pins on the pico, I pulled from a vape device that i’m still trying to figure out, not sure if it’'l make the cut… we’ll see…
I built this with esphome:
Still working on the automations and stuff, but since I finally got it all to work properly -and all the features lol (still testing the battery pins tho), well… here it is!
Enjoy!
substitutions:
hostname: 'Artoo'
esphome:
name: artoo
platform: ESP32
board: tinypico
wifi:
ssid: "XXX"
password: "XXX"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "$hostname Fallback Hotspot"
password: "XXX"
captive_portal:
# Enable logging
#logger:
# hardware_uart: UART1
# level: error
# Enable Home Assistant API
api:
password: "XXX"
# services:
# - service: control_servo
# variables:
# level: float
# then:
# - servo.write:
# id: my_servo
# level: !lambda 'return level / 100.0;'
ota:
password: "XXX"
web_server:
# Example configuration entry
switch:
- platform: restart
name: "Restart $hostname"
light:
- platform: monochromatic
output: Artoo_cerveau
name: "Cerveau - Pos"
default_transition_length: 0ms
- platform: monochromatic
output: Artoo_front_lamp
name: $hostname front lamp
default_transition_length: 0ms
- platform: monochromatic
output: Artoo_rear_lamp
name: $hostname rear lamp
default_transition_length: 0ms
- platform: rgb
name: $hostname's dome
red: Artoo_dome_r2
green: Artoo_dome_g2
blue: Artoo_dome_b2
- platform: rgb
name: $hostname's Back
red: Artoo_back_r1
green: Artoo_back_g1
blue: Artoo_back_b1
- platform: fastled_spi
chipset: APA102
data_pin: GPIO02
clock_pin: GPIO12
num_leds: 1
rgb_order: BGR
name: "$hostname led"
effects:
# - addressable_random_twinkle:
- addressable_random_twinkle:
name: Random Twinkle
twinkle_probability: 5%
progress_interval: 32ms
# - addressable_rainbow:
- addressable_rainbow:
name: Rainbow
speed: 10
width: 50
# - strobe:
- strobe:
name: Strobe
colors:
- state: True
brightness: 50%
red: 50%
green: 50%
blue: 0%
duration: 500ms
- state: False
duration: 250ms
- state: True
brightness: 100%
red: 0%
green: 100%
blue: 0%
duration: 500ms
# - flicker:
- flicker:
name: Flicker
alpha: 95%
intensity: 1.5%
# - addressable_color_wipe:
- addressable_color_wipe:
name: Color Wipe
colors:
- red: 100%
green: 100%
blue: 100%
num_leds: 1
- red: 0%
green: 0%
blue: 0%
num_leds: 1
add_led_interval: 100ms
reverse: False
# - addressable_scan:
- addressable_scan:
name: Scan Effect
move_interval: 100ms
scan_width: 10
# - addressable_fireworks:
- addressable_fireworks:
name: Fireworks
update_interval: 32ms
spark_probability: 10%
use_random_color: false
fade_out_rate: 120
# - random:
- random:
name: Random
transition_length: 5s
update_interval: 7s
# Example output platform
#servo:
# - id: my_servo
# output: Artoo_cerveau
# On ESP32, use ledc output
output:
- platform: ledc
pin: GPIO25
id: Artoo_cerveau
frequency: 50 Hz
min_power: 5% # 5% at 50Hz is 1mS (20mS cycles)
max_power: 10% # 10% at 50Hz is 2mS (20mS cycles)
channel: 1
- platform: ledc
pin: GPIO26
id: Artoo_rear_lamp
channel: 3
- platform: ledc
pin: GPIO27
id: Artoo_front_lamp
channel: 4
- platform: ledc
pin: GPIO15
id: Artoo_dome_r2
channel: 5
- platform: ledc
pin: GPIO14
id: Artoo_dome_g2
channel: 6
- platform: ledc
# pin: GPIO21
pin: GPIO04
id: Artoo_dome_b2
channel: 7
- platform: ledc
pin: GPIO18
id: Artoo_back_r1
channel: 8
- platform: ledc
pin: GPIO19
id: Artoo_back_g1
channel: 9
- platform: ledc
pin: GPIO05
id: Artoo_back_b1
channel: 10
i2c:
sda: SDA
scl: SCL
scan: True
uart:
tx_pin: TX
rx_pin: RX
baud_rate: 9600
id: uart_2
dfplayer:
on_finished_playback:
then:
- dfplayer.stop
# logger.log: 'Somebody press play!'
esp32_touch:
binary_sensor:
- platform: gpio
pin: GPIO23
name: "$hostname Motion"
device_class: motion
- platform: gpio
pin: GPIO34
name: "$hostname Change state"
- platform: esp32_touch
name: "$hostname touch"
pin: GPIO33
threshold: 1000
on_press:
then:
# - dfplayer.play:
- dfplayer.random:
- delay: 3s
- dfplayer.stop
# file: 1
# loop: false
## - output.turn_on: buzzer
## - delay: 1ms
## - output.turn_off: buzzer
## on_release:
## then:
## - output.turn_off: buzzer
sensor:
- platform: wifi_signal
name: "$hostname WiFi"
update_interval: 30s
id: signal
- platform: adc
pin: GPIO32
name: "$hostname Brightness"
unit_of_measurement: lux
filters:
- lambda: |-
return (x / 10000.0) * 2000000.0;
- platform: adc
pin: GPIO34
name: Bat
unit_of_measurement: "v"
- platform: bme280
temperature:
name: "$hostname ambient Temperature"
id: artoo_temperature
filters:
- lambda: return (x * (9.0/5.0) + 32.0) -10;
unit_of_measurement: "°F"
pressure:
name: "$hostname Pressure"
id: artoo_pressure
humidity:
name: "$hostname Humidity"
id: artoo_humidity
filters:
- lambda: return x +10;
address: 0x76
update_interval: 30s
- platform: mpu6050
update_interval: 10s
address: 0x68
accel_x:
name: "cerveau Accel X"
accel_y:
name: "cerveau Accel Y"
accel_z:
name: "cerveau Accel z"
gyro_x:
name: "cerveau Gyro X"
gyro_y:
name: "cerveau Gyro Y"
gyro_z:
name: "cerveau Gyro z"
temperature:
name: "$hostname head Temperature"
As a note, Logger seems to have to be turned off otherwise no-go. I’ve tried many configurations even without the DF player, and it won’t work with logger (but who cares now that i got it to work!!!)
Also, i recommend creating some sort of disconnect on the TX and RX lines connecting to the DF player so that when you flash the Firmware the DF player doesn’t interfere. reconnect after flash, and then subsequent flashes can be done OTA.
Let me know if you’s like to know more and i’m happy to share.
Also happy to try out some automations if you’ve got em!!!