ITTT - 1,5 Meter-o-Matic - Konrad Magiera
by konniedraws in Craft > Art
183 Views, 1 Favorites, 0 Comments
ITTT - 1,5 Meter-o-Matic - Konrad Magiera
HKU Assignment
Hello there !
Welcome to my HKU If This Then That Project.
For this assignment I created a machine that measures if you are social distancing well. The 1,5 Meter-o-Matic will give you visual and audio warnings if you stand within the 1,5 meter social distancing rule.
Supplies
Materials :
- 1x Arduino Uno R3
- 1x Ultrasonic Sensor
- 1x Speaker
- 1x NeoPixel RBG Ring
- 9x Jumper Cables
- 2x 220 Ohm Resistors
- Perspex
Tools :
- Weld Machine
- Hot Glue Gun
Brainstorming
At the start of this project I really and with that, I mean REALLY struggled to get a nice concept for what I wanted to do as it was my first experience with this medium. It took me a long time to find a concept I was comfortable with and that was possible to make. I knew I wanted my concept to be useful in life, especially in the current state of things in the world.
Final Idea
As my concept, I've chosen a machine that will tell you if you are socially distancing. My machine will measure if you are standing within a 1,5-meter range in front of it. If you stand outside of the range the lights will be green and no sound will be made. If you are within the 150-100cm range it will change to yellow and make slow beeping sounds. If you are within the 100-50 cm range it will change to orange and beep much quicker, and if you get past that range the light will be red and the sound will be really loud to tell you that ur too close. The design will be a white column made out of white perspex to make the lights light up the whole column.
Coding Everything
#include <FastLED.h> FASTLED_USING_NAMESPACE #define DATA_PIN 5 #define LED_TYPE WS2812 #define COLOR_ORDER GRB #define NUM_LEDS 24 CRGB leds[NUM_LEDS]; #define BRIGHTNESS 96 #define NOTE_C4 262 #define NOTE_C5 523 #define NOTE_C6 1047 #define END -1 int melody[] = { NOTE_C4, NOTE_C5, NOTE_C6, END }; // note durations: 8 = quarter note, 4 = 8th note, etc. int noteDurations[] = { //duration of the notes 12, 8, 4, 0 }; const int trigPin = 4; const int echoPin = 2; const int distance_threshold = 155; //cm int speed = 90; //higher value, slower notes float duration_us, distance_cm; void setup() { Serial.begin(9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); delay(3000); // 3 second delay for recovery FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip); FastLED.setBrightness(BRIGHTNESS); } void loop() { digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration_us = pulseIn(echoPin, HIGH); distance_cm = 0.017 * duration_us; if (distance_cm > distance_threshold) { ShowLight(95); int noteDuration = speed * noteDurations[3]; tone(3, melody[3], noteDuration); delay(noteDuration); noTone(3); } if (distance_cm > 100 && distance_cm <= distance_threshold) { ShowLight(60); int noteDuration = speed * noteDurations[0]; tone(3, melody[0], noteDuration); delay(noteDuration); noTone(3); } if (distance_cm > 50 && distance_cm <= 100) { ShowLight(22); int noteDuration = speed * noteDurations[1]; tone(3, melody[1], noteDuration); delay(noteDuration); noTone(3); } if (distance_cm <= 50) { ShowLight(0); int noteDuration = speed * noteDurations[2]; tone(3, melody[2], noteDuration); delay(noteDuration); noTone(3); } } void ShowLight(uint8_t hue) { for (int i = 0; i < NUM_LEDS - 1; i++) { leds[i] = CHSV(hue, 255, 255); } FastLED.show(); FastLED.delay(9); }
Downloads
Circuit Drawing
Here you can see how everything should be connected to the Arduino. For my final version, I had to extend one of the cables, but it is not necessary for it to work. I had to use two 220 Ohm resistors for the RGB ring to make sure everything was safe and wouldn't cause any problem. One was probably enough, but I wanted to make sure that safety came first!
Weld All Cables
I didn't know anything about welding before this, so I asked my dad to help me out and show his son how it's done. He helped me with understanding how it works and now I can become the next welding prodigy (absolutely not). My welding process was fairly easy as my circuit was not complicated at all.
Making Everything Pretty
When everything was coded, welded, and working it was time to make the column and arrange everything inside of it. The column is made out of 5 perspex walls and it has cutouts for the sensor, lights, and cable. Every component is glued onto the front wall and the cable can be plugged in from the side of the box. When the lights change in real life they light up almost the entire front panel which makes it look even cooler and direct.
Finalize the Machine and Stay Safe !
Here is the finalized project, I've taken off the back for the pictures to show off how it looks on the inside. I've tried to make the cables pretty well managed so that everything looks clear and not messy.
What I've Learned
I will be completely honest, I wasn't looking forward to this project and that's why I didn't make it before the first deadline. I was constantly overthinking if my ideas were good enough and basically gave up before I even started which didn't help me at all. In the end the further I got into the project and just had fun with it while doing my best to learn a lot.
I struggled with basically every step of the process, but with patience and determination, I got through those challenges and learned that making Arduino is kinda fun and enjoyable to make something mechanical yourself. I'm happy with my final product and I think it could be turned into an actual thing that's placed in public to help people with social distancing in this pandemic. I've learned so much about not only making Arduinos but to approaching things I might not know anything about with the same determined mindset that I use for making art. Just have fun and try to learn as much as you van!