During the reno of my basement, I heard a loud buzzing coming from a bedroom and I suspected it was the doorbell transformer. Since they are typically mounted to an electrical box for AC power, I disassembled the ceiling light and found two wires coming from a knockout on the top of the ceiling box. I disconnected the wires and the buzzing stopped but my front door bell was also dead. I determined I would have to cut out the drywall to repair or replace the transformer and since I planned on painting the ceiling, there wasn’t a reason not to fix it. Cutting a hole large enough to access, I took a pic with my cell phone to determine how the transformer was mounted. A screw was expanding a collar connecting the bottom of the transformer to the ceiling box. Once I had the transformer out, I could see the problem. It looked like when it was originally installed, it was missing a rivet at the top holding the plates together. The installer just put a nail into the hole and bent it to hold it together. I headed to Home Depot to buy a bulk nut and bolt for around $1, fixed the transformer, reinstalled it, and patched the ceiling.