Single pin configured as both a cap sensor and as output pin to light a LED

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everybody,

 

First to say that I'm a noob with microcontrollers.

 

I am working with a custom made Qtouch board based on Atmel SAMD21J18B chip. As Atmel START and Qtouch Composer are not properly working on my PC, for my projects I am using an example code where I manually change the number of keys, sliders and adjusting their parameters. As actuators I mainly use LEDs that are being controlled by the touch sensors.

 

For a current project I would want to "integrate" the LEDs into the touch sensors to serve for indication. This will make my circuit pretty complex though so I came up with the idea to use the LEDs themselves as touch sensors. 

 

I would like to ask if it is possible to reconfigure a single pin within the program changing its direction from output (driving a LED) to input (a capacitive sensor) and/or back to output?

The idea is that the LED (or the wire to it) will only be used as a sensor when the LED is turned off (no current is flowing).

 

An example scenario would be:

 

 - pin configuration as output

 - LED turns on

 - in 500ms LED turns back off

 - pin configuration as a capacitive sensor

 - start reading loop until sensor (LED wire) is touched

 - do some processing

 - repeat from beginning

 

2. Where in the automatically generated Qtouch code is the configuration of the pin as a sensor done?

 

Thank you in advance!

 

Regards,

Steliyan

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wonder if this ever worked, I'd have thought it would be necessary to connect the LED between two pins so the LED junction doesn't suppress the touch function when off. I like the idea of having the LED function as a sensor but I suspect that a leaded part would have too much plastic between you and the chip to register.

 

With a SMT part you'd basically be using the PCB traces to the LED as sensor so you might as well just surround the LED with a ring electrode.