Knock/vibration detection in a low power, energy harvesting project - Page 1
Forum section: electronics / projects

author: cowana
author_rank: Frequent Contributor
timestamp: April 16, 2015, 07:31:01 pm
content: I'm working on a new project - a bunch of tiny SMD LEDs suspended in a glass jar, pulsing and giving the illusion of fireflies flying around.Stock picture from the net showing the kind of thing I'm planning on:Several people online have made this sort of thing - but they usually have static LEDs and are battery powered, only running for a few days. I'm planning to make this one solar powered, with a tiny cell inside the jar collecting energy during daylight hours.The power schemePower comes from a solar cell. It will be a very small panel, mounted out of sight and certainly not in direct sunlight. Having not selected a panel yet, I don't know how much power it will generate, but I would imagine single digit milliwatts seem likely during the day.An energy harvesting DC-DC converter (with MPP tracking and 250mV startup) will charge up the energy storage capacitor. I want to use a capacitor rather than a battery as they can cope with many more cycles, and have no issue with being run completely flat. Probably a 3F supercapacitor charged to 3.6v peak.A second DC-DC converter will convert the capacitor's voltage to 3.3v for the electronics. Using a DC-DC converter running down to 250mV input ensures almost all the stored energy can be used.The microcontroller being used is a low power STM32L0, rated at 440nA sleep and 87?A/MHz operation. It will control the LEDs through a PWM controller, and the average current draw when pulsing the LEDs will probably be <2mA or so.Block diagram of power scheme:Back of the envelope mathsCharging a 3F capacitor to 3.6v at 2mW takes 3 hours minutes (assuming 80% efficiency)Running down from 3.6v to 250mV, the capacitor can power 3.3v @1mA for 100 minutesBehaviourIn general, the processor will keep all the LEDs off during the day, then once it is dark it will turn them on and run patterns. For this, it needs to know the current light levels - it seems that the easiest way to sense this is just to measure the voltage coming off the solar panel. The voltage coming off the solar panel is unlikely to be over 3.3v, but I'll clamp it with a series resistor and zener diode just in case.The system should react to user input - when the jar is tapped or vibration is sensed, the pattern should speed up and become more complex, with more of the LEDs used. I've had a few thoughts on how to do this - but trying to minimise power consumption of external components, and hoping to ensure the processor can remain alseep most of the time (ie only sample the sensor a few times a second) means I'm not sure on the best way to do it!Ideas for knock detection:Analog output MEMS accelerometer driving a peak detector (diode and capacitor). Would certainly work, and be very simple, although probably too high power for this project. Eg LIS332AX draws 300uA in operation - which is 30% of my power budget...Digital MEMS accelerometers are much lower power - however would need continually sampling meaning the processor couldn't stay in sleep mode (= higher power).Electret microphone, and an opamp driving a peak detector (sampled by the ADC). Would probably work well and only need sampling at a low rate - however the opamp would probably use a fair bit of power, and I don't know how sensitive an electret microphone would be to a sudden impulse? Probably too many false triggers due to sound in the room.Piezo transducer connected to the ADC, with a high value (>1M) resistor in parallel to discharge it. Certainly very low power, although physically larger as SMD piezo elements seem rare. Possibly more sensitive to the device being tapped and less to sound, although not sure!I'd appreciate any thoughts from the community on any aspects of the design, particularity the method of sensing knocks.Cheers,Andy

author: Mr.B
author_rank: Unknown
timestamp: April 16, 2015, 07:58:22 pm
content: There are a number of Digital MEMS accelerometers that have an interrupt output.You can still sleep your micro and have the accelerometer wake it up.I was looking at such an accelerometer only a couple of months ago.I will try to find the datasheet.

author: Mr.B
author_rank: Unknown
timestamp: April 16, 2015, 08:03:33 pm
content: Freescale MMA8452QDatasheet below...

author: max_torque
author_rank: Super Contributor
timestamp: April 16, 2015, 08:07:30 pm
content: Won't the power consumption of the LEDs dwarf that of the processor? (it's not like you need to be running some super fast power hungry processor after all to just flash a few leds)

author: zapta
author_rank: Super Contributor
timestamp: April 16, 2015, 08:12:57 pm
content: How about some springy switch that makes contact when moved? This will consume zero power when in rest.

author: PeterFW
author_rank: Frequent Contributor
timestamp: April 16, 2015, 08:39:35 pm
content: Quote from: cowana on April 16, 2015, 07:31:01 pmWorks, even smaller piezo buzzer elements will put out more then 3V when glued to the top of a mason jar screw top when you tap on in.One side connected to ground, the other though a low value series resistor directly a external interrupt pin and a high value pull down from the pin to gnd.Pin set up for a risin edge interrupt and the processor will wake up when you tap on the jar.

author: cowana
author_rank: Frequent Contributor
timestamp: April 16, 2015, 08:47:01 pm
content: Quote from: Mr.B on April 16, 2015, 07:58:22 pmThat MMA8452 looks absolutly ideal for my needs. From the datasheet, an interrupt can be configured by transients:Functionssuch as tap, flick, shake and step counting are based on the analysis of the change in the acceleration.Plus it's really cheap, nice and small, and draws <10uA. Thanks for pointing that chip out, looks like a great solution!Quote from: zapta on April 16, 2015, 08:12:57 pmThe issue with that is the sensitivity - it would be nice if the LEDs react when the the table is knocked on. Making a mechanical switch that sensitive (but not enough to go off all the time) would be a pretty complex task.Quote from: max_torque on April 16, 2015, 08:07:30 pmThe constant current LED driver runs each LED at 1.5mA. There will only ever be one on at a time, and they will be PWMed (likely always below 50% duty) - meaning the average LED power should be <1mA at all times. Flat out, the processor draws 2.7mA (although I doubt I'll use it at the full 32MHz), so the two numbers are certainly in the same order of magnitude.I do agree with your processor comment though - a 32 bit Cortex M0+ is certainly overkill for this! I'm mainly doing this project to boost my knowledge and experience (especially with boost converters and the STM series of MCUs)

author: wemme
author_rank: Regular Contributor
timestamp: April 16, 2015, 09:32:49 pm
content: Sorry if this has already be covered but whats wrong with a spring vibration switch/sensor?http://s4.electrodragon.com/wp-content/uploads/2012/02/sw18020.pngRegardsBart