IoT - Graduation-Project2/EggBlock-Solor_Energy_Generation_and_Trading_Platform GitHub Wiki

OVERVIEW
















COMPONENTS

  • Solar panel: SCM 5WA/300mA/18V/240x180x23(mm) (1EA)
  • Raspberrypi: 3B+ (3EA)
  • Light sensor: GY-30 (3EA)
  • Controller: ESC1206 (2EA)
  • Battery: KB 4.5Ah/12v (2EA), AA 1.5Vbattery (8EA)(optional)
  • Stepper Motor: NEMA17/ 12V/0.4A/1.8 degree/ 280mN.m holding torque (1EA)
  • Motor driver: L298N (1EA)
  • Converter: Boost-Buck Converter-LM2577,LM2596/ input voltage:3.5V-28V/ output voltage: 1.25V-26V (1EA)
  • etc) Holder, wires, somethings for balancing.


TOP











  • Solar panel
    • Receive electronic power with rotatation.
    • Expected power generation: 5W(Solar panel)* 3.5h(average amount of Sunshine)=17.5Wh


MIDDLE

  • 3 light sensor and 2 Raspberrypi
    • Each light sensor connect to each raspberrypi(another one is located at bottom)
    • Each light sensor receive light value and tranfer it to raspberrypi
    • Each raspberrypi receive the value and send it to Server
def readIlluminance():
    i2c = smbus.SMBus(I2C_CH)
    luxBytes = i2c.read_i2c_block_data(BH1750_DEV_ADDR, CONT_H_RES_MODE, 2)
    lux = int.from_bytes(luxBytes, byteorder='big')
    i2c.close()
    return lux




BOTTOM(Main part)

  • There are 3 parts as function.
    • Solar system: controller receive solar energy from solar panel, store it to battery and tranfer energy to raspberrypi( it is neccessary to step-down voltage using converter because output voltage (12V) lead to burn off the raspberrypi)

    • Transaction system: if provider confirm to transaction with consumer, raspberrypi start to transfer energy to consumer until time(calculated as amount of token) in our blockchain

    • Learning & motor control system: raspberrypi read each of light sensor and do reinforcement learning, then result angle value is transferred to stepper motor through motor driver.

def fit_model():
    read_data()
    X = df.iloc[:,0:-1]
    Y = df["Angle"]

    lm.fit(X, Y)
        
    accuracy = lm.score(X, Y)
    print(accuracy)
    
    return lm

def angle(value):
    lm = fit_model()
    
    X = df.iloc[-1 ,0:-1]
    predict = lm.predict([X])
    if (predict - value >= 45 || value - predict >= 45):
        df.iloc[-1, -1] = lm.predict([X])
    else:
        df.iloc[-1, -1] = value
⚠️ **GitHub.com Fallback** ⚠️