11 Input Devices
This week's assignment is to probe an input device(s)'s analog levels and digital signals and measure something: add a sensor to a microcontroller board that you have designed and read it.
Group assignment: Input Devices
The documentation for our group assignment from the Barcelona node can be found here.
Lessons Learned
Capacitive Touch for my Stacking Lamp
ATTiny1614 attempt
This week I really wanted to try out capacitive touch as a "cool" on/off switch for my final project, a lamp. Initially I wanted to use my board from Electronic Design Week with an ATTiny1614 microcontroller, because it power the Neopixel strip at 5V.
Turns out the ATTiny1614 has the capability of Peripheral Touch Controller (PTC) on PO4, PO5, PO6, PO7, which is explained in section 32 of the datasheet. But when I asked to our instructors they were not sure if it was possible to program it using Arduino IDE.
On their recommendation I swapped to designing a new board, which we were sure that it would work. Finally
SAMD21
So I swapped to a SAMD21, which initially was a big jump for me being a complete electronics newbie, but thanks to
Understanding Capacitive Touch
Since I had already checked the PTC capacity for ATTiny1614 I knew what I was looking for in the datasheet. SAMD21 has the capability of self-capacitive mode, which only requires a Y-line, on pins PO4, PO5, PO6, PO7.
As stated in the datasheet "the external capacitive touch sensor is typically formed on a PCB", which means I had to create a circle and declare it as a Filled Shape
and choose the Net
I wanted to connect, which means the respective pin.
Considerations for the board
The SAMD21 comes with different power supplies: VDDCORE for the internal power supply of the microcontroller and VDD to supply the board. Since I was still following my initial plan of powering the Neopixel strip, I added a direct lane from the usb connection to a 3-pin header.
A lesson shared by
Another hint from everyone in the lab that had used the SAMD21 was to increase the size of the footprints, which can be edited with Control + E
in KiCad.
Once I had finished the work in KiCad, I followed the same procedure as described in electronic production week:
- export selected as SVG
- edit in Inkscape
- create rlm file with modsproject.org
- mill the board
- solder components
- burn bootloader with Quentorres
- try blink program - works! :)