Glyph of Warding - PHB 245-6
Please note: This requires a very broad ruling by the DM on this spell. The text only requires a 'trigger', but given that it is an abjuration and not divination spell, triggers not in presence of the glyph seem unlikely without DM approval.
Although there is a material cost 200gp of powdered diamond, this spell contains all that you're looking for.
It will enable you to place your device(s) anywhere and set the glyph on them to be triggered upon your death. Caveat Emptor: Once placed, the glyph/object cannot be moved more than 10' from point of casting. You'll need to place your device at it's final location, cast the glyph, and hope no one moves it or the glyph will be broken and the trigger stopped.
When you cast this spell, you inscribe a glyph that harms other creatures, either upon a surface (such as a table or a section of floor or wall) or within an object that can be closed (such as a book, a scroll, or a treasure chest) to conceal the glyph.
If you choose a surface, the glyph can cover an area of the surface no larger than 10 feet in diameter. If you choose an object, that object must remain in its place; if the object is moved more than 10 feet from where you cast this spell, the glyph is broken, and the spell ends without being triggered.
You decide what triggers the glyph when you cast the spell. For glyphs inscribed on a surface, the most typical triggers include touching or standing on the glyph, removing another object covering the glyph, approaching within a certain distance of the glyph, or manipulating the object on which the glyph is inscribed
You'll still need to discuss with your DM if "your death" qualifies as a trigger.
Once triggered, you can choose the standard Explosive Rune, which should be more than enough to unleash that weapon:
When triggered, the glyph erupts with magical energy in a 20-foot-radius sphere centered on the glyph. The sphere spreads around corners. Each creature in the area must make a Dexterity saving throw. A creature takes 5d8 acid, cold, fire, lightning, or thunder damage on a failed saving throw (your choice when you create the glyph), or half as much damage on a successful one.
If it doesn't seem to fit, you can use other spells such as Shatter for a similar effect or really anything else you'd like that fits the requirements.
You can store a prepared spell of 3rd level or lower in the glyph by casting it as part of creating the glyph. The spell must target a single creature or an area. The spell being stored has no immediate effect when cast in this way. When the glyph is triggered, the stored spell is cast. If the spell has a target, it targets the creature that triggered the glyph. If the spell affects an area, the area is centered on that creature. If the spell summons hostile creatures or creates harmful objects or traps, they appear as close as possible to the intruder and attack it. If the spell requires concentration, it lasts until the end of its full duration.
As noted in the beginning, if the item is moved 10' from your point of casting, the glyph will not trigger upon your death. In addition, someone can (if they can find it) dispel the glyph. However, it's not easy to find:
The glyph is nearly invisible and requires a successful Intelligence (Investigation) check against your spell save DC to be found.