This project was designed to visualize changes according to data for my schools Physical Computing Class. The theme of the project was "Cultivating Light, " and we were allowed to interpret what we thought that meant, with a mixture of data and sculpting. Lizbeth and I interpreted the project as the functions of the brain, and how the brain likes to work more when there is more sunlight outside. This data is measured based off the UltraViolet Light in Chicago.
The SculptingThe sculpt idea originally was to make a box that had education drawings on it, with the main piece of the project being a sculpting design of a tree trunk and a brain, and the brain would act as the leaves of the "tree." We also decided to add nature around the tree itself, to represent how the brain truly blooms when there is sunlight. Inside the trunk of the tree, we placed the stepper motor inside to follow our rubric, but also to show how the brain can affect nature. Credits to my partner Lizbeth for doing the sculpting aspect of the project.
UsingtheOpen-MeteoAPI
In the project, I used the Open-Meteo API that pulled data from national weather services around the globe. In order to be able to pull data, I created a webhook integration in the Particle IDE that would pull data using my API endpoint. To get an API endpoint for Open-Mateo, go to https://open-meteo.com/en/docs and you will be able to fully customize the type of endpoint you need based off what boxes you check off.
This is how the Particle IDE looked after successfully placing the API endpoint.
In order for the webhook to work, I had to extract data from the API, so I made the webhooks RequestType to GET rather than POST.
The API gave me a lot of uncessary data that I do not need.
The solution to this issue was that I needed to create a webhook response within the webhook settings that only extracted the values of the data that I did need, and filtered the rest out.
My webhook response was: {{daily.uv_index_max}}
The value that the response grabbed was only integers, and based off my data, the values of the data from the webhook, the project changes appearance.
This webhook runs every 30 minutes, so it actively changes just like the weather in Chicago.
The Stepper MotorFor my project, I used a 28BYJ-48 Stepper Motor with a ULN2003 driver board.
To set up my motor, I connected the IN1, IN2, IN3, and IN4 pins on my driver board to the D0, D1, D4, A0 pins connected to my Particle Photon. The D2 Pin was being occupied by my LED strip.
For my stepper motor, I decided not for it to react based off my data given by the API. Rather, I made it spin continously as soon as the photon turns on.
TheLEDs
For my LED lights, I used the Adafruit NeoPixel Digital RGB LED strips.
In order for the lights to connect to my photon, I stripped down three wires and soldered them to the copper on the strip itself. As mentioned earlier, I connected my LED strip to my D2 pin, allowing myself for a simple setup.
These were my variables for my LEDs:
#if (PLATFORM_ID == 32)
#define PIXEL_PIN SPI1
#else
#define PIXEL_PIN D2
#endif
#define PIXEL_COUNT 30
#define PIXEL_TYPE WS2812B
Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);3DPrinting
In order to make a stable and fitting enough stick for the flower that spins on the brain, I had to 3D print it out.
This is the 3D printed model
The sizing on the bottom was for it to exactly fit the stepper motor. Below are the dimensions of the stepper motor.
CodingBasedOffData
The LED lights change color based off data that is filtered from the webhook. This is how that looks in code.
void determineChange(float current) {
Serial.println(current);
if(current < 3) {
red = 0; green = 255; blue = 0; mils = 600;
} else if(current < 6) {
red = 148; green = 0; blue = 211; mils = 350;
} else if(current < 8) {
red = 255; green = 100; blue = 0; mils = 200;
} else {
red = 255; green = 0; blue = 0; mils = 100;
}
}For the color of green in the LED strip, the UV light in Chicago has to be under three. For purple, the UV has to be under six. Orange is displayed when the UV us over eight. Anything over eight, the LEDs will display red.
The mils value after the rgb values indicate how often the pattern of the LED is displayed. The pattern of the LEDs is of a heartbeat. The value just represents how fast that pattern in displayed.
The pattern in done with the following code:
static float brightness = 0.0;
static float step = 0.005;
brightness += step;
if(brightness >= 1.0) { brightness = 1.0; step = -step; }
if(brightness <= 0.0) { brightness = 0.0; step = -step; }
int rr = (int)(r * brightness);
int gg = (int)(g * brightness);
int bb = (int)(b * brightness);Final ProjectThe project was fully assembled in a 16x6x16 inch box. Before finalizing the project, I had to solder every electrical component into a protoboard. When I was done, I superglued the trunk down to the base of the cardboard, and cut a hole at the bottom for the wires of my stepper motor to fit. Since there was no solid surface inside the trunk, I hotglued a piece of cardboard inside to create a solid place for the motor to rest.
The wires originally were going to fit where the stepper motor was at, but I decided to cut a small hole in the back of the project where the protoboard was located and passed the LEDs through. To hide the hole, I hotglued the tissue paper that represented the grass around it.
To add more representation into the project, my partner and I made flowers out of sticky notes and hotglued them to the green tissue paper.
At the end, I soldered my power supply to the protoboard, allowing the photon to turn on when the plug is connected to an outlet.
Below is the video of the completed project.














Comments