Arduino WS2812B Ambilight with Digispark Attiny85 IR Remote

The idea is building an Arduino based Ambilight, equipped with switch to choose between :

  • running WS2812B as reguler ambilight, controlled by Prismatik apps on PC; or

  • running selected custom light effects on WS2812B

There is only 1 main switch for all the tasks, as follows :

  • Long press : toggle between ambilight / custom effects mode

  • Short press : in ambilight mode has no effects, in custom effects mode, change effects.

This switch is placed paralleled with one output pin from Attiny85, taking data from IR sensor, feeding an input pin of Arduino Nano as the main engine. Thus, switches presses can also be obtained (simulated) from processed IR signal.

I use Attiny85 to process received IR signal because Arduino Nano cannot handle multiple job of controlling WS2812B simultaneously with IR processing.
Both of them need particular delay / precise timing, and processing both will compromise one or the other. They just dont mixed up in one Nano.

Schematics is as follows. Some resistors value may need adjustment, will try it out..

KEY1 is main controller switch. As for KEY2 placed to change mode of Attiny85 between receiving keys to control the Arduino, or setting new key set, store the config in Attiny85's EEPROM.

I set a low value (470) for R4, because I use Digispark version of Attiny85, and pin4 is pulled up with resistor to work as data pin for USB connection. Read it somewhere.. Previously I set 10k for R4, but KEY2 not working (value always HIGH).

I have built some of the steps, code, hardware and testing.. Hope can post some documentation about it later..

Code for Arduino Nano is :
Ambilight-010.ino (24.1 KB)

Code for Attiny85 is :
IRDigiKB-007.ino (4.7 KB)
and place this file EEPROM.h in same folder as the .ino file.
EEPROM.h (5.5 KB)


This tiny chip comes in handy when I have limitation in room space in my project box. But it also quite an experience when I need to trace any unexpected errors / outputs. It contains no hardware UART capability, and flash memory limited to maximum of 6kB.
So, I tried to use Software Serial, DigiKeyboard, Adafruit Trinket Keyboard just to get some readable debugging output.
I choose Digikeyboard, and commenting out some of the code to preserve code size to meet flash memory size limits.


Oh, one small thing, forget to write : Arduino Nano is powered by USB port connected to PC running Prismatik. So I indeed not drawing any power (VCC) lines to Nano in schematics, except for the GND lines (common ground).


Testing the device...
https://youtu.be/MkbCE67Ckq0

Preview of project box...
https://youtu.be/vruMoJAseo8


1 Like

Sounds implausible

:slight_smile: :slight_smile: :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.