Hello guys,
i´ve been thinking lately about a solution I need to implement.
I have a device that needs to be turned on at a certain moment. At that moment something is pressed and the inclination of another thing can get up to 20º. My idea was to wake up the mcu via interrupt when something was pressed and I think that for most cases it would work.
Now I've realized that in some occasions the "button" method might not be applicable.
I've thought of using a tilt sensor, but it will be activated by inertial forces, so that´s a no go.
The other idea that came by to me was using an mpu6050. But my doubts come across the power consumption when using the accelerometer.
Can it be pushed to sleep mode while using the accelerometer, and use a determined inclination threshold to activate the interrupt? Just like a tilt switch. (would the Z axi accelerometer also be affected by inertial forces?)
After waking up a routine runs, and afterwards everything goes back to sleep. System is battery powered.
COuld you elaborate the problem for which you have the solution?
I need to detect when a horizontal tray changes its angle to about 20 degrees.
The device is outdoors and its battery powered. It won´t be retrieved in a while so power draw has to be as low as possible.
Can the device be waken by the mpu6050? Which is the lowest possible state in which the mpu6050 can sense and trigger the wake up signal to the mcu?
Self calibration can be done? the tray might move a bit over time.
Off the hip thoughts are it would take more than 1.5m/s2 acceleration to “trigger” a 20 degree mechanical tilt sensor.
Are these “trays” getting flung about like frisbees?
Mpu 6050 has a int pin that goes high when the mpu puts data to be read in its buffer.
Technically yes you could use that to wake up, but those sensors are constantly sending data to the buffer so ... I doubt your Arduino is going to get much sleep.
Have you considered using one of the 8 pin attys with ic2? I know they won’t load the full feature library’s for a 6050, but you could easily get the raw data and go from there.
https://playground.arduino.cc/Main/MPU-6050/#short
Edited to add you would need “tinywireM” library instead of wire.h for the attiny85.
They won´t be flung away but they will be moved. My thought was that the slightest movement the buffer would get data and wake up everything. So now it is confirmed..
This wouldn't work this way. There is no threshold that can be set within the mpu features before sending data.