Pulse circuit?

I need to make the circuit that every time it charges the capacitor to a certain voltage (e.g. 5v or 12v) it discharges it

Why not use some comparators and a set-reset flip-flop? The following link describes how this is done:

Now I'm not suggesting you actually use a 555 timer IC, unless you actually want your high and low voltage thresholds at 2/3 Vcc and 1/3 Vcc , respectively.

Your question said "a certain voltage (e.g. 5V or 12V)", which says to me that you want to pick the high level (at which the capacitor is discharged), an the low level (at which the discharge path is opened, turned off) allowing the capacitor to charge again.

Anyway, look over the link  to the 555 tutorial.  Think of it as sort of a koan, to get your mind thinking about how relaxation oscillators work, even if for your application you need something slightly different. 
Dantex (author)  Jack A Lopez6 years ago
i think solarbots have circuit i seek but i can't find the circuit
Maybe the phrase you are looking for is "solar engine"? For example: https://www.instructables.com/id/Intro_To_BEAM_Robotics_And_The_Solar_Engine/

Step 2 of the 'ible linked above includes a circuit diagram.  Specifically this circuit is for driving a small motor. 

There are other "BEAM", or "solar engine" circuits for driving other things.  I think the ones that drive lights are called "pummers". Hope this helps.