Introduction: Cylindrical Stainless Steel Medal Lamp
Here was a broken lamp I picked up in fleck yard that at first I really did not know what it was. It looked very nice & IT gave Maine the mind to turn this discontinuous lamp into a garnet-colored ornament lamp.
According to technical information on internet, this is a modern stainless steel outdoor wall unimportant which has 2 light fittings for directing light upwards and downward, suitable for lighting doorways and paths or to light features.
Take a deal some videos & pictures later on completion of fixing from rugged heavenward-down wall lighting to a colorful decoration lamp
- Cultivation Cartesian product PICTURES
- VIDEOS:
This decoration lamp is controlled with 3 modes: Color-wheel, Morph & HSBtoRGB by using 3 ways switch and potentiometer rotary pommel.
Information technology looks impressive when this lamp is put in the subdued.
Follow me on the next steps to see how I did for reviving this broken lamp...
Step 1: Ideas
Diameter of lamp's stainless sword body is about 60mm. My idea is to put 32 RGB leds into the cylindrical stainless steel casing at one side (upwards – 32 RGB LED; downwardly – 32 RGB LED). Of course these leds wish also be arranged in cylindrical shape – diameter 50mm, too.
In order to put leds in rounded form D50mm, I successful a flat wooden template with LED spatial arrangement 19.7mm. And after wholly leds were soldered, I bent them to a rounded material body of 50mm external diameter.
To calculate arc distance and number of LEDs, we can refer to table at a lower place:
Step 2: Circular of Materials
- TIP42C: https://www.digikey.com/product-detail/en/on-semic...
- 2N2222: https://www.amazon.in/2N2222-Transistor-Moldable-Pa...
- 74HC595: https://www.sparkfun.com/products/13699
- ULN2803: https://WWW.digikey.com/product-point/en/stmic
- RGB Led - Common Anode: https://www.virago.com/dp/B077XD5T8P/referee=sspa_dk_d...
- Arduino Uno/ Nano: https://store.arduino.cc/USA/arduino-uno-rev3
Beside main components, we pauperization to buy some more parts like: power adaptor 5V - 2A, electrical condenser 0.1uF (x4), computer ribbon cable ( LINK ), great power wires, small bolts & nuts, A4 I clad Cu home base, Ferric Chloride for etching....
Tools : wooden plate, gloves, round rod D3mm, ruler, soldering iron...
Footstep 3: Project Schematic
In that respect are 2 options to a lower place to control RGB LEDs using Bit Weight Modulation:
- Option 1 : Layers are selected from pitch register 74HC595 to control transistor 2N2222 & TIP42C. It save Arduino pins just response time is Low. IT doesn't matter in my eccentric when I just used transistors (non MOSFET).
- Option 2: Layers are directly controlled from Arduino pins. We ill-used 8 pins for layer selection, summation 4 pins for shift register controlling and no digital pins remain for else covering.
For high gear resolution schematic, you can down load PDF version at Connec.
Step 4: Eagle Design
To put all the printed circuit boards, medal cables, power cables and cylindric LEDs deep down the tube lamp, I had to innovation all written circuit boards in encircle shape and drilled some holes for wires passing through. Due to big amount of palm cables, during the actual assembly I have to drill and cut in some Sir Thomas More positions.
I also marked two circles outside PCB for later cut them in circle form. You can see this tip on adjacent step.
- Shift Register Board : It includes 2 x 74HC595, 2 x ULN2803, 16 x R100. For this project, we motive 2 shift register boards for layer selecting and RGB LED - BAM color controlling.
-
Layer board : It includes 4 x NPN-Junction transistor 2N2222, 4 x PNP-Transistor TIP42C, 8 x R1K, 4 x R10K. For this project, we besides deman 2 layers boards, these boards receive control signal from shift register boards to check which layer to be chosen (total 8 layers).
-
Total mark out : It fit to A4 sized to print out and save paper.
You can download printable PCB Eagle files with real size atUnite.
Step 5: PCB Etching – Drilling – Components Installation
- Clothes Iron Toner Channel
- Etching PCB aside Ferric Chloride
- Cutting PCB in circular shape
TIP : To cut PCB in barrel-shaped shape by hand, I trained some holes between two circles as marked connected the written electrical circuit board. It's really potent for fine print circuits.
- Drilling, fabrication and soldering components: Due to small size, I have to change 2 x Capacitor 0.1uF to bottom size.
Dance step 6: Cylindrical LED Bonding
- Prepare led
Leds are RGB common anode typewrite. I use a unblemished steel surround rod with a diameter about 3mm to bend the LED pins.
- RGB oarlock soldering :
Tumble : Baseball swing the gloves and wear only the middle finger. It will help you not getting new during soldering and non puzzle out mortgaged as you assume the entire gloves.
- LED pins isolated by ruler .
- Finish RGB pins
- Deflection & soldering common anode pin
Continue to use stainless steel round perch above to bend the communal anode pins.
- Clos RGB pins and common anode thole :
- Led testing
Let keep all LEDs in wooden template, we will easily fix if there was any LED damaged.
It looks good to me!
- Bending led into cylindrical form.
Crooked the LEDs lento until they form cylindric LED. Delinquent to putting inside stainless consistency, I give to Bend LED pins towards outside and Light-emitting diode bulbs towards center of cylindrical lamp.
- Rounded LED finish and ready to personify put inside lamp stainless steel body
Step 7: Connection All PCB Boards to Arduino & Cylindric RGB LED
I took meter and effort to do this shape. Note : I used ribbon cables to connect all unneurotic in that case because this overseas telegram is inferior, steady and flexible. I also drilled some more holes on the PCB and then that I could thread complete ribbon cable through the holes
- Cylindrical RGB LED connecting to Bed & Shift File Board
- Prepare stainless nerve casting dead body
- Final forum
Finally, I put together everything in stainless body as pictures. I too added one 3 ways permutation to change lamp's mode and same potentiometer to aline lamp's color.
TIP : For electrical isolation between PCB (or rounded LED) and unstained body, I in use a clear shaping PVC sheet - playscript hide
Step 8: Programming
#include <SPI.h> #delineate latch_pin 2 #define blank_pin 4 #define data_pin 11 #define clock_pin 13 #define SWITCH_A 6 #define SWITCH_B 7 #define POTPIN 0 #define COLORWHEEL 0 #define MORPH 1 #define HSBTORGB 2 #define LIMIT_BAND 15 // Switch & potentiometer variables byte Switch_State = 0; // to store switch reading 0 = COLORWHEEL, 1 = MORPH, 2 = HSBTORGB int Sens; int OLD_POT; //*************************************************ColorWheel******************************************// #define myPI 3.14159265358979323846 #define myDPI 1.2732395 #define myDPI2 0.40528473 #specify COLOUR_WHEEL_LENGTH 256 uint8_t colourR[COLOUR_WHEEL_LENGTH]; uint8_t colourG[COLOUR_WHEEL_LENGTH]; uint8_t colourB[COLOUR_WHEEL_LENGTH]; int16_t ColPos = 0; uint16_t colourPos; uint8_t R, G, B; //************************************************************************************************************// byte anode[8];//byte to write to the anode shift read, 8 of them, variable the Along level in each byte in the set out byte red[4][8]; byte blue[4][8]; byte fleeceable[4][8]; #define BAM_RESOLUTION 4 const byte Size_X = 8; const byte Size_Y = 8; int level=0; int anodelevel=0; int BAM_Bit, BAM_Counter=0; void setup(){ SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE0); SPI.setClockDivider(SPI_CLOCK_DIV2); noInterrupts(); TCCR1A = B00000000; TCCR1B = B00001011; TIMSK1 = B00000010; OCR1A=5; // Best prize in my case, without camera flicker anode[0]=B00000001; anode[1]=B00000010; anode[2]=B00000100; anode[3]=B00001000; anode[4]=B00010000; anode[5]=B00100000; anode[6]=B01000000; anode[7]=B10000000; pinMode (latch_pin, OUTPUT); //pinMode (3, Production); pinMode(data_pin, OUTPUT); pinMode(clock_pin, OUTPUT); pinMode(SWITCH_A, INPUT); pinMode(SWITCH_B, INPUT); SPI.begin(); interrupts(); fill_colour_wheel(); } void curl() { POT = map(analogRead(POTPIN), 0, 1023, 0, 255); // Read the swop and put the result is Switch_State if (digitalRead(SWITCH_A) == HIGH) Switch_State = MORPH; else if (digitalRead(SWITCH_B) == HIGH) Switch_State = HSBTORGB; else Switch_State = COLORWHEEL; switch(Switch_State){ case 0: if (POT < (OLD_POT * 0.95) || Mass > (OLD_POT * 1.05)) { OLD_POT = POT; // save the changed value fillTable_colorwheelRGB(Pile, R, G, B); } interrupt; case 1: if (abs(POT - OLD_POT) > LIMIT_BAND) { OLD_POT = POT; // save the changed value get_colour(POT, &R, &G, &adenylic acid;B); fillTable(R, G, B); } wear; case 2: if (acrylonitrile-butadiene-styrene(POT - OLD_POT) > LIMIT_BAND) { OLD_POT = Kitty; // save the changed respect fillTable_HSBToRGB(map(POT, 0, 255, 0, 7), R, G, B); } wear away; } } void Light-emitting diode(int Y, int X, int R, int G, int B) { Y = tighten up(Y, 0, Size_Y - 1); X = constrain(X, 0, Size_X - 1); R = constrain(R, 0, (1 << BAM_RESOLUTION) - 1); G = constrain(G, 0, (1 << BAM_RESOLUTION) - 1); B = constrain(B, 0, (1 << BAM_RESOLUTION) - 1); for (byte BAM = 0; BAM < BAM_RESOLUTION; BAM++) { //*** RED *** bitWrite(red[BAM][Y], X, bitRead(R, BAM)); //*** GREEN *** bitWrite(unaged[BAM][Y], X, bitRead(G, Blast)); //*** BLUE *** bitWrite(naughty[BAM][Y], X, bitRead(B, Bang)); } } ISR(TIMER1_COMPA_vect) { PORTD |= 1<<blank_pin; if(BAM_Counter==8) BAM_Bit++; else if(BAM_Counter==24) BAM_Bit++; else if(BAM_Counter==56) BAM_Bit++; BAM_Counter++; switch (BAM_Bit) { case 0: //Reddened SPI.transference(red[0][level]); //Green SPI.transfer(green[0][level]); //Blue SPI.transfer(blue[0][raze]); get around; case 1: //Red SPI.transfer(red[1][level]); //Green SPI.transfer(green[1][horizontal]); //Dispirited SPI.channelis(blue[1][level]); break; case 2: //Red SPI.transfer(red[2][even out]); //Green SPI.shift(green[2][level]); //Amytal SPI.transfer(blue[2][level]); break; vitrine 3: //Ruby SPI.transfer(red[3][level]); //Green SPI.transfer(sick[3][level]); //Blue SPI.transfer(blue[3][level]); if(BAM_Counter==120) { BAM_Counter=0; BAM_Bit=0; } break; } SPI.transfer(anode[anodelevel]);//finally, send back the anode level byte PORTD &= ~(1<<latch_pin); PORTD |= 1<<latch_pin; //delayMicroseconds(3); PORTD &= ~(1<<blank_pin);//Lacuna pin LOW to turn on the LEDs with the new data //delayMicroseconds(3); anodelevel++; level++; if(anodelevel==8) anodelevel=0; if(level==8) unwavering=0; pinMode(blank_pin, OUTPUT); } void clearfast () { for (unsigned char j=0; j<8; j++) { Marxist[0][j] = 0; red[1][j] = 0; red[2][j] = 0; blood-red[3][j] = 0; green[0][j] = 0; green[1][j] = 0; green[2][j] = 0; green[3][j] = 0; blue[0][j] = 0; blue[1][j] = 0; chromatic[2][j] = 0; blue[3][j] = 0; } } void fillTable(byte R, byte G, byte B) { for (byte x=0; x<8; x++) { // scan thru all column for (byte y=0; y<8; y++) { // scan thru all panel LED(y, x, R, G, B); } } } void fillTable_colorwheelRGB(int potentio, byte R, byte G, byte B){ // This function fills the cube with a colour for (byte x=0; x<8; x++) { for (byte y=0; y<8; y++) { get_colour(potentio + 24*x , &R, &G, &B); // 24*x - Best in my type Light-emitting diode(y, x, R, G, B); } } } void fillTable_HSBToRGB(byte chromaticity, uint8_t R, uint8_t G, uint8_t B) { byte inSaturation, inBrightness; inSaturation = rand()%15+8; inBrightness = Witwatersrand()%15+8; for (byte x = 0 ; x < 8 ; x++) { for (byte y = 0 ; y < 8 ; y++) { HSBToRGB(imbue + y + x, inSaturation, inBrightness, &R, &G, &B); LED(y, x, R, G, B); } } } ///////////////////////////////////////////////////////////////////////////////// //FAST SINE APPROX float mySin(float x){ plasterer's float sinr = 0; uint8_t g = 0; patc(x > myPI){ x -= 2*myPI; g = 1; } while(!g&(x < -myPI)){ x += 2*myPI; } sinr = myDPI*x - myDPI2*x*myAbs(x); sinr = 0.225*(sinr*myAbs(sinr)-sinr)+sinr; counte sinr; } //FAST COSINE APPROX float myCos(float x){ return mySin(x+myPI/2); } float myTan(plasterer's float x){ coming back mySin(x)/myCos(x); } //SQUARE Theme APPROX be adrift mySqrt(float in){ int16_t d = 0; int16_t in_ = in; float result = 2; for(d = 0; in_ > 0; in_ >>= 1){ d++; } for(int16_t i = 0; i < d/2; i++){ result = resultant*2; } for(int16_t i = 0; i < 3; i++){ result = 0.5*(in/ensue + result); } yield result; } //MAP Numbers game TO NEW RANGE float myMap(ice-cream float in, float inMin, float inMax, float outMin, float outMax){ float unfashionable; out = (in-inMin)/(inMax-inMin)*(outMax-outMin) + outMin; return out; } //ROUND A NUMBER int16_t myRound(be adrift in){ int8_t s = in/myAbs(in); return (int16_t)(s*(myAbs(in) + 0.5)); } //ABSOLUTE VALUE ice-cream soda myAbs(float in){ return (in)>0?(in):-(in); } void fill_colour_wheel(nothingness) { float red, green, blue; drift c, s; int32_t phase = 0; int16_t I = 0; while (phase < COLOUR_WHEEL_LENGTH) { s = (1 << BAM_RESOLUTION)*mySin(myPI*(3 * phase - I*COLOUR_WHEEL_LENGTH) / (2 * COLOUR_WHEEL_LENGTH)); c = (1 << BAM_RESOLUTION)*myCos(myPI*(3 * phase - I*COLOUR_WHEEL_LENGTH) / (2 * COLOUR_WHEEL_LENGTH)); red = (I == 0 ? 1 : 0)*s + (I == 1 ? 1 : 0)*c; naive = (I == 1 ? 1 : 0)*s + (I == 2 ? 1 : 0)*c; blue = (I == 2 ? 1 : 0)*s + (I == 0 ? 1 : 0)*c; colourR[phase] = blood-red; colourG[phase angle] = green; colourB[form] = blue; if (++form >= (1 + I)*COLOUR_WHEEL_LENGTH / 3) I++; } } annul get_colour(int16_t p, uint8_t *R, uint8_t *G, uint8_t *B) { if (p >= COLOUR_WHEEL_LENGTH) p -= COLOUR_WHEEL_LENGTH; *R = colourR[p]; *G = colourG[p]; *B = colourB[p]; } evacuate get_next_colour(uint8_t *R, uint8_t *G, uint8_t *B) { if (++ColPos >= COLOUR_WHEEL_LENGTH) ColPos -= COLOUR_WHEEL_LENGTH; *R = colourR[ColPos]; *G = colourG[ColPos]; *B = colourB[ColPos]; } void increment_colour_pos(uint8_t i) { colourPos += i; while (colourPos >= COLOUR_WHEEL_LENGTH) { colourPos -= COLOUR_WHEEL_LENGTH; } } ///////////////////////////////////////// void HSBToRGB( unsigned int inHue, unsigned int inSaturation, unsigned int inBrightness, uint8_t *RED, uint8_t *GREEN, uint8_t *BLUE ) { if( inSaturation == 0 ) { // achromatic (grey) *RED = *GREEN = *Blue angel = inBrightness; } else { unsigned int scaledHue = (inHue * 6); unsigned int sphere = scaledHue >> BAM_RESOLUTION; // sphere 0 to 5 or so the color wheel unsigned int offsetInSector = scaledHue - (sector << BAM_RESOLUTION); // position inside the sector unsigned int p = (inBrightness * ( ((1 << BAM_RESOLUTION) - 1) - inSaturation )) >> BAM_RESOLUTION; unsigned int q = (inBrightness * ( ((1 << BAM_RESOLUTION) - 1) - ((inSaturation * offsetInSector) >> BAM_RESOLUTION) )) >> BAM_RESOLUTION; unsigned int t = (inBrightness * ( ((1 << BAM_RESOLUTION) - 1) - ((inSaturation * ( ((1 << BAM_RESOLUTION) - 1) - offsetInSector )) >> BAM_RESOLUTION) )) >> BAM_RESOLUTION; switch( sphere ) { case 0: *Chromatic = inBrightness; *Greenness = t; *BLUE = p; break; case 1: *RED = q; *Dark-green = inBrightness; *BLUE = p; break; cause 2: *RED = p; *GREEN = inBrightness; *BLUE = t; break; case 3: *RED = p; *GREEN = q; *BLUE = inBrightness; break; case 4: *RED = t; *GREEN = p; *BLUE = inBrightness; break; default: *RED = inBrightness; *GREEN = p; *BLUE = q; develop; } } }
Stair 9: Front Functional Examination Earlier Final examination Fabrication
Before putt all PCBs and LEDs into stainless steel casting body, I have to perform some functional tests to avoid mistakes.
- COLORWHEEL TEST
- HSBTORGB TEST
- MORPH Tryout
You can see my testing along this video:
It look for very polite, right !!!
Step 10: Indorse Testing After Putting All Parts Inside Stainless Body
Step 11: FINISH PROJECT
DONE !!! Now, I can adjust this colorful lamp by using 3 ways switch and potentiometer rotary knob
- COLORWHEEL: Lamp's color is adjusted by rotating the knob reported to the color-bicycle rule.
- MORPH: Lamp's vividness is transformed (256 colors) using the rotary knob..
- HSBTOGRB: siamese to color-wheel supra, but lamp's color is assorted by the parameters hue, saturation, brightness through rotary knob.
Glucinium the First to Share
Recommendations
a cylindrical specimen of stainless steel having a diameter
Source: https://www.instructables.com/Cylindrical-Stainless-Steel-Decoration-Lamp/
Posting Komentar