https://github.com/maliakuo/m-m_city

Description

We built a city street in Legos using Arduino ESP32s, 2 stepper motors, and 2 servo motors. We created photoresistor responsive LED lights. At the press of the green button, the barrier (controlled by a servo motor) will open, the red stoplight will turn off, the green stoplight will turn on, and a servo motor will propel the car forward. The barrier will close behind it and the stoplight will turn red. At the press of the yellow button, everything resets. The barrier opens, and a pulley system attached to a stepper motor will pull the car back to the start position. The entire time, the LEDs are sensitive to light and a separate stepper motor constantly rotates to display a sign that welcomes you to M&M city.

Working with Motors

Working with motors was an enriching task. It’s nice because they’re pretty straightforward - but also, they’re somewhat annoying to work with for the same reason. If code doesn’t work, you kind of just have to manhandle it until it does. It was fun to think about the many different applications of motors, specifically using servo motors to propel the car forward and the use of a pulley system to bring the car back.

Working with Code

The way that we started working on coding the project made it easier to put it all together in the end. I believe Maggie started working on the stepper motor that brings the car back, while I focused on the servo motors that propelled and opened the barrier. When it came to final implementation, we knew that we had to combine all the motors on one program in Arduino, along with the controls for the button and LEDs for the stoplight. After all, everything is related. Thankfully, merging the code was pretty straightforward. Although, it did take some pseudocode to understand exactly how the logic proceeded through the program. Featured here:

IMG_6624.heic

Enclosure

We knew we wanted to work with Legos, because how could you not? The project started with building out a structure made of legos, with a base. Then, Maggie worked on creating the car that we would eventually move around the scene. Other elements included a white picket fence, grass-like blocks to hide the motors, and Lego flowers that cover the LEDs. The bulk of the wiring, breadboards, and ESP32s are hidden beneath the stage and surrounded by cardboard.

IMG_6625.heic

IMG_6627.heic

if you want to see something truly horrifying, here is the wiring behind and literally beneath it all.

IMG_7936.HEIC

Feature Richness

Two buttons control the system. When the green button is pressed by a user, the traffic light turns from red to green and the barrier is lifted by a servo motor. The car is then propelled forward by another servo motor until it stops at the end of the track. When the yellow reset button is pressed, the barrier lifts up again, and a tow truck (containing a stepper motor attached to thread) reels the car back to its start position.

The flowers and red “mushroom” poking through the white picket fence contain LED lights connected to a photo resistor sensor. The darker the room, the brighter the lights shine, functioning like street lamps.

The “Welcome to M&M City” sign sets the scene for our imagined high security yet charming town. The change in population between sides of the sign denotes the car entering and quickly being towed out.

Thoughts, Feelings, and Emotions