Editor Version ×
recommended

Pro Edition

free

Brand new interactions and interfaces

Smooth support for design sizes of over 3W

devices or 10W pads

More rigorous design constraints, more

standardized processes

For enterprises, more professional users

Std Edition

Easy to use and quick to get started

The process supports design scales of 300

devices or 1000 pads

Supports simple circuit simulation

For students, teachers, creators

Ongoing

STD ATtiny13 TinyNightLights

ATtiny13 TinyNightLights

Project tags

License

CC BY-SA 3.0

License: CC BY-SA 3.0

Mode:

Mode

Editors' pick

Editors' pick

Cloned from ATtiny13 TinyNightLight

  • 1.6k
  • 0
  • 7
Update time: 2023-12-09 14:28:11
Creation time: 2022-07-23 11:33:25
Description

Description

# Overview TinyNightLight is a rotary encoder controlled and battery powered nightlight with NeoPixels based on the ATtiny13A. - Firmware (Github): https://github.com/wagiminator/ATtiny13-TinyNightLight ![TinyNightLight_pic3.jpg](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyNightLight/main/documentation/TinyNightLight_pic3.jpg) # Hardware ## Schematic ![TinyNightLight_wiring.png](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyNightLight/main/documentation/TinyNightLight_wiring.png) ## WS2812 Addressable LEDs WS2812-2020 is an intelligent control LED light source, which integrates the control circuit and RGB chip in a small 2020 package. It internally contains an intelligent digital port data latch, a signal conditioning gain driver circuit, a precision oscillator and a voltage-programmable constant current control part, which effectively ensures that the pixel point light color level is consistent. Make sure you use the 5mA variant. ## MCP73831 Li-Ion Battery Charger IC For battery charging the MCP73831 is used. The MCP73831 is a highly advanced linear charge management controller for use in space-limited, cost-sensitive applications. It employs a constant-current/constant-voltage charge algorithm with selectable preconditioning and charge termination. The constant current value is set with one external resistor (I = 1000V / R2). Charging is done via the built-in USB-C connector. The MCP73831 can be replaced by the much cheaper TP4054 without further modifications. ## Power Path Control The device can be operated both by battery and external power. The load sharing power path control system interrupts the connection between the battery and the load when an external power supply is connected. In this case, the device is powered by the external power supply while the battery is being charged. This protects the battery and increases its lifespan. Without an external power supply, the device is powered directly by the battery. # Software ## NeoPixel Implementation The NeoPixel implementation is based on [NeoController](https://github.com/wagiminator/ATtiny13-NeoController). ## Compiling and Uploading the Firmware Since there is no ICSP header on the board, you have to program the ATtiny either before soldering using an [SOP adapter](https://aliexpress.com/wholesale?SearchText=sop-8+150mil+adapter), or after soldering using an [EEPROM clip](https://aliexpress.com/wholesale?SearchText=sop8+eeprom+programming+clip). The [AVR Programmer Adapter](https://github.com/wagiminator/AVR-Programmer/tree/master/AVR_Programmer_Adapter) can help with this. Remove the battery before connecting the device to the programmer. ### If using the Arduino IDE - Make sure you have installed [MicroCore](https://github.com/MCUdude/MicroCore). - Go to **Tools -> Board -> MicroCore** and select **ATtiny13**. - Go to **Tools** and choose the following board options: - **Clock:** 9.6 MHz internal osc. - **BOD:** BOD 2.7V - **Timing:** Micros disabled - Connect your programmer to your PC and to the ATtiny. - Go to **Tools -> Programmer** and select your ISP programmer (e.g. [USBasp](https://aliexpress.com/wholesale?SearchText=usbasp)). - Go to **Tools -> Burn Bootloader** to burn the fuses. - Open the TinyNightLight sketch and click **Upload**. ### If using the precompiled hex-file - Make sure you have installed [avrdude](https://learn.adafruit.com/usbtinyisp/avrdude). - Connect your programmer to your PC and to the ATtiny. - Open a terminal. - Navigate to the folder with the hex-file. - Execute the following command (if necessary replace "usbasp" with the programmer you use): ``` avrdude -c usbasp -p t13 -U lfuse:w:0x3a:m -U hfuse:w:0xff:m -U flash:w:tinynightlight.hex ``` ### If using the makefile (Linux/Mac) - Make sure you have installed [avr-gcc toolchain and avrdude](http://maxembedded.com/2015/06/setting-up-avr-gcc-toolchain-on-linux-and-mac-os-x/). - Connect your programmer to your PC and to the ATtiny. - Open the makefile and change the programmer if you are not using usbasp. - Open a terminal. - Navigate to the folder with the makefile and the sketch. - Run "make install" to compile, burn the fuses and upload the firmware. # Operating Instructions Place a 3.7V protected 16340 (LR123A) Li-Ion battery in the holder. The battery can be charged via the USB-C port. A red LED lights up during charging. It goes out when charging is complete. The device has four different states, which can be switched between by pressing the rotary encoder button. |State|Description| |:-|:-| |0|All LEDs are off and the ATtiny is in sleep mode.| |1|All LEDs light up white. The brightness can be changed by turning the rotary encoder. The brightness set by this is also retained for the following states.| |2|The LEDs show a color animation with the previously set brightness. The speed of the animation can be adjusted using the rotary encoder.| |3|All LEDs show the same color with the previously set brightness. The color can be changed by turning the rotary encoder.| ![TinyNightLight_pic4.jpg](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyNightLight/main/documentation/TinyNightLight_pic4.jpg) # References, Links and Notes 1. [ATtiny13A Datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/doc8126.pdf) 2. [WS2812-2020 Datasheet](https://www.led-stuebchen.de/download/WS2812-2020_V1.1_EN.pdf) 3. [MCP73831 Datasheet](https://datasheet.lcsc.com/lcsc/1809191822_Microchip-Tech-MCP73831T-2ATI-OT_C14879.pdf) 4. [NeoPixel Implementation](https://github.com/wagiminator/ATtiny13-NeoController) ![TinyNightLight_pic1.jpg](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyNightLight/main/documentation/TinyNightLight_pic1.jpg) ![TinyNightLight_pic2.jpg](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyNightLight/main/documentation/TinyNightLight_pic2.jpg) # License ![license.png](https://i.creativecommons.org/l/by-sa/3.0/88x31.png) This work is licensed under Creative Commons Attribution-ShareAlike 3.0 Unported License. (http://creativecommons.org/licenses/by-sa/3.0/)
Design Drawing

Design Drawing

schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
ID Name Designator Footprint Quantity BOM_Supplier BOM_Supplier Part BOM_Manufacturer BOM_Manufacturer Part
1 CR123A B1 TH_L43.0-W-18.0-CR123A 1 LCSC C2803347 null CR123A电池座
2 100n C1,C6,C7,C8,C9 C_0603 5 LCSC C14663 YAGEO CC0603KRX7R9BB104
3 10u C2,C5 C_0603 2 LCSC C96446 SAMSUNG CL10A106MA8NRNC
4 330u C3 TANTALUM_CASE-D 1 LCSC C105408 AVX TAJD337M010RNJ
5 4u7 C4 C_0603 1 LCSC C69335 SAMSUNG CL10A475KA8NQNC
6 5817 D1 SCHOTTKY_SOD_323 1 LCSC C727114 TWGMC 1N5817WS
7 CHARGE LED1 LED0603 1 LCSC C2286 KENTO KT-0603R
8 WS2812-2020 LED2,LED3,LED4,LED5,LED6,LED7,LED8,LED9 WS2812-2020 8 LCSC C965556 worldsemi WS2812C-2020
9 DMP1045U-7 Q1 SOT-23-3_W 1 LCSC C177033 Diodes Incorporated DMP1045U-7
10 AO3401A Q2 SOT-23-3_W 1 LCSC C700954 HUASHUO(华朔) AO3401A
11 10k R1,R6,R8 0603 3 LCSC C25804 UniOhm 0603WAF1002T5E
12 2k R2 0603 1 LCSC C22975 UniOhm 0603WAF2001T5E
13 1k R3,R7 0603 2 LCSC C21190 UniOhm 0603WAF1001T5E
14 5k1 R4,R5 0603 2 LCSC C23186 UniOhm 0603WAF5101T5E
15 330R R9 0603 1 LCSC C23138 UniOhm 0603WAF3300T5E
16 Rotary Encoder SW1 ROTARY_ENCODER 1 LCSC C143789 BOURNS PEC11R-4015F-S0024
17 ATtiny13A U1 SOP-8_150MIL 1 LCSC C14075 MICROCHIP ATTINY13A-SSU
18 MCP73831T-2ATI/OT U2 SOT-23-5_BR 1 LCSC C14879 MICROCHIP MCP73831T-2ATI/OT
19 USB-TYPE-C-6PIN USB1 USB-C-SMD-6P 1 LCSC C283540 Korean Hroparts Elec TYPE-C-31-M-17

Unfold

Project Attachments

Project Attachments

Empty
Project Members

Project Members

Target complaint
Related Projects
Change a batch
Loading...

Comment

Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn