Electrical
General Information
Item Name: Electrical
Item Number: 123
Supplier: NSG
Cost Informatio
Quantity: 1
Unit Cost: 5705.00
Labor Cost: 0.00
Material Cost: 0.00
Total Cost: 5705.00
Additional Information
Notes
Continuous Operation Using Solar Panels, Battery Storage, and Generator
The goal is to ensure that the essential devices can run continuously using solar power, batter
storage, and a backup generator. Here’s how it works and the detailed calculation:
Key Components and Their Roles
1. Solar Panels: Generate power during daylight hours to recharge the batteries and run
essential devices.
2. Battery Storage: Store excess solar energy for use when solar power is not available.
3. Small Generator: Provides backup power when solar energy is insufficient or during
prolonged periods without sunlight.
Essential Devices and Their Power Consumption
Small DC Refrigerator: 150 watts
Ceiling Fans (2 units): 75 watts each = 150 watts
LED Lights (5 units): 10 watts each = 50 watts
Phone Chargers (2 units): 10 watts each = 20 watts
Total Power Consumption: 150 + 150 + 50 + 20 = 370 watts
Power Availability and Recharging
Solar Panels
Number of Panels: 2
Output per Panel: 300W
Total Solar Output: 600W
Average Sunlight Hours per Day: 5 hours (depending on location and season)
Total Energy Generated per Day: 600watts×5hours=3,000watt-hours=3kWh600 \text{ watt
\times 5 \text{ hours} = 3,000 \text{ watt-hours} = 3 \text{ kWh}600watts×5hours=3,000watt-
hours=3kWh
Battery Storage
Capacity: 2 kWh
Daily Recharging from Solar: The solar panels generate 3 kWh per day, which is
sufficient to fully recharge the 2 kWh battery and provide additional power for immediate
use.
Small Generator
Capacity: 1 kW
Fuel Availability: Assuming continuous fuel supply, the generator can run as long as
needed.
Power Output per Hour: 1,000watts×24hours=24,000watt-hours=24kWh/day1,000 \text{
watts} \times 24 \text{ hours} = 24,000 \text{ watt-hours} = 24 \text{
kWh/day}1,000watts×24hours=24,000watt-hours=24kWh/day
Combining All Power Sources
Daily Power Needs for Essential Devices
Total Daily Consumption: 370watts×24hours=8,880watt-hours=8.88kWh/day370 \tex
watts} \times 24 \text{ hours} = 8,880 \text{ watt-hours} = 8.88 \text{
kWh/day}370watts×24hours=8,880watt-hours=8.88kWh/day
Power Provided by Solar Panels and Generator
Solar Panels: 3 kWh/day
Battery Storage: Stores 2 kWh (recharged daily)
Generator: Provides additional power as needed
Continuous Operation Scenario
1. During Daylight: Solar panels generate 3 kWh, which is used directly to power devices
and recharge the batteries.
2. During Night or Low Sunlight: The battery (2 kWh) provides power for a portion of the
night, and the generator supplies additional power when the battery is depleted.
Ensuring Continuous Power
Battery Usage: Battery provides 2 kWh, covering a portion of the night (approx. 5.4 hou
at 370 watts).
Generator Usage: The generator runs to cover the remaining power needs.
Total Generator Run Time Per Day
Power Needed from Generator: 8.88kWh(totaldailyconsumption)
−3kWh(solar)=5.88kWh8.88 \text{ kWh (total daily consumption)} - 3 \text{ kWh (solar)}
5.88 \text{ kWh}8.88kWh(totaldailyconsumption)−3kWh(solar)=5.88kWh
Generator Output Per Hour: 1 kW
Generator Run Time: 5.88kWh1kW=5.88hours\frac{5.88 \text{ kWh}}{1 \text{ kW}} =
5.88 \text{ hours}1kW5.88kWh =5.88hours
The generator needs to run for approximately 6 hours per day to ensure continuous power for
essential devices, assuming 5 hours of sunlight and the battery's contribution.
Essential Components
1. Solar Panels: To generate power for essential devices.
2. Charge Controller: To manage the power from the solar panels to the batteries.
3. Battery Storage: To store energy generated by the solar panels.
4. Small DC Refrigerator: For medicines and baby formula.
5. Ceiling Fans and LED Lights: For basic lighting and cooling.
6. Phone Chargers: To keep communication devices powered.
7. Small Generator: To provide additional backup power.
Initial Investment in Solar System
Based on our previous discussions, the key components of the solar system include:
Solar Panels: 2 panels
Solar Charge Controller
Battery Storage: 2 kWh capacity
Inverter
Mounting Hardware and Wiring
Installation
L
Assembly Notes
Key Functions in the Sample Code
1. GPIO Setup:
Purpose: Configures the General Purpose Input/Output (GPIO) pins on the
Raspberry Pi to control the relays connected to the solar charge controller, battery
storage, and the backup generator.
Explanation: This setup allows the Raspberry Pi to switch the power flow between
different sources based on the system's needs.
2. ADC Setup:
Purpose: Uses an Analog-to-Digital Converter (ADC) to read current sensors that
monitor the flow of electricity.
Explanation: The ADC converts the analog signals from the current sensors into
digital values that the Raspberry Pi can process. This data is crucial for real-time
monitoring and decision-making.
3. MQTT Setup:
Purpose: Establishes a connection with an MQTT broker to publish power data an
receive commands.
Explanation: MQTT is a lightweight messaging protocol ideal for communication
between the Raspberry Pi and other devices in the home automation system. It
ensures efficient data exchange and remote control capabilities.
4. Main Loop:
Purpose: Continuously monitors battery voltage, solar power generation, and hous
power usage. It makes decisions based on this data to manage power flow
effectively.
Explanation:
Battery Voltage Monitoring: Checks the battery voltage to determine if the
batteries need charging or if they are fully charged.
Solar Power Management: Directs solar power to charge the batteries or
supply the house, depending on the battery's state of charge.
Backup Generator Activation: Turns on the generator when solar and batte
power are insufficient to meet the house's power needs.


 [ Solar Panels ] --------> [ Solar Charge Controller ] --------> [ Battery Storag
]
               |                   |
               |                   |
               V                   V
  [ Raspberry Pi ] -------> [ Inverter ] ----------------------> [ Home AC System ]
   |           |                   |
   |           V                   |
   |         [ Backup Generator ] ---------------------->|
   |                               |
   |-------------------------------------------------------------|
                  |
              [ Wi-Fi Router ]
                  |
              [ Emergency Button ]
                  |
              [ Current Sensors ]
                  |
              [ USB Charging Hub ]
                  |
              [ Essential Appliances ]
              (e.g., Refrigerator, Ceiling Fans)
                  |
              [ LED Lighting System ]
                  |
              [ Monitoring & Control ]
              (via Home Assistant & MQTT)


Comparison Table: Custom Solar Backup System vs. Commercially
Available System
Below is a detailed comparison of the costs of building your own solar backup system versus
purchasing a commercially available system that offers similar functionality.
1. Custom Solar Backup System (DIY)
Component Estimated Cost ($)
Solar Panels (2 panels) 500
Solar Charge Controller 100
Battery Storage (2 kWh) 1,000
Inverter 300
Raspberry Pi 4 55
Wi-Fi Router 50
Uninterruptible Power Supply 100
Small Generator (1kW) 500
Current Sensors and Relays 100
Emergency Button 10
USB Charging Hub 30
Installation and Misc. 500
Component Estimated Cost ($)
Total Custom System Cost 3,245
2. Commercially Available System (Example: EcoFlow DELTA Pro + Smart Home Panel)
Component Estimated Cost ($)
EcoFlow DELTA Pro (Power Station) 3,699
Smart Home Panel 1,499
Solar Panels (400W x 4) 2,000
Installation and Misc. 500
Total Commercial System Cost 7,698
Detailed Plan and Time Allocation
1. Initial Setup (4 hours)
Install Raspberry Pi OS: 1 hour
Install necessary libraries and dependencies: 1 hour
Set up MQTT Broker (Mosquitto): 1 hour
Verify initial setup: 1 hour
2. Data Collection Script (10 hours)
Write script to read sensor data (voltage, current): 4 hours
Publish data via MQTT: 2 hours
Test and debug sensor data collection: 4 hours
3. Flask Application (20 hours)
Set up Flask project structure: 3 hours
Write main Flask app with basic routes: 4 hours
Integrate MQTT to handle real-time data: 5 hours
Test Flask app with sample data: 4 hours
Refine and debug Flask app: 4 hours
4. Frontend Dashboard (25 hours)
Design HTML template for dashboard: 5 hours
Integrate Chart.js for real-time data visualization: 10 hours
Ensure smooth data updates in the frontend: 5 hours
Test and debug frontend: 5 hours
5. Integration and System Testing (20 hours)
Integrate all components (sensors, MQTT, Flask, frontend): 10 hours
Perform end-to-end testing: 5 hours
Debug and refine system: 5 hours
6. Documentation and Deployment (10 hours)
Document setup and usage instructions: 4 hours
Final deployment and verification on Raspberry Pi: 6 hours
Total Estimated Time: 89 hours
Tips for Efficiency
1. Break Down Tasks: Focus on one task at a time. Breaking tasks into smaller steps can
make the project feel more manageable.
2. Use Version Control: Use Git for version control. This will help you keep track of change
and revert back if something breaks.
3. Seek Help When Stuck: Utilize ChatGPT for specific questions or issues. Stack Overflo
and other online communities can also be very helpful.
4. Test Incrementally: Test each component individually before integrating. This will make
easier to identify and fix issues.
5. Document as You Go: Keep notes and document steps as you complete them. This wil
save time later and ensure you don't forget any details.

Process
simple, web-enabled reporting dashboard for your custom solar backup system to monitor pow
usage in real time. This can be done using tools and technologies like Python, Flask (a micro
web framework), and Chart.js for data visualization. Here’s a step-by-step guide to set up such
dashboard:
Step 1: Set Up the Raspberry Pi
1. Install Raspberry Pi OS: Make sure your Raspberry Pi is running the latest version of
Raspberry Pi OS.
2. Install Python Libraries:

bash
Copy code
sudo apt-get update sudo apt-get install python3-pip pip3 install
flask paho-mqtt adafruit-circuitpython-ads1x15
Step 2: Create Python Scripts for Data Collection
Create a Python script to read data from your sensors and publish it via MQTT.

python
Copy code
import time import board import adafruit_ads1x15.ads1015 as ADS from
adafruit_ads1x15.analog_in import AnalogIn import paho.mqtt.client as
mqtt # Set up ADC i2c = board.I2C() ads = ADS.ADS1015(i2c) chan0 =
AnalogIn(ads, ADS.P0) chan1 = AnalogIn(ads, ADS.P1) chan2 =
AnalogIn(ads, ADS.P2) # MQTT setup MQTT_BROKER = "localhost" MQTT_POR
= 1883 client = mqtt.Client() client.connect(MQTT_BROKER, MQTT_PORT,
60) # Publish sensor data while True: battery_voltage = chan0.voltage
solar_power = chan1.voltage house_power = chan2.voltage
client.publish("home/battery_voltage", battery_voltage)
client.publish("home/solar_power", solar_power)
client.publish("home/house_power", house_power) time.sleep(5)
Step 3: Create a Flask Application for the Dashboard
Set up a Flask application to serve the dashboard.
1. Create the Flask App:

bash
Copy code
mkdir flask_app cd flask_app touch app.py mkdir templates static
2. app.py:

python
Copy code
from flask import Flask, render_template, jsonify import
paho.mqtt.client as mqtt app = Flask(__name__) battery_voltage =
solar_power = 0 house_power = 0 def on_connect(client, userdata,
flags, rc): client.subscribe("home/#") def on_message(client,
userdata, msg): global battery_voltage, solar_power, house_power
if msg.topic == "home/battery_voltage": battery_voltage =
float(msg.payload.decode()) elif msg.topic == "home/solar_power":
solar_power = float(msg.payload.decode()) elif msg.topic ==
"home/house_power": house_power = float(msg.payload.decode())
client = mqtt.Client() client.on_connect = on_connect
client.on_message = on_message client.connect("localhost", 1883,
60) client.loop_start() @app.route('/') def index(): return
render_template('index.html') @app.route('/data') def data():
global battery_voltage, solar_power, house_power return
jsonify(battery_voltage=battery_voltage, solar_power=solar_power,
house_power=house_power) if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
3. templates/index.html:

html
Copy code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0"> <title>Power Usage Dashboard</title> <script
src="https://cdn.jsdelivr.net/npm/chart.js"></script> </head>
<body> <h1>Power Usage Dashboard</h1> <canvas id="myChart"
width="400" height="200"></canvas> <script> var ctx =
document.getElementById('myChart').getContext('2d'); var myChart
new Chart(ctx, { type: 'line', data: { labels: [], datasets: [{
label: 'Battery Voltage', borderColor: 'rgb(75, 192, 192)', data:
[] }, { label: 'Solar Power', borderColor: 'rgb(255, 159, 64)',
data: [] }, { label: 'House Power', borderColor: 'rgb(54, 162,
235)', data: [] }] }, options: { scales: { x: { type: 'realtime',
realtime: { duration: 20000, refresh: 2000, delay: 2000,
onRefresh: function(chart) { fetch('/data') .then(response =>
response.json()) .then(data => {
chart.data.labels.push(Date.now());
chart.data.datasets[0].data.push(data.battery_voltage);
chart.data.datasets[1].data.push(data.solar_power);
chart.data.datasets[2].data.push(data.house_power);
chart.update('quiet'); }); } } } } } }); </script> </body> </html
Step 4: Run the Flask Application
1. Start the Flask Application:

bash
Copy code
python3 app.py
2. Access the Dashboard: Open a web browser and go to
http://<Raspberry_Pi_IP>:5000 to view the dashboard.
Summary
Setup: Install necessary libraries and create Python scripts for data collection and a Flas
application for the dashboard.
Data Collection: Use sensors and MQTT to collect and publish data.
Web Dashboard: Create a simple web dashboard using Flask and Chart.js to display re
time power usage data.
Access: View the dashboard on any device connected to the local network by navigating
to the Raspberry Pi's IP address.
This setup provides a web-enabled dashboard for real-time monitoring of power usage, helpin
the landlord manage multiple homes efficiently.

Sample Code for low power management
import RPi.GPIO as GPIO import time import paho.mqtt.client as mqtt
import Adafruit_ADS1x15 # For ADC to read current sensors # GPIO setu
RELAY_PIN_SOLAR = 17 RELAY_PIN_GRID = 27 RELAY_PIN_BATTERY = 22
RELAY_PIN_AC = 23 # Additional relay for AC GPIO.setmode(GPIO.BCM)
GPIO.setup(RELAY_PIN_SOLAR, GPIO.OUT) GPIO.setup(RELAY_PIN_GRID,
GPIO.OUT) GPIO.setup(RELAY_PIN_BATTERY, GPIO.OUT)
GPIO.setup(RELAY_PIN_AC, GPIO.OUT) # ADC setup adc =
Adafruit_ADS1x15.ADS1115() GAIN = 1 # MQTT setup MQTT_BROKER =
"localhost" client = mqtt.Client() client.connect(MQTT_BROKER) #
Function to read current sensor def read_current(channel): value =
adc.read_adc(channel, gain=GAIN) current = (value / 32767.0) * 5.0 #
Example conversion return current # Function to activate low power mo
def activate_low_power_mode(): print("Low power mode activated!")
GPIO.output(RELAY_PIN_SOLAR, GPIO.HIGH) # Charge batteries with solar
power GPIO.output(RELAY_PIN_GRID, GPIO.LOW) # Turn off grid power to
house GPIO.output(RELAY_PIN_BATTERY, GPIO.LOW) # Supply power to hous
from batteries GPIO.output(RELAY_PIN_AC, GPIO.HIGH) # Run AC for a se
duration # Main loop try: while True: battery_voltage = read_current(
# Read battery voltage from ADC solar_power = read_current(1) # Read
solar power from ADC house_power = read_current(2) # Read house power
usage from ADC # Publish power values to MQTT
client.publish("home/battery_voltage", battery_voltage)
client.publish("home/solar_power", solar_power)
client.publish("home/house_power", house_power) # Check battery volta
to manage power flow if battery_voltage < 12.0: # Example threshold f
low battery activate_low_power_mode() time.sleep(1) except
KeyboardInterrupt: GPIO.cleanup()
Unit Name
StayInPlace
Unit Type
1BR
Unit Cost USD
0.00
Is Active
No
Description
Electrical System for a High-Efficiency Modular Home
Key Components and Costs:
1. Main Electrical Panel:
Function: Distributes electricity to various circuits within the home.
Cost: $1,000
2. Wiring and Circuit Breakers:
Function: Provides the necessary pathways for electrical current and ensures safety
through circuit breakers.
Cost: $500
3. Small DC Refrigerator:
Function: Keeps food and perishables fresh with low power consumption.
Cost: $300
4. Ceiling Fans (2 units):
Function: Provides air circulation and cooling.
Cost: $150
5. LED Lighting Components:
Function: Provides efficient lighting throughout the home.
Cost Breakdown:
12V LED Strip Lights (16 Ft Reel, 3528SMD, Warm White): $30.00 x 5 = $150
LED Panel Lights (24V, 5M Reel, 4000K Daylight): $90.00 x 1 = $90
12V LED Pendant Lights (Various styles and sizes): $35.00 x 4 = $140
LED Under-Cabinet Strip Lights (12V, 5M Reel, Warm White): $30.00 x 2 = $60
Magnetic Mounts for Lights (Neodymium Magnets): $10.00 x 10 = $100
Wiring (12V Wiring, 100 Ft Roll): $50.00 x 2 = $100
Fuse Box (For low voltage system): $20.00 x 1 = $20
Connectors and Accessories (For wiring and connections): $50.00 x 1 = $50
Total LED Lighting Costs: $710
6. Phone Chargers (2 units):
Function: Charges essential devices.
Cost: $20
7. Installation Costs:
Function: Labor costs for installing electrical systems.
Cost: $500
Total Estimated Electrical System Cost:
Main Electrical Panel: $1,000
Wiring and Circuit Breakers: $500
Small DC Refrigerator: $300
Ceiling Fans: $150
LED Lighting Components: $710
Phone Chargers: $20
Installation: $500
Total: $3,180
Intelligent Energy Management System
Components:
Raspberry Pi 4:
Function: Central controller for energy management.
Cost: $55
Solar Panels (if included in future):
Function: Generate renewable energy.
Cost: $250 each (2 panels = $500)
Battery Storage (2 kWh):
Function: Stores excess solar energy for use during night or cloudy periods.
Cost: $1,000
Solar Charge Controller:
Function: Manages charging of batteries from solar panels.
Cost: $100
Inverter:
Function: Converts DC power from batteries to AC power.
Cost: $200
Backup Generator:
Function: Provides additional power during extended outages.
Cost: $500
Wi-Fi Router:
Function: Maintains internet connectivity.
Cost: $50
Emergency Button:
Function: Activates low power mode.
Cost: $20
Current Sensors and Relays:
Function: Monitors and controls power flow.
Cost: $100
Home Assistant Software:
Function: Home automation and monitoring.
Cost: $0 (open-source)
Total Estimated Energy Management System Cost:
Raspberry Pi 4: $55
Solar Panels: $500
Battery Storage: $1,000
Solar Charge Controller: $100
Inverter: $200
Backup Generator: $500
Wi-Fi Router: $50
Emergency Button: $20
Current Sensors and Relays: $100
Total: $2,525
Summary
Total Estimated Cost for Electrical System and Intelligent Energy Management System:
Electrical System: $3,180
Energy Management System: $2,525
Overall Total: $5,705
This setup ensures your modular home remains resilient and energy-efficient, providing
continuous comfort and functionality even during power interruptions. The integration of smart
technology and renewable energy sources maximizes sustainability and reduces overall energ
costs.
Hide Gallery
Save as Stakehoder HTML
Headless Print
glass_pendant_.jpeg