attiny 85 ir shield PCB + code + how to use code
follow me on instagram [https://www.instagram.com/techscapades/] for more cool projects :D
BILL OF MATERIALS:
- AT TINY 85 (https://www.aliexpress.com/item/606895785.html) //I recommend getting from alibaba instead
- VS1838B (https://www.aliexpress.com/item/32452383491.html) //pinout: https://buyhere22.com/image/cache/data/products/236/236159/ir-vs1838b-pinout-800x800.png
- Right angle push button switch (https://www.aliexpress.com/item/4000864377668.html) //I got the 6x6x5 version
- Toggle switch (https://www.aliexpress.com/item/32989785276.html?algo_pvid=2afdb9c4-8a46-46d0-b99b-37b43d753335&algo_exp_id=2afdb9c4-8a46-46d0-b99b-37b43d753335-2) //I bent the legs at 90 degrees before soldering
- IR Shield (gerber files in repo, I used JLCPCB to manufacture cause they're really fast and the PCBs have good quality)
- Male and female 2.54mm header pins
Notes:
- I chose to solder the right angle push button switch on the bottom side of the PCB because its easier to press, but you can do it on the top as well
- The toggle switch allows you to toggle between pogramming mode and normal operation mode so you dont have to keep plugging and unplugging your attiny 85, [ Toggle switch back to front --> programming mode (can also be used to disable the at tiny 85 if left in back position)] [Toggle switch front --> operation mode]
Arduino IDE pre-requisites
- This project uses this library: https://github.com/adafruit/Adafruit-Trinket-USB make sure you download it, extract it, and place it into your 'libraries' folder in arduino
- Make sure you have the Digispark boards installed, if not: (a) File > Prefences > Additional Boards Manager URLs (b) paste: http://digistump.com/package_digistump_index.json (c) Tools > Boards Manager (d) Search: digispark and install "Digistump AVR Boards" (e) select board: Tools > Board > Digistump AVR Boards > Digispark(Default - 16.5mhz)
How to use the code
- By default "#define DEBUG 1" is stated, this is used to find out IR codes from IR remotes
- Open notepad
- Point you IR remote at the reciever and record what IR code is shown after you press the button
- #define your_button your_button_IR_code
- In void Action() function, add "case your_button:" and then choose what keycode you want it to execute from: https://github.com/adafruit/Adafruit-Trinket-USB/blob/master/TrinketHidCombo/TrinketHidCombo.h note that you can also choose to execute a bunch of keycodes as well, explore :D
- In runPushButtonCmd() function, run a command or list of commands when the side push button is pressed, I use it to automate the series of keypresses I execute the most
If you want to change the name of the device, go to:
- Arduino>libraries>TrinketHidCombo
- open "usbconfig.h" file in notepad
- comment out "#define USB_CFG_VENDOR_NAME" and "define USB_CFG_VENDOR_NAME_LEN"
- Change "#define USB_CFG_DEVICE_NAME" to what ever you want, putting wach character in single quotes and spacing them with a comma example: #define USB_CFG_DEVICE_NAME 'K', 'e', 'y', 'b', 'o', 'a', 'r', 'd', '-', 'M', 'o', 'u', 's', 'e', ' ', ' C', 'o', 'm', 'b','o'
- Change "#define USB_CFG_DEVICE_NAME_LEN" to match the number of characters in #define USB_CFG_DEVICE_NAME example: #define USB_CFG_DEVICE_NAME_LEN 20 // 20 corresponds to the number to of chars in 4. example, note that spaces are counted as 1 char
- Save it and exit, then compile the code to reflect changes
- Go to devices manager to check if device name changed.