You could try unplugging it and then hold the power on button for 10 seconds or so then plug it back in and see if that fixes it. What that does is drain the Motherboard.
On a laptop you do the same thing, but first take out the battery.
Sounds like you have a bad power supply, or loose connection somewhere.........z