No way you'd just swallow some large machine/electronic parts. Just think about the fact that it needs to get out again somehow. Have fun digesting that thing (and don't forget it needs a power source too). We'd need a whole lot of inventions and new materials before something like this could exist.
If anything I could imagine a permanent implant (like a pacemaker, but in your brain) or nanobots.
I think that could be pretty useful. Maybe you can control it with a mini monitor, and load software to it that will tell it to administer certain kinds of mind altering experiences on command, via stimulating different areas of the brain or something.