What hardware do I need for selling the electricity generated by solar panels to the electric company?
You need an on-grid or grid-tie inverter, and you can buy them far cheaper than you can possibly build them. In any case the power company and electricity regulator won't let you implement the circuits yourself unless you're prepared to spend thousands on certification tests, including requirements to, for example, shutdown within a millisecond of mains loss.