You guys know Nanoleaf right?
So I made this Nanoleaf like device that doesn't have RGB LEDs inside, instead, it has white Light and is controlled by a touch switch.
It's a fancy lighting setup that can illuminate your room and it looks pretty sick because of its shape.
Also, it's not related to Illuminati at all, or the phoenix lights incident or pyramids.
I made few modifications to the touch switch which made it more sensitive so this light can be turned ON or OFF in mid-air.
Just bring your hand closer to the center part of the triangle and that will trigger the Light Sequence, by the way, this method of turning this light on-off by punches, I call this LightFu.
- on the first tap, it will start flashing
- on the second tap, it will glow at full capacity
- on the third tap, LED will glow at 50% capacity
- the fourth tap will turn off the light.
I first designed this light setup in Fusion360, then by using the fusion PCB Layout, I prepared its PCB in my OrCAD software, then I got PCBs for this project from PCBWAY.
I assembled the PCB and then the whole light which took almost two days of hellish work but yeah, that was pretty much it.
Also, this whole setup is powered by the might Attiny13 MCU.
This project is pretty long and I'm gonna explain the whole build process of this light so sit back and try to enjoy the ride.
Material RequiredThese are all the materials I used in this project
- Custom PCBs x 4 (which were provided by PCBWAY)
- Attiny13A SOIC8
- 8205S Mosfet IC
- LEDs JK3030 Cree LEDs 0.5W x 90pc
- 1.5 Ohms 2W Resistors
- IN5399 Diode
- 3D Printed Enclosure Base x 4
- LID- Diffuser x 3
- LID- Cover x 1
- Spacers x 3
- M3 Bolts x 3
- M3 Nuts x 3
- Truss Head screw 2.4mm x 12
- TTP223 TouchPad Module
- Header Pins
- Arduino Nano (for Flashing the Attiny13)
The basic idea here was to model a triangular-shaped light that can be Replicate easily with a 3D Printer, a custom PCB, and few components.
White Light can be replaced with a similar RGB LED-based PCB so that is another feature of this setup, it's versatile and can be changed or arrange in all kinds of shapes as we can arrange triangles in different shapes like these.
First I prepared a Triangular Shaped Box or an enclosure that has a lid on it.
This Lid will be printed from transparent PLA and the body itself will be made from Black PLA.
Inside this Triangular body, I have added this circuit is slightly smaller than the inner walls of the body.
To Make a single collective light from this triangular shape, I just copied this whole body three times and then arrange it in such a way that each Triangular body will be on each side of the central body.
To connect all three bodies with the central part, I added few custom 3D Printed spacers that will be used as spacers between two bodies when they are connected with nuts and bolts.
In a nutshell, we only need one design which is the Triangular Body (Base + LID), and we can create a bunch of other triangular shapes by connecting them together with bushes nuts, and bolts.
PCB DesignAfter preparing the body of the whole structure, I used the measurements from the cad drawing of PCB and prepared a basic outline for the PCB in my PCB Designing suite.
but before making the PCB, we first have to make a schematic that will contain all the important stuff in it.
SCHEMATIC and function with parts detailsSo here's the Schematic of this project.
This schematic is a simple one to understand, there's a total of 30 LEDs connected in parallel, they are all driven by this Mosfet as a switch setup which is then connected with the attiny MCU.
okay wait, here's an interesting question, why didn't I used an Arduino board in this project, why attiny?
the answer here is the cost and overkills-ness of the Arduino board.
(Attiny13 costs around 0.5$ and Arduino Board (clone) costs around 5$)
In this project I only used one digital pin and one analog pin so why would I choose a device that has 13 Digital pins and 5 analog pins that would not get utilized at all.
Also, I required a smaller form factor MCU and attiny just matches my requirements.
Attiny has ICSP breakout pins for programming on one side and on the other side, there's a connector pin for the touchpad module.
Basically, Attiny will control the gate of mosfet and the LEDs will be turned ON or OFF accordingly.
After finalizing the schematic, I then prepared the board layout which was also not very complex.
I will be using the FR4 board for this project, Aluminum PCB was also an option but it's hard to prepare a setup like this on a single-sided board so I'm gonna go with the FR4 version.
For heat dispersion, I added wider copper tracks that will disperse heat a little bit better. Also, I will be using a 5V 2A charger to power this setup so it won't get hot enough as this setup contains white LEDs that each draws 0.5W of power and they are all in parallel so around 90 LEDs x 0.5W = 45W.
45W will heat quite a lot so one option to limit the power and heat of this setup is to use a less power charger (5V 2A = 10W).
By providing less power to the setup, we can limit the power and heat.
Getting PCBs from PCBWAYAfter finishing the design, I exported its Gerber data and send it to PCBWay for samples.
I received PCBs in a week and the overall quality of the PCBs was just awesome.
As for the solder mask color, I ordered these in green solder mask color.
I've been using the PCBWAY service for a long time now and they are just great.
Really love the overall quality of the PCBs.
Check out PCBWAY for getting great PCB Service at less cost!
Next is the assembly process.
Assembly ProcessThe Assembly process of this PCB includes FOUR major things, which are
- solder paste dispensing
- pick & place process
- Hotplate reflow
- and adding THT components.
#1SOLDER PASTE
First, we place solder paste on each components pad.
I'm using this solder paste that I bought a few days ago, along with the solder paste dispensing syringe.
#2PICK & PLACE
After solder pastes dispensing, we add components to their assigned place one by one, In this case, 30 LEDs. I have to make a total of 3 LED boards and one Control board.
The process of making this control board is the same, I added solder paste to the solder pads of PCB and then added components to their right place.
#3HOTPLATE
After adding components to their location, we carefully lift the PCB and put it on an SMT hotplate.
I'm using my DIY SMT Hotplate, learn more about it from here-
https://www.hackster.io/Arnov_Sharma_makes/diy-smt-hotplate-project-8157a5
Hotplate heats the PCB from below up to the solder paste melting temp, as soon as the PCB reaches that temp, solder paste melts and all the components get soldered to their pads.
we lift the PCB and then place it on a cooler surface for a little bit, to cool down the heat of PCB.
Then we just redo this whole process for the remaining LED board and controller board.
#4THT COMPONENTS
After the Hotplate reflow of the three led boards and one controller board, we have to add the remaining components to the PCBs which include resistors, header pins, and the touchpad module.
After adding the THT components, our soldering work here is done.
Partially done.
I still have to test all the boards so for doing that, I have to add the main sketch to the Attiny13 MCU.
CODE AND PRE-TESTINGint switchPin = 4; //4
int led1Pin = 0; //0
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
int val;
int val2;
int buttonState;
int Mode ; //= 0;
void setup()
{
pinMode(switchPin, INPUT_PULLUP);
pinMode(led1Pin, OUTPUT);
buttonState = digitalRead(switchPin);
}
void loop(){
val = digitalRead(switchPin); // read input value and store it in val
delay(10); // 10 milliseconds is a good amount of time
val2 = digitalRead(switchPin); // read the input again to check for bounces
if (val == val2) { // make sure we got 2 consistant readings!
if (val != buttonState) { // the button state has changed!
if (val == HIGH) { // check if the button is pressed
if (Mode == 0) {
Mode = 1;
} else {
if (Mode == 1) {
Mode = 2;
} else {
if (Mode == 2) {
Mode = 0;
}
}
}
}
}
buttonState = val; // save the new state in our variable
}
// Now do whatever the lightMode indicates
if (Mode == 0) { // FLIP FLOP
digitalWrite(led1Pin, LOW);
}
if (Mode == 1) {
analogWrite(led1Pin, brightness);
brightness = brightness + fadeAmount;
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
}
if (Mode == 2) {
digitalWrite(led1Pin, HIGH);
delay(50);
digitalWrite(led1Pin, LOW);
delay(50);
}
}
For flashing the attiny13, I'm using my good old Arduino as ISP setup which I prepared for flashing and burning bootloader of attiny MCUs.
check the whole thing from here for an extremely detailed version - https://www.hackster.io/Arnov_Sharma_makes/multiple-attiny85-13a-programmer-84adf8
In short, we first have to connect the Attiny with the Arduino as an ISP programmer according to this schematic.
- We connect the VCC of the Arduino as ISP to the VCC of Attiny,
- GND to GND
- Reset to pin D10 (of Arduino Nano)
- Mosi to pin D11 (of Arduino Nano)
- Miso to D12 (of Arduino Nano)
- and SCK to D13 (of Arduino Nano)
Oh also, you will need Attiny13 core files before this flashing process.
which you can download from here- https://github.com/MCUdude/MicroCore
- We first select the right MCU which is attiny13 in our case and do not forget to choose the right com port.
- then we select the right programmer which is in our case "Arduino as ISP"
- then we hit on the Burn Bootloader option which will take few seconds,
- Now we go to the sketch menu and select the "Upload using Programmer" Option and BANG.
you have successfully uploaded a sketch to this Attiny13 MCU.
Now we do the testing part of this project.I soldered one LED Triangle with a controller board and added a lithium cell of 3.7V with it.
Now we just touch the TTP223 module and our setup is working.
On the second press or touch, the setup is blinking and on the third tap, it's turned off.
- the first tap initiates the fade sequence,
- the second tap blinks the LEDs and the third tap turns everything off.
I later removed this blinking sequence and added a different function that lets us control the light intensity and then fade the board.
here's the final code.
int switchPin = 4; //4
int led1Pin = 0; //0
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
int val;
int val2;
int buttonState;
int Mode ; //= 0;
void setup()
{
pinMode(switchPin, INPUT_PULLUP);
pinMode(led1Pin, OUTPUT);
buttonState = digitalRead(switchPin);
}
void loop(){
val = digitalRead(switchPin); // read input value and store it in val
delay(10); // 10 milliseconds is a good amount of time
val2 = digitalRead(switchPin); // read the input again to check for bounces
if (val == val2) { // make sure we got 2 consistant readings!
if (val != buttonState) { // the button state has changed!
if (val == HIGH) { // check if the button is pressed
if (Mode == 0) {
Mode = 1;
} else {
if (Mode == 1) {
Mode = 2;
} else {
if (Mode == 2) {
Mode = 3;
} else {
if (Mode == 3) {
Mode = 0;
}
}
}
}
}
}
buttonState = val; // save the new state in our variable
}
// Now do whatever the lightMode indicates
if (Mode == 0) { // FLIP FLOP
digitalWrite(led1Pin, LOW);
}
if (Mode == 1) {
analogWrite(led1Pin, brightness);
brightness = brightness + fadeAmount;
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
}
if (Mode == 2) {
digitalWrite(led1Pin, HIGH);
delay(50);
}
if (Mode == 3) {
analogWrite(led1Pin, 100);
delay(50);
}
}
After making sure that everything is working fine, we move on to the next step which is to put the whole thing together.
FINAL ASSEMBLYFor the final assembly, I first added the PCB inside the Base triangle body with 3 M3 Truss head screws.
I prepared a total of 4 triangular bases, 3 LED boards, and 1 controller.
In the end, these are four semi-completed body each equipped with the PCB.
Now we have to put everything together.
Puttingtogether the triangular setup
And how to do that? well, we put the Controller Part in the middle and add the other three LED Bords to each side of the central triangle.
Between two bodies, we have to put this custom 3D Printed spacer with nuts and bolts.
I'm using M3 size here.
we have to do this process total 3 times and after that, we will get this huge triangular structure that almost resembles the Illuminati triangle but whatever,
It's pretty sturdy which was the goal here, to make it tough so it can sustain its weight as I will hang this setup on a wall and will leave it for a couple of years.
Next is the wiring.
WiringWiring of this setup goes something like this,
Attiny13 controls the Mosfet Setup right, so we have to connect the three Triangular PCBs in parallel together and then add it to the mosfet as a switch setup.
I used this wiring scheme to do all the connections.
Basically, 90 LEDs are all in parallel.
I made an error in the PCBThis setup will draw a lot of current if powered with a direct power supply so to limit the current, I added this janky Resistor and diode to drop the voltage a little bit so LEDs won't get shorted by overheating.
Now after this, I added this 0.3mm copper sheet onto the bottom side of the central lid with super glue.
The goal here is to cover the bottom side of the lid completely so the copper will cover the most area. after this, I added a wire between this copper sheet and the touchpad. The touchpad module didn't have an opening in the solder mask so I scratch the touchpad area and manually solder wire on it.
Final touches (adding Diffuser permanently onto the Triangular body)
At last, I permanently added the central Lid onto the body by using a little bit of hot glue, I know using hot glue is not a permanent solution but I'm pretty sure this will last for a long time.
I did this to the diffuser lid of all three remaining triangles as well.
This was the result!
It looks like a big shuriken, the one Sasuke had in naruto.
jokes aside, this project is now completed and the only thing left to do is the testing part. but before that, here's one last step or an instructional step or something.
PowerSource Details
Now, as I mentioned earlier, this setup has a makeshift voltage dropping resistance and diode added inside, which is totally temporary so I won't be powering this with a higher power supply, instead, I will use a generic 5V 2A Smartphone charger.
I used a 5.5mm DC Barrel jack in this project so I had to make a Barrel jack to USB cable to power this setup.
Here are few measurements I didCurrent Drawing in Fade Mode- 5V at 0.600A-1.24A
Current Drawing in HIGH Mode- 5V at 1.37A
Current Drawing in 50% Mode- 5V at 0.58A-0.64A
Current Drawing in OFF STATE- 0A
Final Result /LIGHTFu demonstrationHere's how this setup works, we take our hand close to the central triangular part and the light turns ON in its first mode. which is the fading sequence.
then we do this again and the light stops its fade sequence and stays in high mode.
after this, on the third tap or touch, light decreases to 50% Brightness, and at last on the fourth tap or touch, lights turn OFF.
This is how you can control this light.
Also, I devised a cool way to trigger this light, by punching.
Not punching the light but by bringing the punch or your palm near the light and then back it up and throw another punch, then repeat this sequence and you will have a nice punching or martial art training partner.
I named this technique LightFu, I know it's silly but this is a nice way to get into shape. just punch and light will provide you support by turning on and off.
well, that is it for today folks, leave a like or a comment if this light project was bright, and I'll be back with another project soon.
spoilers, it's another light setup!
also, huge thanks to PCBWAY for supporting this project, remember, if you need any PCB service, PCBWAY is the one who can deliver the good stuff.
Thanks again and bye-bye.
Comments