Thanks! I know. Things have been pretty hectic for the last few months. I have time to do fewer side projects, and even less time to turn them into youtube videos, but hopefully I'll get back into bi-weekly posting next month some time. I actually tried just that, the "pressure" response wasn't great but the "was it clicked" worked out really well!
AVR = a microcontroller with memory on board for program storage, like an Arduino. The letters may stand for the initials of the 2 Norwegian developers'plus the R from RISC, Reduced Instruction Set Computer, according to Wikipedia.
I didn't realize you watched other people's videos, I figured you were too busy with your own space program or something else equally ridiculous and awesome.
Thank you for posting this and describing how it all works. This is really fantastic. I'm working on a project adding a capacitive button (two actually) and was tremendously frustrated to find that Qtouch is only available through atmel studio (I don't have a Windows computer) This solution is perfect! To clarify (I've looked at the schematic) the only components you need are a conductor under a dielectric and a properly sized resistor? That seems impossibly simple!
If you are not grounded /and/ it is not grounded, it works quite well... Still works slightly better if you're both grounded. IF One is grounded and not the other, it's terrible.
Thanks for video! I've tried that, but it works buggy in case of grounding the AVR, so I can't use it for controlling the LED Strip. So I still use SPST buttons and variable resistors...
I think I am going to post a video about an isolated version I was working on for a while. Next time I do a project with it, I'll include a video about it.
CNLohr do you have better way of making the schematic? I just can't see why that works....do you use just one micro pin? (and where do you make contact with your finger?)... I mean, I understand the principle and I think the explanations from the beginningtoo, but the last circuit .. maybe it's late here.
Thanks! How does the resistors value affect this? Will a larger resistance just make that time of the curve decrease? Most folks are saying use at least a meg or it will be a proximity sensor? Not sure if I’m understanding this relationship. Your vid has been the most helpful
First off, thanks for your excellent tutorial. Can you provide some pointers for me? I was able to get this working like a charm, but ran into problems when expanding it to multiple pins. Since there is only one interrupt for all pins, I have basically run the relevant code twice, one for each pin, while changing the bitmask the interrupt uses to fire on. This only somewhat works. The inputs sometimes appear to bleed over into each other, not turn off all the time, etc. Any ideas as to how you would adapt this technique to utilize multiple pins? Thanks!
I use a macro to write the code for me, this does expand a lot, but in the grand scheme of things it's not that bad. One thing I always do (and seems to help a lot with the bleeding) is to drive all pins low when they're not in use. Idea is: Release pin, count time, drive pin low. Repeat for all pins.
Hey Lohr, POST STUFF ;) - Cool videos, 2nd time I've watched this. Wondering, would this kind of setup be good for something like a midi controller. i.e something like a drum pad where you use your fingers to 'tap' out beats? Would be a cool way to do it, I think.
I'm not sure what the website would be like... I have toyed with trying to make blogs, but I assumed people were like me and would rater watch video than read. And thanks! I guess I'll just take everyone's word on it being fun since I only do it out of some sort of unusual obsession.
HI and thanks for the video. I was wondering if someone can help me with a code for a resistive touch screen. The touch screen that I have is a AMT9502 5.7'' and it shud be able to output the data only when touched via uart
Hello are you still here? I am trying to do the cap touch sensor and I have something that looks like your stuff the top voltage it reaches is 400 mv , when I touch my PCB I see the slope of the voltage going longer. Does your voltage rise all the way to 5Volts? Does your scope probe not load the signal ( I have 1Meg and the scope probe is 10 meg so not a lot of difference). Just so you know I am using a tiny13. Any help you can give would be appreciated.
The systems here are really sensitive so your scope probe will effect it, but it sounds much more like you need a bigger pull-up resistor. Not sure what the impedance of the inputs on the ATTiny are, so maybe that's not suitable? But the voltage should very quickly rise to at least 2-3 volts if being pulled up to 5 v.
Ok so I watched the entire video, and understand what you're doing. It's cool. I think you should revise your commentary and the drawing at seven minutes. It seems to me by what I observed on your video that the resistor and capacitor are in series and the resistor is tied to +5v. The switch (or port pin) is essentially connected across the capacitor to ground. When the switch closes it discharges the cap almost instantaneously. When it opens, the cap charges at the rate you show on your diagram.
Look at the symbols, the ground is on the other side of the switch, the 5V is hooked up to the other side of the capacitor. I guess I should have drawn them more clearly with the + going up and the - going down.
CNLohr The annotations still won't fix it or make it clear. The diagram is simply wrong. The cap's voltage will not curve up like that with your existing drawing. You need the resistor and the cap in series from +5V to GND and the switch needs to be across the cap only. When the switch is closed, the cap will immediately drop to zero volts. When the switch is open, the voltage across the cap will rise as you show it because it's being charged by +5V through the resistor. I wish I could show you.
Because arduino is slow. For some reason lots of people don't care about speed. For me, fast development's linchpin is quick compile and test to fail fast.
Your circuit and comments at 7 min isn't correct. When you open the switch in the "flipped" circuit, you show a slowly rising voltage as the cap charges. You don't have a complete circuit the moment you open the switch, and therefore you have no current. With no current, there is no voltage drop across the resistor (and the cap), so the voltage is the same on both sides of both components. It will be equal to 5 V immediately when you open the switch.
Thanks! I know. Things have been pretty hectic for the last few months. I have time to do fewer side projects, and even less time to turn them into youtube videos, but hopefully I'll get back into bi-weekly posting next month some time. I actually tried just that, the "pressure" response wasn't great but the "was it clicked" worked out really well!
AVR = a microcontroller with memory on board for program storage, like an Arduino. The letters may stand for the initials of the 2 Norwegian developers'plus the R from RISC, Reduced Instruction Set Computer, according to Wikipedia.
I didn't realize you watched other people's videos, I figured you were too busy with your own space program or something else equally ridiculous and awesome.
Thanks - also, any recommendations would be greatly welcome!
Fantasic tutorial! your channel contains all the knowledge I was missing for my next project!
Thank you for posting this and describing how it all works. This is really fantastic. I'm working on a project adding a capacitive button (two actually) and was tremendously frustrated to find that Qtouch is only available through atmel studio (I don't have a Windows computer) This solution is perfect!
To clarify (I've looked at the schematic) the only components you need are a conductor under a dielectric and a properly sized resistor? That seems impossibly simple!
That is indeed all! Yeah, I'm not sure why QTouch is a thing at all.
I will try to get that updated tonight!
Nice one man. I am going to try this.. One issue could be, how it will work, if you are not grounded.. still it is worth giving a shot.
Definitely enjoyed that look into a DIY touch sensor! More like it please!
If you are not grounded /and/ it is not grounded, it works quite well... Still works slightly better if you're both grounded. IF One is grounded and not the other, it's terrible.
Good stuff!
how are you using a terminal window to view outputs?
Eddie Amaya Tinyispterm, check it out on github.
Just what I needed. C++ cap sense for arduino will not compile to avr boards. Pico pie.
C++ cap sense? This is just C. It compiles to anything.
Really excellent work man!
Great video, but the big question you didn't answer: *why* not just use QTouch? What are the benefits of rolling your own code?
Generally portability, and not needing mutual caps in the systems where you normally do. AND you also can use any pins you want for this.
It's updated! Simply re-pull the git tree.
Thanks for video!
I've tried that, but it works buggy in case of grounding the AVR, so I can't use it for controlling the LED Strip.
So I still use SPST buttons and variable resistors...
I think I am going to post a video about an isolated version I was working on for a while. Next time I do a project with it, I'll include a video about it.
CNLohr so, it's been a year? did you made another one? I can't find it. Very good content by the way.
>.< I actually haven't needed to make an isolated version, still. A regular version with grounding has been good enough.
CNLohr do you have better way of making the schematic? I just can't see why that works....do you use just one micro pin? (and where do you make contact with your finger?)... I mean, I understand the principle and I think the explanations from the beginningtoo, but the last circuit .. maybe it's late here.
You don't make contact with your finger. You have a plate and an insulator, so it's just one half of a capacitor. Indeed you only need one micro pin!
Admittedly they don't work quite as well if you're not grounded, but it's not that bad. For these tests I was touching a ground with my foot.
Thanks! How does the resistors value affect this? Will a larger resistance just make that time of the curve decrease? Most folks are saying use at least a meg or it will be a proximity sensor? Not sure if I’m understanding this relationship. Your vid has been the most helpful
First off, thanks for your excellent tutorial. Can you provide some pointers for me? I was able to get this working like a charm, but ran into problems when expanding it to multiple pins. Since there is only one interrupt for all pins, I have basically run the relevant code twice, one for each pin, while changing the bitmask the interrupt uses to fire on. This only somewhat works. The inputs sometimes appear to bleed over into each other, not turn off all the time, etc. Any ideas as to how you would adapt this technique to utilize multiple pins? Thanks!
I use a macro to write the code for me, this does expand a lot, but in the grand scheme of things it's not that bad.
One thing I always do (and seems to help a lot with the bleeding) is to drive all pins low when they're not in use.
Idea is: Release pin, count time, drive pin low. Repeat for all pins.
Hey Lohr, POST STUFF ;) - Cool videos, 2nd time I've watched this. Wondering, would this kind of setup be good for something like a midi controller. i.e something like a drum pad where you use your fingers to 'tap' out beats? Would be a cool way to do it, I think.
Nice! How would you design circuit to sense longer distance and even more hard - through 25mm thick wood?
this method wouldn't work that far :-/ you'd have to use RF or other methods.
I'm not sure what the website would be like... I have toyed with trying to make blogs, but I assumed people were like me and would rater watch video than read. And thanks! I guess I'll just take everyone's word on it being fun since I only do it out of some sort of unusual obsession.
HI and thanks for the video.
I was wondering if someone can help me with a code for a resistive touch screen.
The touch screen that I have is a AMT9502 5.7'' and it shud be able to output the data only when touched via uart
Jove Gyorshevski any luck?
Wow, this tutorial was great! Thank you!
Great video. You should definitely make more of these!
Hello are you still here? I am trying to do the cap touch sensor and I have something that looks like your stuff the top voltage it reaches is 400 mv , when I touch my PCB I see the slope of the voltage going longer. Does your voltage rise all the way to 5Volts? Does your scope probe not load the signal ( I have 1Meg and the scope probe is 10 meg so not a lot of difference). Just so you know I am using a tiny13. Any help you can give would be appreciated.
The systems here are really sensitive so your scope probe will effect it, but it sounds much more like you need a bigger pull-up resistor. Not sure what the impedance of the inputs on the ATTiny are, so maybe that's not suitable? But the voltage should very quickly rise to at least 2-3 volts if being pulled up to 5 v.
Ok so I watched the entire video, and understand what you're doing. It's cool. I think you should revise your commentary and the drawing at seven minutes. It seems to me by what I observed on your video that the resistor and capacitor are in series and the resistor is tied to +5v. The switch (or port pin) is essentially connected across the capacitor to ground. When the switch closes it discharges the cap almost instantaneously. When it opens, the cap charges at the rate you show on your diagram.
Look at the symbols, the ground is on the other side of the switch, the 5V is hooked up to the other side of the capacitor. I guess I should have drawn them more clearly with the + going up and the - going down.
Actually!! You are sort of right! I will have to update my annotations a little better.
CNLohr The annotations still won't fix it or make it clear. The diagram is simply wrong. The cap's voltage will not curve up like that with your existing drawing. You need the resistor and the cap in series from +5V to GND and the switch needs to be across the cap only. When the switch is closed, the cap will immediately drop to zero volts. When the switch is open, the voltage across the cap will rise as you show it because it's being charged by +5V through the resistor. I wish I could show you.
Tony kara
I ran a spice simulation. I took a picture of it. You can see the link in the description.
Awesome that you use a schematic software for drawing:D
holy shit, how does that compile so fast, and why is arduino so damn slow....
Because arduino is slow. For some reason lots of people don't care about speed. For me, fast development's linchpin is quick compile and test to fail fast.
Agreed. I'm amazed by how fast your projects are in comparison with almost anything else. Great video.
Your circuit and comments at 7 min isn't correct. When you open the switch in the "flipped" circuit, you show a slowly rising voltage as the cap charges. You don't have a complete circuit the moment you open the switch, and therefore you have no current. With no current, there is no voltage drop across the resistor (and the cap), so the voltage is the same on both sides of both components. It will be equal to 5 V immediately when you open the switch.
3:24
Dun Dun Dunnnn!!.... :0
xD
Thanks - also, any recommendations would be greatly welcome!