Introduction: Meditation/Breathing Practice Light
During the lockdown, many of us had felt the anxiety due to continuously staying indoors and it was that time I explored the meditation and breathing practices to calm down the anxiety.
Initially, it was difficult to focus on breathing which is pretty much necessary to do for certain meditations, and my mind used to divert in different thoughts.
While there were a few apps that also stimulate the breathing cycles but having smartphone nearby cause distractions so I made a device that can help me to practice the 4-7-8 breathing method which I want to share in this Instructable.
Step 1: Supplies
- Arduino Nano
- 2.5mm Pitch Female Headers
- Right Angled Male Header
- 330ohm & 1k ohm resistors
- BC547 NPN Transistor
- 8X Common Anode RGB LEDs (5mm)
- SPDT Slide Switch
- TTP223 Touch Switch
- 3V to 5V Boost Converter Module
- Lipo Battery
- TP4056 Lipo Charge/Protection Module
- A 5V Active buzzer (Optional)
A bulb diffusion cover of 48mm opening diameter(you can alternatively 3D print one)
Also, some 3D printed parts will be required.
Step 2: What Is 4-7-8 Breathing Cycle?
4-7-8 is a renowned and proven methodology to reduce anxiety and help in boosting concentration.
All you need to do is to sit down, relaxed in the correct posture, and perform cycles of inhaling - pausing - exhaling.
4 seconds of inhaling, 7 seconds of pausing with the inhaled air then release/exhaling slowly for 8 secs. With only 10-15 minutes of this practice, you will feel relaxed, calm and be able to better concentrate on the work ahead.
Another use case scenario for this practice is for falling asleep as it deeply relaxes the nerves and can help easily falling asleep.
The device which we are going to make will help in structuring the duration of 4,7,8 seconds with mesmerizing glowing and fading of RGB LEDs.
Step 3: Designing the Circuit
We are going to control 8 LEDs and each channel is roughly going to consume 10mA of current so for 8 LEDs it will be 80mA which our microcontroller's (Arduino Nano) GPIO can't handle directly so we will control the LEDs with a BJT (Bipolar Junction Transistor).
To get the user input I have chosen a touch sensor(TTP223) so the device has a clean look (as we are focusing minimizing the distractions).
To get a subtle identification of the touch button press we can add a buzzer(optional).
The whole circuitry will be powered by a 500mAh Lipo Battery so a charging and protection circuit(TP4056) is used and a switch to turn on and off the device. and as the RGB LEDs have a forward voltage drop of around 2.5V we need at least 3.5v Power Lines so we can't rely on lipo solely as it can vary from 4.2v to 2.8v so we have to include a DC-DC boost converter to convert lipo voltage to usable 5V.
Step 4: PCB
Now we have designed the circuit, it now time to create a PCB, and for that, I have used Eagle CAD.
As I have used a diffusion cover of an LED Bulb with a bottom diameter of 48mm, I had created a PCB of the circular dimension of 48mm to fir flush with it.
Then I have used the Fusion 360 Sync feature of Eagle CAD to build a casing around the PCB.
If you don't want to fabricate PCB yourself, then you can go for solutions like JLCPCB, PCBWay, NextPCB, etc., where you can upload the Gerber files (which you can get from this link), and you will get PCB a week or two.
If you are going this way, then skips the steps ahead to go directly to step number 8.
Step 5: Copper Clad Preparation
As we are going to make a circular PCB, First we will cut a circular piece of 48mm diameter from the copper clad.
To cut out a circular piece I had taken a rough print out of the design and drew the outline.
First I used Dremel to take a rectangular piece from the whole copper-clad, then I cut the corner pieces and used a Flat file to curve out the corners
You can also use a wire hand saw to directly cut out a circular piece.
We will be using the Toner Transfer method for PCB Manufacturing.
Step 6: Transfer the Trace to Clad
Take the printout of the designed PCB top layer, pads, vias, and drill positions on glossy paper. (it should not be mirrored) or just use the file provided below to take a print out
Place the circular piece of copper-clad on the print and align it on the print and stick it so the alignment doesn't change while you press both of them down using a clothing iron or hot plate from the paper side for at least 5 minutes.
Then soak it in lukewarm water for 10-15 minutes so the paper gets wet enough to peel off easily.
The peeling process is needed to be done carefully as some traces may peel off with the paper.
If some of the traces peel off then use a marker to redraw them.
Attachments
Step 7: PCB Etching & Drilling
Now that you have the traces transferred to the copper-clad, we can move forward for etching the PCB so only the copper under the traces remains on the clad, and rest of the copper gets etched away.
We will be using FeCl3 (Ferric Chloride) for the etching process.
It will take around 5-10 minutes for the etching process to complete. (it is recommended to agitate the etching solution during the process to speed it up).
Afte the etching is completely clean the PCB with acetone and drill the holes.
Note: use a 0.8mm drill bit for all the holes except the one for mounting the PCB on the cover, it is 2mm.
Step 8: Soldering the Components
Now we have a PCB and we can move forward to solder all the components at their respective place, take the reference from the design to find which component will go where, or see the images above to find the relative position of the component,
Just for reference, we have used Common Anode RGB LED and its notch is on the inner side of the PCB.
Step 9: 3D Print the Cover
As our circuit is complete, let's print the cover for our device, There are mainly 2 parts to be printed the Bottom Part and the Base Cover.
All the prints are done in 3 perimeters and 25% infill, some bridging is needed in the Bottom Part but most of the FDM 3D Printers can easily handle it.
But if you can't find the diffusion cover of the perfect size then you can also print the spherical diffusion ball to be used as a diffusion layer for the LEDs.
I have included all the 3 files and you can get the STEP file of the design from this link if you wish to tweak it.
Step 10: Assembly
This is the reference for how the assembly will proceed.
Step 11: Assemble the Base Cover & Touch Switch
Now let's assemble the parts together, take the base cover and stick the charging, protection of Lipo battery, and turn ON/OFF the circuit on the base cover as shown in the video/images above.
The TP4056 and ON/OFF slide switch will go in their respective slots(add just hot glue to secure them there), and as you may have a different battery so no slot for it, there is enough room on the base plate to stick the battery with the help of some double-sided tape.
Also, take the touch Switch TTP223 module and solder some wires its VCC, Output, GND pins, and female headers on the other side as can be seen in the image above.
Step 12: Prepare the Body
After preparing the base cover, take the bottom part and first insert the touch switch into the slot given with the help of some double-sided tape.
Then insert the prepared PCB from the top and tight 2mm screws on the 3 long flanges on the body.
Make sure the wires of the switch are coming up from the side of the PCB. Now you can insert the switch in the 3 pin header soldered in between the headers for Arduino nano and make sure the polarity of the connection is right.
Now you can insert the programmed Arduino Nano.
Step 13: Lets Program the Arduino
The Arduino program (.ino) file is given below and you can move straight to program the Arduino Nano.
Below I have discussed a bit about the code is completely optional.
This program used the timer of atmega328p (the microcontroller on Arduino nano/uno) for counting the time between the glowing, pausing, and glowing of the LEDs. The timer is configured in CTC Mode(Clear Timer on Compare) and it triggers an interrupt every 4ms which is counter for 4seconds then 7seconds and 8seconds.
The loop monitors the touch sensor with the help of external hardware interrupt on GPIO2 which in turn changes the mode from color setting and LED glowing and also to play/pause the LEDs.
The buzzing of the buzzer is also done in the main loop with the help of millis() function to determine how long will it buzz.
There is two types of inputs, a short press for play pause and a long press for changing the mode.
The program is commented enough to get the grasp of the code still if you have any query then do comment below.
Attachments
Step 14: Close the Cover
Now that we have programmed Arduino Nano, we can plug it into the circuit and close the cover.
The bulb diffusion cover will snap-fit to the bottom part. There are two pads on the circuit beside the pads for 5v Boost convert to connect the power lines from the battery circuit that we stick onto the base cover.
Before closing it up, check it once by turning on the slide switch.
After that, we can close the bottom cover with 2mm screws from the bottom.
Step 15: Working of the Device
As you turn on the device, you will see the glowing and fading of the last chosen color according to the 4-7-8 timing rule.
To change the color, you need to long-press on the touch sensor (if you struggle to find the touch sensor on the body, it is just opposite the charging port). For the long-press, it will automatically beep.
For pausing on any color, whether in color choosing mode or the normal glow/fade mode, just a single tap on the sensor.
As soon as you choose a color from the color choosing mode, it gets saved in the memory so that you can enjoy it after restarting the device
Step 16: Now Enjoy a Peaceful Breathing Session
It time to sit back relax and enjoy rejuvenating breathing sessions with your own little meditation lights.
Also, you can use it as a mini mood lamp on the study table.
If you face any difficulties in replicating the project do comment below, I would love to help you out.

Second Prize in the
Self-Care Challenge
23 Comments
Question 1 year ago on Step 16
Thank you for sharing this project.
I was interested and decided to replicate it. It will be my first job involving electronic components outside the protoboard.
Unfortunately, I couldn't get it to work.
I just managed to activate the buzzer… Short and long….
At the booster's output, I read 5.24V, and at the bases of the diodes only 0.7V.
Any tips for trying to get it to work?
Answer 1 year ago
Please explain the problem you are facing in detail so I can help you out.
Reply 1 year ago
Good evening Anil,
First, I appreciate the availability of time and help. And even your availability for personal contact, but being in Portugal, there may be some difficulty in terms of schedules.
Second, let me say that although I am 68 years old, I am new to electronics because just a few months ago, I began to interest and learn, essentially with the support of viewing online classes and following projects like this one that shared. With this late hobby, I managed to make the long days of confinement very fast and with some satisfaction.
I have a degree in Mechanical Engineering, but I always dedicated myself to management functions as soon as I finished the course. The engineering practice was falling behind, even the mechanics and much more the concepts of electronics I had.
As I said, I found the project exciting and decided to replicate it. I started by using a perforated circuit board, but I didn't get a result thinking I would have made some welding errors.
So I decided to order a PCB card using the Gerber files you published, and when I received them, I did the assembly of the components, ensuring that the weldings, now more accessible, were without problems.
However, the assembly did not work, either. That's when I contacted him.
I decided, however, to make an assembly on a prototype board, simulating the circuit of the printed board, and returned to work.
Analyzed the circuit again, and with my lack of experience and knowledge, it seems to me that the problem is in the design of the circuit: the LEDs GND is connected to the VOUT of the booster when it should be connected to the adjacent GND right next to it. I think so. Am I right?
Doing this mount on the protoboard, I got some operation but still did not get the control indicated in your Instructable.
I mark the orange in the connection points mentioned and indicate or connect the power coming from the battery.
Again thanks for the time and availability.
Greetings.
Paulo Gagean
Reply 1 year ago
Dear Paulo Gagean,
I must say you have chosen a great hobby.
I think I understand the problem now and it should be a quick fix.
The circuit I have designed is for common Anode RGB LEDs( where the common pin is connected to VCC). That is why the Vout is connected to the common pin of the LED.
I suggest you try the common Anode LED and let me know if it worked.
Reply 1 year ago
Thanks,
I've ordered some Common Anode RGB LEDs, and I will use those. Beginners mistake...
Regards
Reply 1 year ago
Works Great.
Thanks, again.
1 year ago
Hi, sorry to bother you but i can´t open the file of the code, can you paste it on the comments please.
Reply 1 year ago
//RGB light V4
#include <EEPROM.h>
#include "math.h"
#define addR 0 //EEPROM Address for Red
#define addG 1 //EEPROM Address for Green
#define addB 2 //EEPROM Address for Blue
#define RED 3 //pin controlling the RED LED
#define GREEN 5 //pin controlling the GREEN LED
#define BLUE 6 //pin controlling the BLUE LED
#define buzzPin 13 //Pin controlling the buzzer
#define touchPin 2 //touch input pin
//restroring the last values of RGB from EEPROM
uint8_t valR=EEPROM.read(addR),valG=EEPROM.read(addG),valB=EEPROM.read(addB);
//function to set RGB from 0-360 input, similar to HSV to RGB
void setRGBvalues(int H){
H = H%360;
float X = 1-abs(fmod(H/60.0, 2)-1);
float r,g,b;
if(H >= 0 && H < 60){
r = 1,g = X,b = 0;
}
else if(H >= 60 && H < 120){
r = X,g = 1,b = 0;
}
else if(H >= 120 && H < 180){
r = 0,g = 1,b = X;
}
else if(H >= 180 && H < 240){
r = 0,g = X,b = 1;
}
else if(H >= 240 && H < 300){
r = X,g = 0,b = 1;
}
else{
r = 1,g = 0,b = X;
}
valR = r*255;
valG = g*255;
valB = b*255;
analogWrite(RED,valR);
analogWrite(GREEN,valG);
analogWrite(BLUE,valB);
}
//initatiang the timer1 of atmega328p for keeping the 4-7-8 sec timing
void timer1Init(){
TCCR1A = 0;
TCCR1B = 0; //stop existing Timer
TCNT1 = 0; // Clear timer count
TIFR1 = 255; // Clear pending interrupts
OCR1A = 250;
//setting the mode to CTC by WGM 3:0 = 0100
TCCR1A &= ~((1<<WGM11)|(1<<WGM10));
TCCR1B |= (1<<WGM12);
TCCR1B &= ~(1<<WGM13);
//setting the interrupt register
TIMSK1 |= (1<<OCIE1A);
//turing on the global interrups
sei();
//starting the timer1 by setting prescaller to 1024 i.e. CS1 (2:0) = 101
TCCR1B &= ~(1<<CS11);
TCCR1B |= (1<<CS12)|(1<<CS10);
}
volatile float cR=0.00, cG=0.00, cB=0.00;
volatile float fR = valR/250.0, fG = valG/250.0, fB = valB/250.0;
volatile long int touchTime=0, releaseTime=0; //will store the time when the button is touched & relesed
volatile boolean isPress=0; //will store wheather the touch button is pressed or not
volatile boolean play=1; //1 for playing 0 for pausing
volatile boolean mode=0; //1 for color setting mode, 0 for normal 4-7-8 mode
volatile int colorHSV = 0; //will store the HSV's Hue number to change the color for color setting mode
volatile uint16_t inPlayCounter= 0; //it is the counter which will tick inbetween 4-7-8
volatile uint8_t inPlayMode=0; //0 for 4s period, 1 for 7s perios & 2 for 8s period
//this interrupt will handle the contions for color setting mode and fading in/out of choosen color
ISR(TIMER1_COMPA_vect){
if(mode && !isPress){ //this is the mode for setting the color
setRGBvalues(colorHSV);
colorHSV++;
if(colorHSV==360) colorHSV=0;
}else if(!mode){ //glow & fade mode
inPlayCounter++;
switch(inPlayMode){ //switch case to determine to glow or fade out or pause
case 0:{ //for glowing in
cR+=fR;
cG+=fG;
cB+=fB;
if(inPlayCounter==250){ //for 4 sec
cR=valR;
cG=valG;
cB=valB;
inPlayCounter=0;
inPlayMode=1;
}
break;}
case 1:{ //pausing for 7 seconds
//no change in cR in this section
if(inPlayCounter==438){ //for 7 sec we will count up to 438 as each timer interrupt occurs at 4ms
inPlayCounter=0;
inPlayMode=2;
}
break;}
case 2:{ //for fading out
cR -=fR/2;
cG -=fG/2;
cB -=fB/2;
if(inPlayCounter==500){ //for 8 sec we will count up to 500 as each timer interrupt occurs at 4ms
cR=0;
cG=0;
cB=0;
inPlayCounter=0;
inPlayMode=0;
}
break;}
}
analogWrite(RED,cR);
analogWrite(GREEN,cG);
analogWrite(BLUE,cB);
}
}
//function which will be called when touch button is pressed
void interruptFunction(){
if(digitalRead(touchPin)){
touchTime = millis(); //record the tiem when digital pin goes high
isPress=1;
return;
}
else
releaseTime = millis(); //record the tiem when digital pin goes low
}
void setup() {
// put your setup code here, to run once:
pinMode(RED,OUTPUT);
pinMode(GREEN,OUTPUT);
pinMode(BLUE,OUTPUT);
pinMode(touchPin,INPUT);
pinMode(buzzPin,OUTPUT);
Serial.begin(9600);
Serial.println("EEPROM Restorerd Values");
Serial.print("Red : ");
Serial.println(valR);
Serial.print("Green : ");
Serial.println(valG);
Serial.print("Blue : ");
Serial.println(valB);
//initiate the timer1
timer1Init();
attachInterrupt(digitalPinToInterrupt(touchPin),interruptFunction,CHANGE);
}
//variable to control the on time of buzzer for different modes
signed long int buzzTime = 0;
boolean buzzOn = 0;
//del input will determine how long will the buzzer will buzz
void buzz(int del){
buzzOn = 1;
buzzTime = millis()+del;
digitalWrite(buzzPin,1);
Serial.println(buzzTime);
}
void loop(){
long int elapsedTime = releaseTime-touchTime;
if(isPress){
if( elapsedTime > 100 && elapsedTime < 1000 ) // short touch is over
{
buzz(200);
digitalWrite(buzzPin,1);
Serial.println("Short Press");
play = !play;
if(play){
timer1Init();
}else{
TCCR1B = 0;
}
isPress=0;
}
else if(millis()-touchTime > 1000 && digitalRead(touchPin) ) //long press
{
buzz(500);
Serial.println("Long Press");
mode=!mode;//FIRST CHANGE THE MODE
if(!mode){ //THE COLOR PLAYING MODE
inPlayMode = 0;
inPlayCounter=0;
cR=0;cG=0;cB=0;
fR = valR/250.0;
fG = valG/250.0;
fB = valB/250.0;
Serial.println("eeprom Updated");
EEPROM.update(addR,valR);
EEPROM.update(addG,valG);
EEPROM.update(addB,valB);
}
isPress=0;
}
else if(elapsedTime<200 && digitalRead(touchPin)==0){
isPress=0;
}
}
Serial.print("buzzTime : ");
Serial.print(signed(buzzTime-millis()));
if(buzzOn && (signed(buzzTime-millis())<0))
{
digitalWrite(buzzPin,0);
buzzOn = 0;
}
}
1 year ago
Hey, really nice project. I have been thinking about this setup for a LED Lamp since I saw it on quietkit.com. I know that you said,
Do you think there is a way to program the touch sensor, i.e. triple tap to do 4-4-4 and change it to a different cycle?I imagine it would much easier to have preprogrammed cycles (such as 4-4-4 or 4-7-8) rather than adjusting the inhale-exhale times independently without the code, i.e. i like a 5-8-9 cycle to fall asleep and occasionally even use a 7-10-11 cycle.
I would also recommend Breath by James Nestor and the Dowdow.
Thanks
Reply 1 year ago
Hey, Thanks a lot for sharing those amazing links.
Regarding your point to switch between different cycles, yes it is definitely possible and it would really be a worthy feature to add to this device
1 year ago on Introduction
Does it work?
Reply 1 year ago
Do you mean for practicing meditation? Absolutely, I had used it myself when I started doing meditation
Reply 1 year ago
Ok
1 year ago
cool
Reply 1 year ago
Thanks!
1 year ago
Did you think of using an RGB LED?
Would the buzzing interrupt the concentration?
Reply 1 year ago
Hi Pettefar!
I didn't get your first question. I have already used RGB LEDs(Common Anode) in this project.
The buzzer is totally optional. I felt it would be nice to have a slight indication for button touch.
1 year ago
Great idea. Maybe you should sell them.
Reply 1 year ago
Thank you! 😊
1 year ago
This is such a nicely done project! Love it :)