Device vs. gadget

Hello, is there any significant difference between device and gadget? To me, device sounds more modern and according to my dictionary, a gadget is a mechanical device. In my opinion, a device usually runs on electricity. Is that right?
Thank you so much,

A gadget and a device are the same thing, but device sounds more refined and formal, while gadget has a slangier sound with a slight tinge of “I don’t know what this is.” Sometimes gadget comes close to German “Dingsbums”.