This was created as a project for my Physical Computing Lab (PCL) class. The guidelines:
- It has to somehow be related to the theme "Cultivating Light"
- It has to have movement with a stepper motor or servo
- It has to have lights that respond to data pulled by you from the internet
This was a cross over between my PCL class and the Sculpting class. We were given a partner and we had to work together in our respective areas of expertise to make a single project. Zoeh (my partner) did a lot of great visual work which you will probably see in pictures, however in this documentation I will primarily focus on the electrical aspects of the project.
Our idea in full was to have 2 rotating rings of cars that rotated through a city, one with gas cars and one with EV cars. The cars would speed up or slow down in relation to the GM stock or the TSLA stock. A sun in the background would get less bright as GM stock increased, representing an increase in pollution. While the direct relationship between stock price and pollution output is flimsy at best, I'm going to tell you to use your imagination.
The Car RotationThe car rotation posed the biggest challenge for me. In the end you and I both are going to be thinking, "Wow that's really simple. Of course I'd think of that immediately." Well, I didn't. And I really went through the 5 stages of grief trying to come up with solutions before coming up with the seemingly simple problem. The problems:
- There are 2 counterrotating rings of cars that need to be lit from underneath
- There needs to be space in the middle of the rings where a stationary pillar can be
- The rings cant be very heavy because they have to be rotated by a stepper motor.
If you don't care about my problem solving process, skip here. If you want to struggle with me, keep reading.
Slip RingsSlip rings are components that allow stationary wires to be connected to wires that rotate in a circle. The only thing with these is that if you try to put something not rotating next to it, the wires will clothesline the supports as it rotates around. Think of it like this.
They do make slip rings with a hole in the middle, so that you can put stationary wires or supports through the middle. However, I would need 2 of these (because one slip ring can only rotate one direction, and two counter rotating car rings means two slip rings) which is not particularly cheap, nor are the holes any where near how wide id like them (130 ish cm diameter). So basically, I get to make my own slip ring!
My plan was to have the LED rings themselves rotate with the model cars merely sitting on top. Like this:
Instead of making them vertically stacked, I made a custom horizontally oriented slip ring. How it was going to work was there would be rings of copper wire that was in constant contact with a brush from the LED light rings. As the stepper motors rotated the rings, the wires would drag along the copper wires and provide current to all components. The copper is connected to the Photon. See the picture below, it should make more sense.
However, the contact between the LED wires and the copper wires was not strong enough and the LEDs didn't turn on. There was also too much stringing in the 3D print and the LED wires ended up getting stuck and jumping. The whole thing was good in theory, but in practice it was a disaster. Its important to not that this concept took about 3 weeks to design and execute (way too long).
Why deal with all the mess of rotating wires when I could just rotate the cars alone without the lights? I don't need the lights to move for the light to hit the cars, just the cars have to move. So in all, I just re-modeled my design, printed out rings for the cars to rotate on with, and glued the rings to the bottom. Much simpler, and much more reliable.
The ring lights under the cars were already discussed quite well. The lights in the buildings are simply little strips of 4 NeoPixel strips that are all soldered together to work off the same pins. The buildings are hollow, and the lights simply under light them. The other buildings are lit the same way, but with one continuous strip that is kinda crammed in there.
The sun is just a normal LED Diode that is controlled by a PWM pin to change brightness with stock price.
Its important to realize that the car ring lights, the tall building lights, and the small building lights never change and are always at 100% brightness with the color white. Therefore, there was a lot of sketchy soldering to just solder all the power, ground, and signal pins down to 1 wire, allowing me to control hundreds of lights in parallel with just one pin. This simplified the breadboard itself much, however its important to wrap the joints with electrical tape to stop unexpected short circuits.
Originally, I was going to use an L298N Motor Controller to control both the rings of cars. However, the motors themselves required too much hight and didn't have enough torque to spin the ring (which is crazy because theres not that much inertia or friction). After wasting a lot of time on this, I pivoted to using two 28BYJ-48 Stepper Motors and ULN2003 Driver SY2526s.
The motors are simple stepper motors controlled with the AccelStepper class allowing the speeds to be individually controlled. They interact with the cars through a simple rotary gear system which is lowered a little bit below the artificial floor. They are hidden from sight, but one is on the inside of the circle for the inner cars and one is on the outside.
PowerOne problem I had to unexpectedly face was the lack of power. I was using a 5V/1A power supply originally, however this was not enough to power the large amounts of lights and the motors and the Photon at the same time. Whenever the Photon would connect to the internet, it would have a current spike and push the power supply over 1A, causing everything to restart in a permanent boot loop. This scared me initially because lack of power was an option but definitely not the only option. Luckily, switch to a 5V/5A fixed it and no change was needed.
**Make sure to up the resistor for the LED diode though or you'll blow it
The Cars ThemselvesThe cars were simply made using free Tesla models and pickup truck models off the internet. I added some holes, 3D printed them, then we painted them. They are hollow and should have little holes in the front and back to act as head lights, however due to size and printer stringing, these holes dont really work how they're supposed to.
Overall, the components were pretty simple to use, but the manor and quantity of these components presented a fun set of challenges to overcome on a quite strict timeline. The code is pretty self explanatory, but if enough people want me to explain it I can go into detail. There's some final media below, and make sure to let me know if you have any questions! Thanks for reading!


















Comments