Editor Version ×
Standard

1.Easy to use and quick to get started

2.The process supports design scales of 300 devices or 1000 pads

3.Supports simple circuit simulation

4.For students, teachers, creators

Profession

1.Brand new interactions and interfaces

2.Smooth support for design sizes of over 5,000 devices or 10,000 pads

3.More rigorous design constraints, more standardized processes

4.For enterprises, more professional users

Ongoing

STD ATtiny13 TinyTouchLight

License: CC-BY-SA 3.0

Mode: Editors' pick

Cloned from ATtiny13 TinyTouchLight

  • 1.8k
  • 0
  • 5
Update time: 2022-02-03 21:43:27
Creation time: 2021-09-05 10:09:06
Description
# TinyTouchLight - Dimmable USB Night Light with Capacitive Touch Control TinyTouchLight is a dimmable USB night light with capacitive touch control based on the ATtiny13A. It plugs into any USB charger or power bank. - Project Video (YouTube): https://youtu.be/TYuayp2b2vI - Firmware (Github): https://github.com/wagiminator/ATtiny13-TinyTouchLight ![TinyTouchLight_pic3.jpg](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyTouchLight/main/documentation/TinyTouchLight_pic3.jpg) # Capacitive Touch Button ## Introduction This implementation of a touch-sensitive button (touchkey) is based on the charge sharing approach similar to [Atmel's QTouchADC](http://ww1.microchip.com/downloads/en/Appnotes/doc8497.pdf) and [Tim's TinyTouchLib](https://github.com/cpldcpu/TinyTouchLib). It works without external components, only a resistor for noise reduction is used, which can also be dispensed with. The touchkey itself is a small copper area on the PCB (sense electrode), which is covered with solder mask. This sense electrode is connected to a single ADC-capable pin of the ATtiny via the resistor. ## Basic Principle The touch sense pin (here PB4) is connected through series resistor RS to the sensor electrode capacitance, represented by Cx. The switch SW represents a finger touching the key. The capacitance introduced by the finger is represented as Ct. When the key is touched, Ct is switched into the circuit forming a parallel capacitor with Cx, changing the effective sensor capacitance to Cx + Ct. ![TinyTouchLight_principle.png](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyTouchLight/main/documentation/TinyTouchLight_principle.png) It should be noted that Cx and Ct are not physical capacitors. Cx is the effective capacitance of the sense electrode and Cx + Ct is the effective capacitance of the human finger touching the sensor. ## Component Selection The series resistor RS is nominally 1kΩ, but it may be increased to higher values to improve the noise immunity of the circuit. The value of RS should be increased in steps to find the lowest value that provides adequate noise immunity. Resistance values of up to 100kΩ have proven to be useful in extremely noisy environments. For this application a 47kΩ resistor was chosen. The value of Cx should be close to that of the ADC’s internal sample-and-hold capacitor CS/H (~14pF). For best performance it is recommended that Cx+t should not be greater than ~60pF. If the sensor electrode is designed as a copper surface on the PCB, then it should be roughly as large as the contact surface of a finger (8-15 mm in diameter if the touchkey sensor is round, or with a 8-15 mm side if the touchkey sensor is square). There shouldn't be any traces on the other side of the PCB. The back side can have a ground plane, but this should not be a solid fill. ## Sensor Acquisition The acquisition method works by sharing charge between the ADC’s internal sample-and-hold capacitor (CS/H) and the sense electrode capacitance (Cx). When the sensor is touched the effective capacitance of the sensor electrode increases and becomes Cx + Ct. This affects the amount of charge shared between the capacitors. When pre-charging Cx and sharing with CS/H, charge transferred to CS/H increases on touch and ADC input voltage increases. When pre-charging CS/H and sharing with Cx, charge remaining on CS/H decreases on touch and ADC input voltage decreases. But the resulting signal from the averaged ADC values increases on touch. If the difference between signal and reference is greater than the user-determined threshold (delta), a touch is reported. The charge sharing is carried out in the following sequence: 1. Precharge touchkey LOW and S/H cap HIGH. 2. Connect touchkey and S/H cap in parallel. Read the voltage via the ADC. 3. Precharge touchkey HIGH and S/H cap LOW. 4. Connect touchkey and S/H cap in parallel. Read the voltage via the ADC. 5. Calculate the voltage difference and compare it with the user-determined threshold. ### Step 1: Precharge touchkey LOW and S/H cap HIGH. By setting the touch sense pin (PB4) to OUTPUT LOW, the touchkey is discharged. By setting the ADC muxer to a spare pin (here PB3) and setting this pin to OUTPUT HIGH, the internal S/H capacitor is charged. ![TinyTouchLight_step1.png](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyTouchLight/main/documentation/TinyTouchLight_step1.png) ```c ADMUX = TC_SHC_ADC; // connect spare pin to S/H cap PORTB |= (1
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_Manufacturer Part BOM_Supplier BOM_Manufacturer BOM_Supplier Part
1 100n C1 C_0805 1 CC0805KRX7R9BB104 LCSC YAGEO C49678
2 47u C2 C_0805 1 C0805X5R476M100NT LCSC SANYEAR C466799
3 5050 LED1,LED2,LED3,LED4 LED_5050 4 61-238/GBC-YX2Y2M/ET LCSC Everlight Elec C431970
4 AO3400 Q1 SOT-23-3_W 1 AO3400 LCSC KEXIN C382311
5 39R R1,R2,R3,R4 0805 4 0805W8J0390T5E LCSC UniOhm C25311
6 47k R5 0805 1 0805W8F4702T5E LCSC UniOhm C17713
7 1k R6 0805 1 0805W8F1001T5E LCSC UniOhm C17513
8 10k R7 0805 1 0805W8F1002T5E LCSC UniOhm C17414
9 ATtiny13A U1 SOP-8_150MIL 1 ATTINY13A-SSU LCSC MICROCHIP C14075
10 USB PCB USB USB-A-PCB 1 USB-05 LCSC SOFNG C112454

Unfold

Project Attachments
Empty
Project Members
Target complaint
Related Projects
Change a batch
Loading...
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