Runaway Spider
Story
Spider-Man is my favorite Marvel hero, and for a long time I fantasized about having a super-powerful little spider inadvertently bite me, which was simply awesome.
Is this little spider cool? Because I want to be a small spider, I chose Seeeduino XIAO. With the cooperation of vibration motor and light sensor, this spider will keep quiet in the night, but once there is light , The spider will start to vibrate, avoiding the light.
Step 1 Soldering each component
Adjust the proper position, solder the vibration motor, light sensor, Seeeduino XIAO, and power supply together, you need to adjust the connection method according to the layout of the device itself, otherwise you may solder the circuit very messy.
Step 2 making spider legs
Here I used the most common resistive element to make the spider's eight legs. The slender resistive element makes it look more realistic.
Step 3 Code
This project is suitable for junior scholars, and the code is very simple.
Tips:
The movement direction of this little spider is mainly adjusted by the contact between the eight legs and the ground and the position of its center of gravity. If you want to make it move faster, I suggest that you can switch to another vibration motor and install the motor on the head. Part or tail, this kind of exercise effect will be better.
Supplies
Soldering Each Component
Adjust the proper position, solder the vibration motor, light sensor, Seeeduino XIAO, and power supply together, you need to adjust the connection method according to the layout of the device itself, otherwise, you may solder the circuit very messy.
Making Spider Legs
Here I used the most common resistive element to make the spider's eight legs. The slender resistive element makes it look more realistic.
Code
This project is suitable for junior scholars, and the code is very simple.
const int lightPin = 2;
const int motor = 3;
int lightState = 0;
void setup() {
pinMode(motor, OUTPUT);
pinMode(lightPin, INPUT);
}
void loop() {
lightState = digitalRead(lightPin);
if (lightState == HIGH) {
digitalWrite(motor, HIGH);
}
else {
digitalWrite(motor, LOW);
}
}
Tips
The movement direction of this little spider is mainly adjusted by the contact between the eight legs and the ground and the position of its center of gravity. If you want to make it move faster, I suggest that you can switch to another vibration motor and install the motor on the head. Part or tail, this kind of exercise effect will be better.