It does vary by location. Sometimes you can sell your extra power back to the grid and get a negative bill if the conditions allow it. Whether you can do this, and what the rate would be, varies. It is very common to keep your electrical grid connection regardless, but some months you will have no bill, some months you’ll have a refund, and some months (eg: winter) you’ll still pay, just not as much as before. The weather varies, and an overcast day is going to be pretty bad for solar panels, and so on. Keeping the power grid connection has a lot of value.
In terms of the original installation, it’s usually an upfront cost to be paid once, maybe on a loan, and maybe with some government incentive programs you can take advantage of. Again, it varies. But initial installation is often in excess of $10,000. But once it’s done, it’s pretty minimal maintenance. Keeping the panels clean is important but you could do that yourself.
But it’s not just the panels. Panels produce DC power. Your home runs on AC power, so an inverter to convert is required, at an absolute minimum. Since solar does nothing at night and has highly variable power production during the day, some form of battery is fairly common as well. This lets you minimize your power needs from the grid at night and deal with the variable power production. That also adds costs, but you can see the advantages.
It’s rare that solar will get you completely independent of the power grid. It can be done, but having the grid as a backup option is just too good to pass up for most people.
Latest Answers