Here is my old schematic for reference. I have an LED and room for a tactile button and a capacitive sensor.
I run this to upload my code
python3 pyupdi.py -d tiny412 -c /dev/tty.usbserial-AR0K4XLQ -b 57600 -f ~/Documents/Arduino/build/HTMAtest.ino.hex -v
You can run the following to look at all your ports
> ls /dev
I run this to talk to my Arduino over UPDI
python3 -m serial.tools.miniterm /dev/tty.usbserial-AR0K4XLQ 115200
For the ATTINY 412 pinout see the picture below and the link for that info is here.
I ran into memory issues. The problem here again is the libraries have a lot of overhead. To get around this I took out extraneous functions and commands. I think the next step for me is moving to the ESP32 which has better memory and can connect to wifi. Which is pretty sweeeeeet.
So I did get the attiny to turn on and off for me using the capacitive sensing with threshold values as you can see below! But then I messed up something with the circuit or the values and wasn't able to get it to work again.
I tried debugging to get it to work again, but I am blaming it mostly on the fact that the capacitive sensing library I was using may not be that compatible with the ATTINY and I probably messed some small thing up
Anyways I wanted to keep experimenting so I moved on to using an Arduino Uno I had with me.
Here's a video of the data outputting for the analog sensor. It's still not as precise or as sensitive as I would've liked, but definitely usable.
I then started playing around with different resistor values using Arduino Uno found out experimentally that is indeed true that higher resistances increase the sensitivity of the sensor. I used 470k ohm resistor and then double, tripled and quadrupled that value.
I also tried extending the wire connecting the capacitive plate to the sensor pin and this didn't have much of an effect, which gave me hope for starting with one initial microcontroller that is wired up to mutiple capacitive sensors up to 10 feet away.
Also I realized a square of aluminum foil is the most effective thing I have at my disposal to use as the capacitive plate.
Finally I was unsatisfied with this week, because I wasn't able to get the capacitive sensor to work as well as I wanted on the attiny and it stopped working.
So I revisited capactive sensing using the ESP32 in WEEK 11 using the built-in esp32 touchread function and outputting the data to a dynamically updating website. Check out WEEK 11 for better results on the topic of capcitive sensing!!!!!!