Then we have been misunderstanding each other. In Reply #6 I asked if the bargraph is driven by the Arduino (meaning an Arduino program) and I understood your Reply #7 to mean that you did have a bargraph program on your Mega.
As Tom says, increase the capacitance. However, at 500Hz you will still have significant ripple. I would recommend that you raise the pwm frequency on Timer 4 (controls pwm on pin 7) from the default value up to 31.4K by changing the prescaler to 1.
Add this line at the end of setup.
TCCR4B = TCCR4B & B11111000 | B00000001; // set timer 4 prescaler to 1 for PWM frequency of 31372.5 Hz