As I mentioned last week, In my midterm Project, I want to make a spider that can climb up and down when someone approach and make noise, it will climb down from the ceiling and observer what is happening then report to the master.
Physical Holder part
For the physical device part, I use cardboard + laser cutting to make my wheeling holding device, After the fifth iteration, I finally succeeded to integrate the microphone, the turning wheel, and the motor together. I found that if I want to assemble the components without glue, I have to calculate the burn-out width of the holes and it is hard because each time I cut, I get a different result.
Micro controller: Stepper Motor and Sensor
I use a stepper motor and cannot get it working in both directions for 3 days. Finally, I found that the motor 28BYJ-48 have to use a different library which is <CheapSteaper> or it will not output the correct signal, which causes the motor to work both clockwise and anti-clockwise. Originally, I plan to use motion sensor for detection, but I didn’t have one so I change it to the sound sensor borrowed from the Arduino kit.
In my Arduino code, I use a state machine structure to control the spider’s motions. There are four modes – “waiting”, “down”, “waiting2” and “up” which are correspond to the complete cycle of spider waiting for some noise, climb down when it hears something, stay at the bottom to observe and climb back to the top. It is very playful that when the spider hears some noise. Also, there some small challenge in the development process, e.g. I have to sample analog input from the microphone 50 times and get it’s average to avoid instant peak, and I also find that I have to at yield twice inside for loop which allows
p5.js Interface for monitoring
I made a small p5.js sketch that shows the spider’s status. When the spider climbs down to see what happened, it will show a rotating eye animation on the screen. After 5 seconds, if there are no additional sound, the spider will report it is safe then climb back to the top to keep monitoring.
Demo
If I have more time in the future, I want to make a spider that carries an ESP8266 and can remotely control by the computer and has some default state inside the micro controller. It’s a very playful experience for me to work on the prototype for such a long time and conquer the lazy and fear to improve the structure again and again.