Lee Mulvogue wrote: > Hi, anyone know where (or if) I can get some of those cheap shock > sensors you see in toys, eg. the rubber bouncy balls that light up > when bounced? > > The sensors are a basic switch consisting of essentially a spring > around a central metal pole, when hit hard enough the spring will move > far enough to hit the pole, completing the circuit. > > I was looking into using accelerometers, but I don't know if I can > justify the cost for what I want to do. i only really need two or > three sensing ranges; anyone know if you can tune these spring > contraptions, say have one ultra-sensitive (picking up the item, bring > it out of a sleep state), one mid-sensitivity (moving it with a few > g's), and one low sensitivity (item running into something with a fair > amount of force). A piezo can be used as a fairly low cost shock sensor. A voltage output is produced proportional to the mechanical force (shock) applied. In one project I used the same piezo as both shock sensor and audio output device. It was connected to the micro using an RS485 differential transceiver chip (eg. MAX485,MAX487). To make a tone the transceiver chip was set to transmit direction and driven with a square wave. To detect a shock the transceiver direction was set to receive and the micro was interrupted when the differential voltage accross the piezo exceeded the logic threshold of the receiver (from memory this was approx 200mV). Do not connect the piezo directly to a PIC input without any protection. Voltage and current spikes do need limiting. -- Brent Brown, Electronic Design Solutions 16 English Street, St Andrews, Hamilton 3200, New Zealand Ph: +64 7 849 0069 Fax: +64 7 849 0071 Cell: 027 433 4069 eMail: brent.brown@clear.net.nz -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist