This inscrutable is for a phone charger that is has its energy supplied by solar energy from a solar panel. It will also have the ability to optimize the solar energy collected by using a motor and light sensors to orient the platform to the position of maximum sunlight.
Step 1: Materials
2 ft. x 2 ft. thin sheet of plywood, or acrylic.
5V solar panel with alligator clips attatched
4 adafruit light sensors
1 stepper motor
2 USB cords
1 four pack of Velcro
1 Stepper Driver
1 roll of electrical tape
1 roll of gorilla tape
1 bottle of wood-glue
3 ft. of wire that is compatible with a breadboard
6 female-male wires
wire cutters, scissors, access to laser cutter, 3D printer, and soldering iron
Step 2: Laser Cutting
Replicate shapes from picture with the correct dimensions into separate files on Adobe Illustrator. Save each file as a PDF and cut out each one using a laser cutter. Make sure to take all necessary precautions when using the laser cutter.
Step 3: Gluing
Use the wood glue to glue together the separate wood cut-outs to make these 3 objects.
(NOTE: For the first piece, the Circuitry Holder, do not glue on the top yet.)
You will have one 9x9 in piece left, which will be taped on after the circuitry is installed.
Step 4: Velcro
Use 2 velcro strips to attach the solar panel to the top of the Solar Panel Holder.
Use 2 more strips to attach the Solar Panel Holder to the Phone Holder.
Step 5: Solar Panel to USB
Take one of your USB wires and cut the wire so that it is about a foot in length or shorter. Use the wire cutters to expose 4 smaller wires - there should be one red, one green, one white, and one black. Connect the red alligator clip to the silver inner wiring of the red wire and connect the black alligator clip to the silver inner wiring of the black wire. Plug in a phone to see if the charging icon appears. If not, try again in a place with more direct sunlight or under a lamp. If still no luck measure the voltage the solar panel is receiving using a voltmeter (it should be receiving around 4-5V) and try using another USB cord.
Step 6: Assembling the Breadboard (light Sensor)
First put the nodeMCU in the front of the breadboard with micro USB port facing out
cut four 6in pieces of wire from the roll then strip each side to expose the inner wire
insert one side of each of these wires into pins D0, D5, D6, D7, these pins are the input for the information received from the light sensors
Solder the other side of each wire to one side of each light sensor
Label each of these wires where, D0 = light sensor A, D5 = B, D6 = C, and D7 = D
Cut and strip four more wires at 5in solder each wire to the other side of each light sensor
Solder the open ends of each 5in wire to each other to connect the light sensors
Cut one more 5in wire which will be the analog input, solder one end of this wire to the conjunction of the light sensors, and insert the open end of this fifth wire to pin A0
Once this is all completed use tape to hold the wires into the breadboard
Step 7: Assembling the Breadboard (Stepper Motor)
Use 4 female to male wires, and connect the female openings of the wires to the four ports on the stepper driver, these ports are labeled IN1, IN2, IN3, IN4
Connect the male end of these wires to pins D1, D2, D3, D4 respectively
Take the stepper motor and insert the female port wires connected to the motor, into the male ports on the stepper driver labeled A, B, C, D
Use your last 2 female male wires and connect the female side of one to the - pin on the driver, and connect the male half of this wire to the gnd pin on the nodeMCU, then connect the other female wire to the + pin on the driver, to the voltage input pin on the nodeMCU
After everything is together, take the adhesive cover off of the breadboard and stick it to the bottom off the Circuitry Holder.
Step 8: Print Out the 3d Piece
Use a 3d printer and the Ultamaker Cura program to print out this file:
Tape the printed piece onto the bottom of the Phone Holder.
Step 9: Assemble
Take the top of the Circuitry Holder and stick the pointed side of the stepper motor through the hole. Tape the stepper motor down as pictured.
Now put the light sensors through the light sensor holes located on each of the four sides of the top of the Circuitry Holder.
Take the 3d piece and stick it into the other side of the hole.
Use tape to secure the lid of the Circuitry Holder
Connect the solar panel holder to the phone holder which should already be connected to the circuitry holder, from the steps above, and plug your phone in.
Step 10: Putting the Code Onto the NodeMCU
Use the other USB cord, connect to the NodeMCU and plug the other side into a computer. Open Visual Studio Code and open this python file.
In the terminal, type cd desktop, then type amp -d 0.5 -p COM3 put solar panel_v2.py. (NOTE: the "COM3" value may change from computer to computer. To find this on your computer, click the windows button, type "Device Manager", click Ports, and the word in the parentheses will be what you use.)
To run the code, install PUTTY on your computer and open it. Once the terminal opens, type "import solarpanel_v2" and the code should start to run, displaying the corresponding light sensor data. The stepper should also start to move.