I would say there may be one of these two problems.
First Faulty RAM (As you mentioned it is a second hand RAM)
I would recommend you to use New RAMS.
Second there may be a short circuit on your Motherboard.
I would say its better if you let the BIOS stay in default and just reinstall the windows again.
It should be OS problem. I once had the same problem. Clean installation of windows removed that problem.