I would like to build a small device that warns me, with sound and or a 'dash' lamp, that my headlight is off if the motorbike is moving. My challenge is it is under warranty, so I cannot in any way modify or attach to existing wiring. The unit must strictly only connect to the bike by something like silicone glue or Velcro.
I first though of an accelerometer in combination with an Arduino or something, but now I've wondering if a simply unit could be made with some kind of pendant switch, as I only need to detect some acceleration, not the magnitude of it.
The unit would be smallish, with a light sensor on one end, and a bright LED array on the front, to provide an iota of emergency visibility if the rider doesn't hear or see the warning for some reason.
The main gist of my question is, once the light detector and alarm is built, how do I enable it only when in motion?
BTW, the main use of this is for when a motorcyclist forgets to switch on his headlight during the day. It's quite easy to notice that it's off at night.