Making Almost Anything <-> MAS.863 <-> Fall 2011

Kristopher Dos Santos <-> Personal Robots Group

Week 10 <-> The PWM-Drivng Proximity Sensor

For this week, I chose to use capacitive sensing values to drive PWM control for LED output. This is similar for what I did to input devices, but now uses the PWM function of the ATTiny45 to drive an LED for proximity sensing.

PotSerial Board

As with last week's code, I established an "ambient" value-finding code sequence in the process. Then, every other value that came was subtracted from the ambient value, and that difference was set to the PWM limiter value, OCR0A. From serial tests, I noticed that the range of difference values was very small, and would only reach a top level of 150 or so. So setting OCR0A to this difference value was reasonable. Then, once the difference spiked past a certain point, I activated a flash method that would flash the PWM between MAX and MIN. This would also activate if there was sensed contact. Below is a video demonstrating the device in action. Enjoy!

(P.S. As you may notice, there is a lot of residual flicker. Cap values (at least like this) are not really suitable for this kind of thing, as I learned. There needs to be something more stable.)

Back to home