The Mega bot upgraded with accelerometer. He can feel the position now. When he is upside down - the servos stops. The alarm will be added later.
The accelerometer from Sparkfun (the low one)
The accelerometer from Sparkfun (the low one)
The very first test (on one axis)
The final test (on all axes)