Capacitive Sensing Continued

Hello readers from MAKE: as well as all other readers 🙂

My prototype touch sensor worked so well, that it hasn’t needed much changing. I sent the design off to Custom PCB, and less than a week later, I had a pile of circuit boards waiting for me.

I changed the layout around a little, mostly adding a 2×8 header for accepting a ribbon cable style connection. The header combines power, ground and outputs into a single connection, making it easier to connect to the main board of my larger project (sprinkler controller). Each touch output is paired with a ground wire, which I suppose makes it more resistant to interference. The caps I used this time are polyester film 220 nF, doubling the amount of capacitance compared to what was used on the prototype.

Yes, the ugly piece of plexi is still ugly. Don’t worry, it will be hidden from view. In the final configuration, this board and its plexiglas spacer will be inside a plastic project box. I’ll have a laminated “keypad” overlay affixed to the outside of the box so I can see where the buttons are. The spacer will be flipped around, going on the solder side, giving me enough clearance to flush-mount the sensor with the wall of the box. Flush mount is very important, as even the slightest air-gap will ruin the proximity sensing effect.

Nothing much to see solder side… a few smt passives set options on the chip, as well as decouple and filter the incoming power. The big resistor limits current for the meager power led which no one will ever see once the board is in use.

I’m very close to finishing the larger irrigation control project, hopefully sometime this week! Thanks for reading!

Capacitive touch sensing

Presenting “6buttons”; a simple six button keypad based on the QProx QT160 charge transfer proximity sensor chip.

More details to come later, wanted to get some pictures and video online tonight.

simple schematic – i plan a “backpack” pcb which will provide some visual feedback, a clicking noise and translate the six outputs into an i2c bus device.

the brains of the operation, this chip does all the work. special mylar capacitors are required for it to work properly. i tried cheap-o ceramics with terrible results. the orange thing is a 10mhz resonator.

the “buttons” are printed out on plain paper, using the silkscreen layer from my pcb layout program. the capacitive dielectric is provided by the FR4 pcb material, the paper and a 1/8th inch thick layer of plexiglas; I guess you call that a multilayer capacitor!

the sensors are simple copper rings, which radiate the electrostatic field this chip uses to sense proximity. a ground plane pour around the IC helps to minimize cross-talk between sensor channels and prevent stray fields from detecting proximity around the chip itself. the capacitors near the chip also sense proximity and will need to be shielded with aluminum foil or something.

forgive the craptastic music in the video!

edit: also read Capacitive Sensing Continued

LED Clock; Firmware taking shape

The firmware for my LED Sign / Clock project is taking shape.  I’ve worked out my initial wishlist of features, and put together a basic menu structure.  I figured a menu is the  easiest way to access a lot of options, while only relying on two buttons.

The basic menu consists of options for setting the time and date; minute, hour, day, date, month, year.   The basic options are pretty self explanatory.  I have also planned some more advanced options:

1. Adjustable display brightness – Varying the duty cycle and refresh rate of the matrix can effect its brightness.  I need to make a simple scale for these variances to allow for two or three brightness levels.

2. Adjustable scrolling speed – The program draws the same information several hundred times per ‘scroll’, changing this counter affects how fast the display appears to scroll.

3. Selectable time format – User can choose between 12 hour AM/PM time and 24 hours ‘Military’ formats

4. Message Mode – User can enable / disable scrolling messages as well as display a single message, a random message or messages in sequence.

Other than that, the code is still pretty basic.  I’ve completed a bunch of internal fixes, like the scrolling code now handles messages of variable lengths. up to sixteen characters.  I’ve also created i2c eeprom reading routines to extract menu prompts and other text strings I’ve stored in the eeprom to save flash space on the chip.

RS232 Utilitarian Project

If necessity is the mother of invention, being cheap must be like a step-father or uncle or something?

I needed some level shifters / line drivers that I could easily use on the breadboard for microcontroller projects. Rather than give some other entrepreneur $10 for their version, I made my own.

MAX232 rs232 line driver level shifter

Nothing particularly special here, aside from the cool factor added by the two LEDs which light on RX/TX events. The chip is a standard MAX232 clone, and I’ve got five 1uF ceramic caps mounted on the back side. The leds are driven by some SOT-23 transistors. To make things simple, I stuck the pin header through the board the “wrong way” and forced the pins almost all the way through their plastic spacer / retainer. This way the unit plugs right into the breadboard, and lays there real nice, even with a heavy serial cable attached.

MAX232 rs232 line driver level shifter

So far so good, it works well with my bootloader at 115kbps, so I figure that’s good enough!

EDIT: Eagle SCH and BRD files available here (7-zip format).

Touch Sensing Building Blocks I

The “core” building-block I mentioned in my last post is nearing completion, at least, the software.

I have my microcontroller handling “switch emulation” tasks. It can emulate either group of momentary switches or a group of toggle switches. Response time is real good in a dimly lit room, and it works decently well even with the overhead fluorescents turned on.

Right now I’m working on a basic keypad PCB I can throw together, for a ‘proof of concept’ prototype. The first keypads will likely only support 6 keys, and I’ll build from there. Six keys requires twelve LEDs, six of them need direct and discrete anode and cathode connection to the microcontroller. The other six LEDs are providing bias light for the sensors to “see”.

I should have a video up tomorrow of the breadboard in action, and hopefully some pcb’s by next weekend.

LEDs As Sensors: Revisted

Thanks to the folks at Make: and Hack A Day, my research into the area of using LEDs as sensors has been receiving a lot of attention. With this attention comes questions. I like receiving questions. Only thing I don’t like about answering questions in the e-mail is the knowledge is locked up. Sure I could repost the e-mails, but it is sometimes difficult to follow the context after the thought train has left the station. With my rekindled interest, I wanted to take a short moment and summarize a few things.

These are just my opinions – and I welcome debate and feedback on them – I especially welcome anyone to be challenged by them enough to prove me wrong. LEDs as Sensors offer at least two avenues of usefulness; communications and interface. I haven’t dipped even a toe into the communications side of the pool – all my work has been on interface.

These are the applications I feel LED Sensors are a poor fit to replace:
#1 – The touchpad on your notebook. Seriously, no one but a geek would enjoy having 128 or more bright LEDs glowing continuously to replace the little capacitive discharge pad that is used 95% of the time today.

#2 – The keys on your keyboard. LED sensors are pretty slow, even a modest typist would be hindered by the response time.

#3 – Any application that needs to work outdoors. LEDs and the Sun do not get along.

These are the application I feel LED Sensors may work well in:
#1 – Keypads and interactive displays used for Art and Music. These applications fit the ostentatious nature of the interface, where the controls are as much a work of art as a functional device.

Yep, that is it… that is the only application I think LED Sensors offer any strength in.
Here is an example – Musician / DJ sound effects tablet:

Imagine a thin tablet like device, glowing brightly with powerful LEDs in an otherwise darkened club / dance hall / etc. The tablet accepts an ordinary 8×11 sheet of transparency film. Printed on the film are the names of pre-programmed effects / samples /whatever. Under the film, evenly spaced trios of LEDs are used to detect the presence of a reflective object. The tablet connects into the rest of your system using regular MIDI or whatever other interface one can think of. This tablet is no different than boxes hobbyists and musicians have been building or buying for years, except, the mechanical switches have been replaced with eye catching LEDs.

Here are a few other questions that have been raised:

Q: Do I have to use red LEDs?
A: No, technically any LED color works. Red is the cheapest and that is what I use. Along with yellow, red is almost the most sensitive.

Q: I tried IR LEDs and they seem very sensitive, why not use those?
A: The point of using LEDs as Sensors is to have an ostentatious interface. It’s not going to be very showy if the light is invisible. If you want to use infrared LEDs, use one emitter and one photodiode / phototransistor – it is a LOT easier.

Q: Does this work with organic / flexible LED displays?
A: I have no idea. Those displays are largely theoretical and prototypical in nature – maybe in five years when I can buy one for a few dollars, I’ll experiment with it. The organic compounds used to manufacturer these displays also have big problems with humidity and overall short lifespan – neither are very positive traits.

Q: Can you send me your ASM code for such and such?
A: No, no I can’t. I do not have any ASM code – I do not know how to program in assembler. I have code written in Proton Basic, which I will happily share.

Q: I want to get started with microcontrollers?!
A: Excellent – I’m not going to help you. There is a huge learning curve involved – a lot of it can be skipped by spending money (on proton basic). Check out and for good microcontroller stuff. Check out for tons of info on learning microcontrollers.

Q: What microcontroller do you recommend?
A: I like the new PIC16F690 family from Microchip. It is a small inexpensive package that offers many features only found on larger processors (like dedicated i2c hardware). It also sports at least 10 ADC ports.


In closing, I would also like to share some basic info on what I’m working on at the moment. My current project is to get a stand alone system worked out for emulating mechanical switches. I consider this a valuable “core” building block behind the technology. I have momentary switches partly working, after that, a toggle switch shouldn’t be much harder. As a future goal, I would like to get “cores” built to emulate sliders and knobs. Those three elements should cover a great deal of the artistic / musical needs that I feel this technology is well suited for.

Thank you for visiting and I welcome your comments. My gmail is gordonthree – feel free to contact me about anything.

Matrices as Sensors

This idea was shared with me on the electro-tech-online forums, and I made up some graphics to help myself and others understand it.

step one
The first step involves choosing your illuminator LED – this diode will provide light for nearby sensors to ‘see’.

step two
The second step is to reverse bias a nearby LED, preparing it to be the sensor. A diode in an adjacent row and column must be selected, to avoid electrical interference from the illuminator.

step three
The third step is reading the voltage present on the cathode terminal of the diode, which indicates the light level the sensor detected.

step four
The controller can then choose another nearby diode to use as a sensor, or move on to another pixel in the array, repeating the entire process.

Long Time, No See

Sorry I’ve been neglecting my blog!

I’ve been doing a lot of reading and research, as well as playing with a new toy.

Here are the top-5 items in my current project queue, sorted by priority:

1) LED backlit Rooster Project – Christmas Gift
2) High-End LED under cabinet lights – Christmas Gift
3) Rainbow LED chaser – New Toy / Fun Project
4) LEDs as Sensors – Interface Project
5) LED Matrix Display – 8×8 display modules

I’ll write more about the rainbow chaser tonight (I promise!)… The backlit rooster is just a cheezy Christmas gift I hope to do up cheap for someone who likes roosters and chickens in their kitchen decor. The high-end under cabinet lights are based on Nichia Jupiter LEDs – this project is currently in the very early design stages. I hope to get a proof of concept prototype built by xmas. LED as Sensors is sort-of stuck – I became obsessed with trying to build a large sensor array, but decided today, I don’t need a large sensor array… so I’ll regroup and start a fresh with actual application development for the sensors as I have them now, and worry about building them larger down the road. The LED matrix display will probably never get built, I just had some fun drawing up the designs… Once I priced out the cost to build them, my interest diminished (64 super flux LEDs for each module, 10-16 modules for a good sized display!).

I might be close…

Wow, a long time with no posts – sorry about that!

I have been busy the past week, I wanted to take Thursday and Friday off, so I had to cram a weeks worth of work into the first three days.

I’ve also been racking my brain, trying to figure out how I can integrate a matrix wired LED array into my sensor project. I think I’ve come up with a solution, partly hardware, partly software. Originally I had wanted to have all the LEDs on, and turn them off to do a measurement. This created a lot of problems, mostly due to the current demands. Well, I think I can achieve the same goals, without having all the LEDs lit simultaneously, which will reduce the current demands and should simply the circuit a little.

led matrix sensor array 74hc595

There is the PCB layout for my latest design… I think I’ll make one to test out, and if it doesn’t work for my sensor array, I can use it as a mini marquee. Sixteen vertical columns, anode connected, each driven by a 74HC595 serial shift register. Seven horizontal rows, cathode connected, each driven directly by the PIC’s analog input / digital output pins. To keep current demands low, I will only illuminate one column at a time. I think that still exceeds the design recommendations of the 595, but heck, its all I can think of at the moment.

LED Array Schematics

My current ‘test’ setup with a 3×3 led matrix

prototype driver for the cathode rows … will never see the breadboard however, since it won’t pass-through an input signal to the PIC.

prototype driver for the anode columns… I’ll breadboard this out soon as I get some p-chan fets in.