Dashboard lights and music system wnet off while driving


I faced a weird problem today. While driving suddenly the dashboard light and the music system went off and then within a second came up back again. The speedometer, tachometers, oil gauge, all came down and came up in this time frame. During this period the car engine kept running and there was no apparent loss of power. This happened at least 3-4 times within a short span.

Can anybody tell me what might be wrong? For information, my car battery is going down and couple of days back the mechanic recommended it to be replaced soon.