The Raw Brain Feed

  • Solar Hardware

    As a follow on to the previous post, this time will cover the hardware and requirements involved in a residential solar system, from panels and inverters, to batteries and wiring.

    The Big Picture

    The overall goal of any photovoltaic solar system is to turn the radiation from the sun into usable electricity. For the purposes of this we will be subscribing to the particle portion of the wave-particle duality. To begin, an incident photon arrives at our solar panel, constructed of individual photodiodes. The photon is absorbed by a photodiode and creates a current through the photoelectric effect. This current is combined with the many other photodiodes on the panel to the output terminals. Individual solar panels are constructed where they are most efficient, and thus produce the most power, at a particular voltage. As a result, in all but the most minimal of cases a Maximum Power Point Tracker (MPPT) is used. This creates a variable load that is matched to the solar panel outputs, ensuring it operates at the ideal voltage for power production. Next, the current must be converted from direct current (DC) to the common residential alternating current (AC). This is a task for the mighty inverter, which takes the DC current from the MPPT output ranging from tens to hundreds of volts and produces a steady 120V (or even 240V) 60Hz output that can be connected to the residence and grid. Any system with batteries will also need some kind of battery management system (BMS), for older, lead acid type batteries this could be handled by the inverter, but modern multi cell Lithium type batteries require per cell load management to ensure the health and longevity of the battery. Typical items to monitor are cell voltages and temperatures, as well as the current flow to and from individual cells. A BMS also typically reports back State of Charge (SoC) and State of Health (SoH) of the battery back as a whole. Finally, there are numerous methods of wiring these different components together, but most residential applications are subject to some form of the National Electric Code. The Code provides requirements for approved wiring types, safety measures, and all other matter of electrical requirements. Not only does it provide general wiring requirements for houses, but the newest versions have dedicated sections for Energy Storage Systems (ESS) and Photovoltaic (PV) Systems.

    Solar Panels

    Solar panels are made of solar modules, which are composed individual solar cells that operate with the photovoltaic effect. In the solar cell, a photon strikes the semiconductor material and is absorbed, exciting the electrons in the material to a higher energy state where the electron can move freely in the material. Because the semiconductor material is arranged in such a way to form p-n junctions, current is only allowed to flow in one direction through the cell. Each individual cell in this fashion can only create about 0.5 Volts of potential, so many cells are wired in series to increase the voltage. The exact voltage output is dependent on the individual modules, but most residential and many commercial panels have open circuit voltages, Voc, of less than 600 Volts to remain in the Low Voltage classification of ANSI, as well as the much higher availability of supporting equipment rated to the same levels. In order to increase power more, each collection of series cells can also be put into parallel to provide additional current. Most modern panels also include bypass diodes, which allow current to bypass shaded cells that are not producing power so that the panel can still produce power at a reduced level. Finally, entire panels can also be wired in parallel or series to suit the capabilities of the MPPT and inverter used to capture power from the system, but as in the case with most power generation higher voltages at lower currents results in less loss.

    A band diagram for a typical PV solar cell1

    MPPT

    Maximum Power Point Tracking (MPPT) are a critical component of not only photovoltaic systems, but also hydroelectric and wind turbine systems. The core concept is that all of these systems have a nonlinear power-voltage curve, so the output voltage of the generator is controlled via a variable load to stay at the maximal point. A very simple algorithm is the perturb and observe method, where the power output is measured after changing the output voltage. This allows for a hill climbing to the maximum by slowly adjusting the output voltage until the power no longer increases.

    A sample Power Voltage curve showing the power maximum2

    Inverters

    At the core, modern solid state inverters use MOSFETs to rapidly switch the direction of the DC current flow through a coil, generating an AC current and electric field that can be transformed to a different voltage by the induction of current into a different nearby coil. The quality of the transformation to AC is typically measured via the Total Harmonic Distortion (THD) of the generated signal.

    Equation for Total Harmonic Distortion3

    The square root of the sum of the squared voltages of the individual components of the voltage signal is divided by fundamental. Thus, a perfect sine wave will have a THD of 0%, while an ideal delta would have a THD of ∞%. A standard square wave can be easily generated through a H-Bridge MOSFTET configuration but is not without its limitations.4 As known from Fourier decomposition, a square wave is made of an infinite number of decreasing amplitude odd number harmonics, as shown below.

    Square wave with fundamental sine wave component, 3rd harmonic and 5th harmonic5

    This results in a very distorted signal, which through some clever math can be calculated:

    A far cry from the sometimes 3% or less sensitive electronics need. Thankfully, we can play some clever tricks, like a modified sine wave that has multiple discreet steps instead of the binary square wave, as shown below. This smooths out the transitions and results in the higher order components being attenuated, reducing the THD. For the most discerning of applications, significant power filtering is done to attenuate all but the fundamental component.

    Square Wave, Modified Wave, and Pure Sine Wave6

    Batteries

    There are several reasons why adding a battery to a solar system makes sense. A fully off grid system with no outside connection needs a power source overnight or during inclement weather when solar yield is low or insufficient if there are no other local power sources available. An unreliable grid or critical infrastructure could benefit for the same reasons. Local utility companies that do not allow net metering or excess production to be sold back to the grid or at a disadvantageous rate provide good reasoning for storing excess power locally as well.

    The history of rechargeable batteries is a long one, with the first being a lead-acid type invented in 1859 by Gaston Planté.7 Lead Acid batteries continue to be popular due to their ease of manufacturing and high surge current capabilities, with automotive starting and forklift batteries being prime examples. The main disadvantages of the lead-acid chemistry is the lower energy density compared to other options as well as the generation of hydrogen and oxygen gas during the charging process, leading to potentially hazardous situations.

    The interior construction of a lead-acid type battery8

    The next major family of rechargeable battery chemistries is that of the nickel type batteries. Waldemar Junger invented the two most common types, the nickel-cadmium and nickel-iron batteries in 1898, the tradeoff between using iron and cadmium being that of cost and performance.9 The cadmium based cells were and continue to be popular due to their availability to deliver their full power over the entire discharge cycle, with the terminal voltage changing very little. Cadmium, however, is one of the more toxic metals in the periodic table, and is being phased out for less dangerous substitutions such as the more recent nickel–metal hydride. Nickel-iron, while less capable than its cadmium brother, was very popular due to its affordability, very long life cycles, and ruggedness. It has more recently been supplanted by lithium-iron batteries, which provide many of the same advantages but do not have the hydrogen gas generation and cell maintenance needs.

    Some rather old but still functional Nickel-Iron batteries10

    The lithium family has gotten a bad rapport from airlines and safety organizations due to early and poorly manufactured versions over charging and self-destructing due to thermal runaway. During typical operation, the lithium family enjoys very fast charge and discharge rates that do not produce hydrogen gas. The operating temperature ranges of lithium cells are more limited compared to other chemistries, but they also have some of the highest energy densities available. Lithium-iron batteries are a more recent formulation and much like the older nickel-iron chemistry, they are more durable, less sensitive, and safer batteries at the cost of some performance.

    A lithium-ion battery having a tough go of it during a thermal runaway event11

    Wire and Conduit

    The National Electric Code provides the most boundaries for residential use in the United States, and also provides an ampacity table for conductor size, material, temperature rating, and derating to account for high temperatures and number of conductors collocated. In practice, #10 AWG copper is the standard for connecting solar strings due to its high availability, ampacity, and lower voltage drops. Smaller systems that do not generate as much current can use #12 or #14, however they will experience higher voltage drops and power loss. Larger systems or those with very long feedlines that cannot be shortened may need to increase to #8 or larger to avoid such power loss. For larger feeder wires from the inverter AC output aluminum service entry cable is a good choice that is readily available in 100 to 200 Ampere rated flavors. Although aluminum must be two sizes larger than copper for the same ampacity, for such large loads copper is prohibitively expensive, especially over long runs. Battery cables can be undersized for their current output if they are using short jumpers to connect to larger bus bars that are rated appropriately. Due to the very high currents and relatively low voltages out of battery systems, they should be placed as close to the inverter as possible with as low loss cable that is affordable to avoid power loss with large bus bars and conductors used where possible.

    An older table excerpted from the NEC, not much has changed12

    Conduit, that is the container for the wiring, is also regulated by the National Electric Code. There are some special restrictions noted in the code, such as all Direct Current conductors that are on the interior of a residential structure need to be in a metallic conduit such as Electrical Metallic Tubing (EMT) or Flexible Metal Conduit (FMC). Conduit should also be labeled appropriately to indicate that it is a photovoltaic conductor. There are also limits on how many conductors of a particular size can be ran inside conduit of a certain size. Naturally, there is convenient tables to quickly reference common options, along with formulas for more complicated situations. It is important to note that some cable types such as Non Metallic (NM) and Service Entrance cable (SER) are rated for and typically installed not in conduit unless needed for physical protection due to their size and installation difficulty compared to cable such as THHN. Beyond code requirements, the type of conduit used is a matter of installation requirements such as moisture levels, above or below ground installations, installation space available, and proximity to damage. Non metallic options such as PVC, Electrical Nonmetallic Tubing (ENT), and Liquid-Tight Flexible Conduit (LFNC) are typically the easiest to install due to ease of cutting and assembly. Metallic options such as EMT, FMC, and Liquid-Tight Flexible Metallic Conduit (LFMC) provide higher protection levels but can be more difficult to work with and install.

    An NEC Table for the maximum number of the common THHN, THWN, and THWN-2 wires13

    Sources

    1. Physics:Theory of solar cells – HandWiki ↩︎
    2. File:Power-voltage (P -V) curve.png – Wikimedia Commons ↩︎
    3. Total Harmonic Distortion ↩︎
    4. H-bridge – Wikipedia ↩︎
    5. File:Squarewave01CJC.png – Wikimedia Commons ↩︎
    6. DOI:10.24003/emitter.v9i1.587 ↩︎
    7. https://www.corrosion-doctors.org/Biographies/PlantelBio.htm ↩︎
    8. https://www.researchgate.net/publication/266345609_Accurate_circuit_model_for_predicting_the_performance_of_lead-acid_AGM_batteries ↩︎
    9. https://en.wikipedia.org/wiki/Waldemar_Jungner ↩︎
    10. https://commons.wikimedia.org/wiki/File:Thomas_Edison%27s_nickel%E2%80%93iron_batteries.jpg ↩︎
    11. Sensor May Prevent EV Thermal Runaway ↩︎
    12. https://usawire-cable.com/wp-content/uploads/nec-ampacities.pdf ↩︎
    13. https://www.electricallicenserenewal.com/Electrical-Continuing-Education-Courses/NEC-Content.php?sectionID=553 ↩︎

  • Homegrown Solar

    This is the first of a series of posts detailing the planning, installation, setup, and performance data of a residential solar system with battery backup. While there are options to lease a solar installation, this will only cover ownership. This first post will focus on the background economics.

    It’s the Economy, Stupid

    Fancy electronics do not come cheap, especially if you don’t want them to burn down your house. Batteries can also be expensive. NREL finds that the price per watt of installed residential solar as of 2023 is about $2.7/W, down significantly from $8.6/W in 2010.1 Consumer Reports finds on average for 2025 a comparable $2.8/W, with some variation from state to state.2 This is on average of course, with labor and energy storage possibly making significant changes.

    Rebates and more

    There are several obvious, and some not obvious upsides though. The biggest ones are rebates and tax credits from local, state, and federal sources. The federal solar tax credit offered a %30 credit to your income taxes based off the price of installation of a new solar system, including materials and installation costs. However, this was axed earlier than originally planned and only systems put into service by the end of 2025 will qualify. Many state and local rebates programs remain however to still assist people in installing a system. Moving past one time upsides to recurring, a lesser known income stream from solar panels is that you can be issued Solar Renewable Energy Credits (SRECs) based on the amount of energy you produce. You can then sell these SRECs on the open market like other securities. If you have a fully electrified home and transportation, you could also harvest enough energy to not need any from your local grid, about 875 kWh monthly, which comes out to about $139 you could save.34 There also some grid companies that will let you sell back more than you use allowing you to generate income instead of just breaking even. A detail that can compound over time though is that when you pay your electric bill, you are paying two major charges: the generation charge, and the distribution charge. Typically, when you export to grid, you will only be getting credited for the generation charge. Thus, if you are interested in minimizing expenses and maximizing cash flow, it is wise to have an energy storage system installed that can take your surplus power first, so you can then power loads when the available power from the panels is insufficient. This way you can avoid the distribution charge from importing power from the grid, and when your energy storage system is full you can export the excess for profit.

    Batteries et al.

    Energy Storage Systems (ESS), can come in a myriad of forms, but can be generally divided into Chemical, Mechanical, and Electrical. Chemical storage is the reverse of what you would typically expect using fuel, but for example it is possible through electrolysis to generate Hydrogen gas out of electricity which can be stored and burned later. Mechanical storage relies on methods such as change of inertia for high mass flywheels, common for backup generator switchover systems, and change in potential energy, such as pumped storage hydroelectricity. Electric storage is the purest solution, using either capacitors or batteries to store the charge for later use. Due to size, permitting, and construction requirements, I am unaware of any off the shelf high mass flywheels or pumped storage systems for residential use, though for larger ranches with appropriate terrain micro-hydro power looks to be a straight forward project. As a result, the only real contender in the residential ESS space is batteries, which have decreased over time to under $100/kWh for cell cost, but when buying finished, UL listed batteries the price increases to $750/kWh.56

    Payback time

    No, not for your bullies. Like any big investment you make, you should look at the payback period, that is how long it will take for savings or profit to balance out the upfront cost. Start with your total available roof space and solar generation capacity, there are many calculators out there such as Google’s Project Sunroof.7 Look at your energy bills and see how much electricity you are using yearly to calculate cost and how much generation capacity you would need to meet your needs. Use your daily average to calculate the sizing for your onsite ESS. With all these numbers you should be able to calculate a rough up front cost, along with annual savings. Divide the two and that is your payback period. Don’t be shocked if it is in years, large power plants payback periods are often measured in decades.8

    Example

    First, see how much sun we get yearly and an estimate of roof space. Higher efficiency panels can generate over 20W/sq foot, but we’ll assume 15W/sq foot for this.

    With 930 square feet at 15W/sq foot, a rough estimate is a max array size of 14 kW. Multiply by our sunshine time of 1519 hours, we get annual generation of just over 21,000 kWh. Now lets see how that compares to usage.

    This is from my BGE bill and it has lots of good information, including the generation cost and the distribution cost per kWh so you can calculate savings later. For now we’re looking at the bottom right where it gives the annual usage of just under 7,000 kWh. A generation capacity of three times the usage, sounds great, but unless your grid is willing to take the excess it is wasted capacity. BGE for instance will only purchase up to 200% of excess based on my annual usage. Looking at daily usage, the annual high was July with 947 kWh used, divided by nominal 30 day month that comes to just under 32 kWh per day. It is good practice to only discharge Lithium Ion type batteries, the most common residential ESS solution, to 20% discharge. To find a one day power backup we’ll divide 32/(1-.2)=40 kWh. The battery can be sized smaller than this if you only need to run overnight and have rare clouds, or could be larger if you have long nights and dreary days. If you find your grid can be unstable at times a larger battery backup could also be beneficial, though many systems allow you to tie in a traditional generator to recharge batteries in a power outage scenario.

    Let’s assume a 14kW system with a 40kWh battery. 14kW at $2.7/W is just under $38K, while $750/kWh for a 40kWh battery is $30K. Total sticker price: $68K. Ouch. Let’s take some rebates out: 30% Federal rebate is $21K, Maryland Solar grant is $7K, Maryland ESS grant is $5K, county property tax is $1K, total of $34K, which is half our project cost. For energy savings, total electricity cost per kWh is just under 23 cents. Multiplied by 7MWh annual usage that comes out to $1.6K yearly. The remaining 14MWh of generation is paid out at the SOS rate of 16.731 cents/kWh, which comes to $2.3K yearly. You also get one SREC per MWh of generation, so the 14kW array will generate 21 SRECs annually, the current bid price each being $52, adding $1.1K yearly. Total annual savings and income: $5K. Dividing the after rebates price of $34K by annual savings and income of $5K gives a payback period of 6.8 years. Considering the panels and batteries have warranties that can be as long as 20 years, this system could make a 3x return on initial investment over its lifetime.

    Sources

    1. Solar Installed System Cost Analysis | Solar Market Research & Analysis | NREL ↩︎
    2. How Much Do Solar Panels Cost? (Nov 2025) ↩︎
    3. Electricity use in homes – U.S. Energy Information Administration (EIA) ↩︎
    4. Electricity Rates by State (November 2025) ↩︎
    5. Lithium ion battery cell price ↩︎
    6. Solar Battery Cost: Is It Worth It? (2025) | ConsumerAffairs® ↩︎
    7. Project Sunroof ↩︎
    8. Energy Return on Investment – World Nuclear Association ↩︎

  • Gone fishing

    Decided to get out and go fishing with a coworker spontaneously. We picked up a pair of simple spin casting rods and some bait from the store and went to the license free fishing spot at the end of the pier. Caught nothing but grass but enjoyed the fresh air and talking to our fellow angler John who we chatted with the whole time and let us try our one of his spinner baits. After, packed up and went and saw Thamma. 8/10, I would have probably gotten the jokes better if I spoke Hindi and enjoyed it more if they didn’t have the volume cranked sky high. Finally went home and tried editing mobile text width to make it wider. I have figured out how to do selective CSS code based off resolution width to target mobile devices but am struggling to make the text box resize and align properly. This post I did from the mobile app, so no guarantees.

  • Configuration Machinations

    After much struggling and assistance I finally got WordPress live on the sever and was able to login and configure. It seems the main holdup was that the server was running proxy for traffic and as a result the login page was blocking most of it as mixed insecure traffic, preventing any access. Some configuration changes managed by Daniel fixed the problem and got the ball rolling. We then had to play with the file structure and the .htaccess as well as index.php files to make the visitor page the root instead of the standard wordpress sub directory. It looks like most of what I created offline moved over, I had to reinstall the dark mode plugin and edit a few random fields. I’ll keep the studio software for now but it was irritating enough moving the files over that I may just edit the live web page directly in the future. Pardon the dust.

  • systemstart

    I've considered getting a domain on and off for a few years now, after playing around with my classmate's degrasse.com and finding it pretty fun. After successfully carrying another classmate through her Wharton EMBA Application through relentless and occasionally borderline psychopathic motivation, she bought me a one year domain license. Since I had nothing better to do during the (as of this writing) continual government shutdown besides wait around for permitting (see the Solar Project), I figured I should give it a try.

    Daniel, of degrasse.com, kindly gave me the rundown and helped me setup dynamic DNS for remote access of a spare server he had, which we then loaded Apache on for initial configuration. We then landed on WordPress for future work. Now, despite being capable, I very much prefer to stay in the world of hardware if at all possible. Relays and logic gates are my love language, machine code is preferable, assembly and VHDL is acceptable, anything higher level provides unnecessary abstraction and complication.
    Needless to say, HTML and PHP are about as far away as you could possibly get, but WordPress Studio seemed like a good IDE so I'm giving it a shot. When, not if, I figure out WebAssembly it will be featured as much as possible.

    For now, I will be working on making the skeleton of the website and then attempting to make it live asynchronously. Next I'll attempt to make it so I can make new posts without having to recompile the whole website. At some point I'll also try hosting an email server, but apparently sending out email from a self hosted server is difficult. It sounds like the solution is a SMTP relay with a free tier, because Google deprecated their free tier of email with Workspace.