Solar Sensing Blind Opener
Components
ESP32
INA219 current sensor
Motor w/ Encoder
DRV8833 Dual Motor Driver Carrier
Solar Panel
1k Resistor
Wires
Solar Panel Circuit
This was the initial circuit designed to make sure the INA219 can receive solar readings from the panel

Motor Added to Circuit
This is the updated circuit where the motor was added.

Solar Sensing
The I2C reads off the voltage, current, and power readings from the sunlight hitting the solar panel. From there, a motor moves a certain amount. Once the voltage readings drop below the threshold, the motor will move back a certain amount.
On/Off Button
Through the use of MQTT, we set up an IFTTT connection between a phone and Adafruit Io. By pressing either the on or off button of the phone, it sends data( either 1 or 0 for on or off) to an Adafruit feed that the ESP32 is subscribed to. From there depending on what data the feed receives, the ESP32 will either turn the motor clockwise or counterclockwise. Down below is the pseudo code for how the function works.
Code
Confirm connection to internet and Adafruit
When called, check for any messages
Within callback function, there is an If else statement
If msg == b’1, turn on LED and move motor
Else, turn on LED and move motor in opposite direction.
Video Demonstration
This is your Video Description paragraph. It’s a great place to add a description of the video displayed in this section, and a few more words about your business, your site or what you do. Use a friendly and conversational tone to engage as many users as possible!
Slider
Using the Adafruit.io website, we also incorporated a slider block so that users can have full control on how much they want to open or close the blinds. Each value in the slider corresponds to an encoder tick value that the code reads then rotates the motor by that amount. Down below is the pseudo code for this function.
Code
Confirm connection to internet and Adafruit
When called, check for any messages
There is a prev_int value, by which represents the motor’s original position
From the slider, the message sent would be shown as a bit in the form of b’value’
Code decodes the message to a string then we convert it into an integer
The variable new is the converted value scaled to our preference (multiplied by 9 for full 900 tick rotation).
The dec function decodes our encoder values to our desired