Superman Candy Dispenser
by vikramksc2604 in Circuits > Electronics
30 Views, 1 Favorites, 0 Comments
Superman Candy Dispenser

This instructable is an assembly guide for the Superman Candy/Chocolate dispenser model available on Maker World.
The CAD files are available at:
Supplies



This assembly requires the following electronics:
- ESP32(or any arduino like microcontroller)
- MG995 180 Degree Servo motor: (x1)
- Limit Switch (x1)
- LED (optional)
- Wires
Mechanical Components:
M3 screws with bolts
Assembly



Start with the back_cover.stl and Fit the servo motor into the space.
You may encounter that the servo is not fitting (like in the second image), all you have to do is push it to the corner as much as possible, apply pressure and it will eventually go through.
Make sure the servo is aligned as shown in the image where the metal head is next to the little rectangular empty space of the part.
M5 screws are a bit tight and bend the part so u can use M3 screws with bolts for the servo too.
Next






Now pick the right_adapter.stl and left_adapter.stl part to attach with the back_cover.stl part to form the body of the machine.
You can refer the images on how to attach these parts and screw them.
In the last image you can observe that the back cover is supposed to be behind the left/right cover part.
Assemble both the left and right cover parts using m3 screws and bolts.
Coding the Electronics

Why we need the coding step now will be justified as we go. You can just use an Arduino UNO R3 too
Firstly follow the connection diagram in the image given.
Wire your connections in the similar way (you can assign any other Pins:
Arduino code:
#include <ESP32Servo.h>
const int switchPin = 14; // Limit switch pin
const int servoPin = 5; // Servo control pin
Servo myServo;
void setup() {
pinMode(switchPin, INPUT_PULLUP); // Use internal pull-up resistor
myServo.attach(servoPin);
myServo.write(35); // Initialize servo to 45 degrees
delay(500); // Give time for the servo to reach position
}
void loop() {
if (digitalRead(switchPin) == LOW) { // Switch is pressed
myServo.write(10); // Move to 10 degrees
} else {
myServo.write(35); // Return to 45 degrees
}
delay(50); // Small delay to reduce unnecessary updates
}
In the setup function adjust the home position of the servo, in my case it is 35.
Set it according to your preference.
When switch is pressed my servo goes to 10 degrees and when switch is not pressed anymore it goes back to 35.
Make sure when the switch is press the servo motor moves clockwise.
Attach Dispenser Part




NOTE: Insert the part when the servo
Once you have formed the body, you can attach the dispenser_servo.stl part to the servo motor metal head.
Before that take the circular servo horn and screw it to the 2 holes in the dispenser_servo.stl part.
Observe 3rd Image. Once it is done, attach the part with the servo horn screwed, to the servo metal head.
NOTE: As you have uploaded the code, the servo will be in its home position. now the dispenser_servo part should be placed horizontally to the servo.
Electronics Connections






Now connect the switch, motor and LED(optional) as per given diagram in the previous step.
You can insert the wires through the small gap i have made in the back_cover part.
Now insert them through the supermankey-holder-switch.stl part.
You will get a result like the last two pics.
Note the switch orientation with respect to the part.
Attach Top Part



The top_cover.stl part is a sliding mechanism.
Slide it onto the sections of left_cover.stl and right_cover.stl part.
Observe 3rd pic.
Final Assembly


the left and right cover parts have a sliding section for the supermankey-holder-switch.stl.
Similar to previous mechanism, slide this part too and you will get a result like the 2nd image.
Place the superman_key.stl part and test the switch mechanism.
Place Container and Test

Place the container and test it yourself.
NOTE: Use small candies.