Editor Version ×
recommended

Profession

free

Brand new interactions and interfaces

Smooth support for design sizes of over 3W

devices or 10W pads

More rigorous design constraints, more

standardized processes

For enterprises, more professional users

Standard

Easy to use and quick to get started

The process supports design scales of 300

devices or 1000 pads

Supports simple circuit simulation

For students, teachers, creators

Ongoing

STD RP2040_PV_Panel_Monitor

RP2040_PV_Panel_Monitor

Project tags

License

CERN Open Hardware License

License: CERN Open Hardware License

Mode:

Mode

Editors' pick

Editors' pick

Cloned from RP2040_Instant_Tankless_Water_Heater

  • 108
  • 0
  • 0
Update time: 2023-02-17 12:08:46
Creation time: 2023-01-22 08:07:04
Description

Description

# RP2040-based Photovoltaic Panel Monitor

# Safety Warning

This project deals with high DCs voltages. Make sure you understand what you are doing. Please read the safety warning below carefully.

 

# This PCB can monitor the volages and current of up to 8 PV cells with up to 50V each.

 

Please see https://github.com/GormR/PV_Supervisor for details.

 

CERN Open Hardware Licence Version 2 - Strongly Reciprocal

 

--------------------------------------------------------------------------------

 

#  Test code for PV Panel Monitor
#
#  copyright 2023 by Gorm Rose
#
#  This example code is licensed under GNU PL V3.0

# GP0: MuxSel1
# GP1: MuxSel0
# GP2: Temperature (DS18B20U)
# GP26: AIO0 voltage of "negative" PV modules
# GP27: AIO1 voltage of "positive" PV modules
# GP28: AIO2 common current
# Vref = external

from machine import Pin, I2C, ADC
#from ssd1306 import SSD1306_I2C
from time import sleep


#### µC pin definitions ####

MuxSel1 = Pin(0, Pin.OUT)                 # select1 for all multiplexers
MuxSel0 = Pin(1, Pin.OUT)                 # select0 (LSB) for all multiplexers
LED = Pin(3, Pin.OUT)                     # LED (high = on)
ADCn = ADC(26)
ADCp = ADC(27)
ADCc = ADC(28)


#### user constants ####
factor1 = 3 * (1 * 470 + 24) / (0x10000 * 24)  # 3 volt reference, 16 bit, divider 470/24
factor2 = 3 * (2 * 470 + 24) / (0x10000 * 24)  # 3 volt reference, 16 bit, divider 940/24
factor3 = 3 * (3 * 470 + 24) / (0x10000 * 24)  # ...
factor4 = 3 * (4 * 470 + 24) / (0x10000 * 24)
factor5 = 3 * 1000 * 2  / (0x10000 * (470 + 2))

#### variables ####

#    neg         _         pos
#     P1 P2 P3 P4 P5 P6 P7 P8
Vpv = [0, 0, 0, 0, 0, 0, 0, 0]
Ppv = [0, 0, 0, 0, 0, 0, 0, 0]
Ipv = 0

def set_mux(channel):
    if (channel & 2) == 0:
        MuxSel1.value(0)
    else:
        MuxSel1.value(1)
    if (channel & 1) == 0:
        MuxSel0.value(0)
    else:
        MuxSel0.value(1)
    

def read_value(channel, number_of_samples):
    global Vpv, Ppv, Ipv
    
    rawVoltNeg = 0
    rawVoltPos = 0
    rawCurrent = 0
    set_mux(channel)
    sleep(0.001)

    for i in range (0, number_of_samples):
        rawVoltNeg += ADCn.read_u16()
        rawVoltPos += ADCp.read_u16()
        rawCurrent += ADCc.read_u16()

    Ipv = factor5 * rawCurrent / number_of_samples
    if channel == 0:
        Vpv[0] = factor4 * (0x10000 - rawVoltNeg / number_of_samples) - Vpv[1] - 3
        Vpv[4] = factor1 * rawVoltPos / number_of_samples
        Ppv[0] = Ipv * Vpv[0]
        Ppv[4] = Ipv * Vpv[4]
    if channel == 1:
        Vpv[1] = factor3 * (0x10000 - rawVoltNeg / number_of_samples) - Vpv[2] - 3
        Vpv[5] = factor2 * rawVoltPos / number_of_samples
        Ppv[1] = Ipv * Vpv[1]
        Ppv[5] = Ipv * Vpv[5]
    if channel == 2:
        Vpv[2] = factor2 * (0x10000 - rawVoltNeg / number_of_samples) - Vpv[3] - 3
        Vpv[6] = factor3 * rawVoltPos / number_of_samples
        Ppv[2] = Ipv * Vpv[2]
        Ppv[6] = Ipv * Vpv[6]
    if channel == 3:
        Vpv[3] = factor1 * (0x10000 - rawVoltNeg / number_of_samples) - 3
        Vpv[7] = factor4 * rawVoltPos / number_of_samples
        Ppv[3] = Ipv * Vpv[3]
        Ppv[7] = Ipv * Vpv[7]
    

print("Hello Solar World!")

for i in range(0, 1000):
    for j in range(0, 4):
        read_value(j, 1000)
    print("voltages: ", Vpv)
    print("current:  ", Ipv)
    print("resulting power: ", Ppv)
    print()

 

Design Drawing

Design Drawing

schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
ID Name Designator Footprint Quantity
1 100nF C23,C1,C3,C4,C6,C7,C26,C27,C28,C29,C30,C31,C32,C8 C0603 14
2 10uF C24,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20 C0603 13
3 RASPBERRY PI PICO GP1 RASPBERRY PI PICO 1
4 19-213/Y2C-CQ2R2L/3T(CY) LED LED0603-RD 1
5 3.3kΩ R7,R10,R2 R0603_NEW 3
6 2kΩ R54,R1,R3,R5,R52,R53 R0603 6
7 DS18B20U U2 MSOP-8_L3.0-W3.0-P0.65-LS4.9-BL 1
8 LM4040A30IDBZRG4 U3 SOT-23-3_L2.9-W1.6-P1.90-LS2.8-BR 1
9 0603White light_C2290 3.3V LED0603-R-RD_WHITE 1
10 BCC2R7S205YS0812A2NS01 C25 CAP-TH_BD8.0-P3.50-D0.6-FD 1
11 0.1uF C33 C_DISC_D6.0MM_W4.4MM_P5.00MM 1
12 1N5819WS D1 SOD-323_L1.8-W1.3-LS2.5-RD 1
13 ES1J_C232830 D2,D3,D4 SMA_L4.3-W2.7-LS5.0-RD 3
14 5.0SMDJ330CA D20 SMC_L6.9-W5.9-LS7.9-BI 1
15 1mH L1 IND-TH_BD8.5-P5.00-D0.6 1
16 TESTPAD8 P1,P2,P3,P4,P5,P6,P7,P8,P9,P10 TESTPAD50/80 10
17 AO3401A Q1 SOT-23_L2.9-W1.3-P1.90-LS2.4-BR 1
18 PA2512FKE7T0R001E R4 RES-SMD_L6.4-W3.2-A 1
19 470kΩ R6,R12,R21,R22,R23,R24,R25,R26,R27,R28,R29,R35,R36,R37,R38,R39,R40,R41,R42,R43,R44,R45,R46,R47,R48,R49,R50 R0603 27
20 24kΩ R8,R9,R11,R30,R31,R32,R33,R34 R0603 8
21 390kΩ R13,R14,R15,R16 R0603 4
22 15Ω R17,R18,R19,R20,R51 R0805 5
23 RS8521XF U1,U4,U6 SOT-23-5_L3.0-W1.7-P0.95-LS2.8-BL 3
24 CD74HCT4052ME4 U5 SOIC-16_L9.9-W3.9-P1.27-LS6.0-BL 1
25 LNK3204D-TL U8 SO-8C_7P-L4.9-W3.9-P1.27-LS6.0-BL-PE3 1

Unfold

Project Attachments

Project Attachments

Order File name Download times
1

Test_PV_Panel_Monitor.py

0
Project Members

Project Members

Target complaint
Related Projects
Change a batch
Loading...

Comment

Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn