Monday, 29 December 2014


Hello friends.

Today i am going to share with you a project that i did some times back. This little gadget will let you control the lights with your smart phone ,i have this thing installed in my room and it is working fantastic from a long time.During winters i am a bit reluctant to go and switch of my light when once i enter into my quilt. this thing has solved my problem now.You can find link to  source code file my  eagle PCB design file at the end of the article.
lets see at the system before i explain how to make it.

Hope you enjoyed that demosntration. now let look at the block diagram of the system.


As you can see there are 4 different blocks.When the user will press a button on the app,the smartphone will send data using the on board bluetooth ,this data will be received by HC05 a bluetooth module. This module is serially connected with the MCU . The MCU will analyse the received data and according to the value of data received it will send a signal to turn on or turn off the relay which is the actuator here.    
One point to note here is that the operating voltage of MCU , HC05 and the relay is different o they have to be supplied with appropriate voltages, any voltage higher than the prescribed voltage will damage the component.

1. Atmega 328P
2. HC-05 bluetooth module.
3. SPDT relay(also commonly known as sugarcube relay )
4. MCT2E-optocoupler.
5.16Mhz crystal and 22pf paper capacitor.
6. regulator 7806
7 IN4733A zener(5.1 V zener)
8.LM317 adjustable regulator(for 3.3v)
9. IN4001 diode.
10. BC547
11.Male female connector.

If you remember from the block diagram three different voltages are required by the systems to get these voltages i have made a circuit which is as below

using this circuit a power supply can be made which can provide the three different voltages. Input DC voltage is to be provided at J2 connector. There are ground on 2, 4, 6 pin of output connector ,actually i made it so because i wanted to use it as general purpose board for any future needs you can give only one ground pin.

At this juncture i would like to introduce you to HC05.bluetooth module. figure below shows the module and connections with the arduino. Please note that the voltage on Tx of arduino is 5v but the voltage that the RXD on the HC05 can tolerate is 3.3v so use two resistors of suitable value to create a voltage divider.

so as you can see HC05 has 6 pins and we just need to connect 4 of them as shown in the figure. the RXD of HC05  is conneted to txd of  microcontroller and TXD to the hc05 to the RXD of microcontroller so there is a cross connection as we commonly call it. the state pin tells if the bluetooth is paisrd or not and the key pin is used when one need to go into ATMODE and alter the password of the module or baud rate and so on. the default password is 1234 when you buy the module.

obviously you can go with the arduino and things will be pretty simple but here what i am trying to do is to implement the circuit on a PCB . It willl cut down the cost of project .

now lets look at the circuit.

optocoupler is used to isolate the MCU circuit from the spikes that may generate when the relay is switched. similarly the diode aroude the relay often called fly wheel diode and the electroytic capacitor is used for the same purpose. the AC load will be connected at the pin 3 and 4 of J5 connector and AC supply will be given on pin 1 and 2.

the app will send the data of pin no and and its state to the microcontroller the microcontroller will make the pin PB2 high ,this will lead to the turning on of the GaAr LED ,which is inside the optocoupler MCT2E when the light of led will fall on the photo transistor it will get turned on and hence the current will start to flow from  collector to emitter  of photo transistor which is again situated inside the packaging of MCT2E ,now as you see in the picture there is a 10k resistance through which the emitter of optocoupler is grounded whenever there will be adrop of .7v across this the transistor BC547 will get turned on and hence the coil of relay will get magnetised and NO  contact will filp over to complete the circuit of load applied .hence the light would glow.

the software that is inside the microcontroller is a cutshot version of work of Mr Hazim biter since i only needed the digital pins.
his code  can be seen here
the app i am using can be found here.

my eagle files can be downloaded  here

Please feel free to edit reuse redistribute,i would love to hear from you about your experience. 

In my next post i will share about the modifications i have made to the code,till then .happy inventing.

Also if you dont have access to a board house,you can make your PCB at your home ,I have a video of mine showing how to do may go through it.

Creative Commons Licence
CONTROL THE LIGHTS OF YOUR ROOM BY AN ANDROID APP by Deepankar Maithani is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Wednesday, 28 May 2014


3D printing is a revolutionary technology that has really become popular and affordable in the past 2  to 3 years.
 It is an additive manufacturing process of making 3 dimensional solid objects that can be of any shape. Up till few years back what we had heard of is a normal printer that prints pages. when i  first heard about 3D printer i was so astonished that how come a 3D object can be printed.

 3D printing is a process of additive manufacturing in which material is added layer by layer.  Below is the picture of the printer

In any 3D printer there would be an extruder and a bed as shown in the picture above. The job of the extruder is to heat the material used for printing and convert it into thin fiber  while the bed is heated so that the model  remain stacked to the  bed when the printing is going on.  I made a video while i was printing a model. This video might be useful in understanding the process of printing.

There are two  materials ABS(Acrylonytrile butadiene styrene) and PLA(polylactic acid) which are  generally used although  with each passing day new materials and new improvements are appearing  in this technology.
ABS is a petroleum based product . it is tough,flexible and sturdy can withstand high temperature the only down side to it i see is that it is non biodegradable. It also require that the 3Dprinter has to be operated at slightly higher temperature when compared with PLA.
PLA on the other hand is a biodegradable material since it is based on corn starch,sugarcane,tapioca roots and potato starch it is usually used for applications like medical sutures and medical implants(it degrades in the body over time),food packaging,disposable food utensils etc.  the downside to it is that  it is not as sterdy as ABS,so not be used  to model such things where there will be strain .


3D printer is a great asset to have on a developers desk. It gives you an edge over the designers not using this technology . It saves a lot of time and money. lets take an example suppose one have to  create a design of  an en-closer for LED lamp. Once you create the design you can export it and print it on a printer and you can actually have the actual experience of the product ,this will enable you to analyse the ergonomics and end user experience in a better way.I designed a lamp below is the design as it looked on the software

 3D printed Parts

  Different parts of 3D printer


Finally after testing and installing electronics. (how handsome i  look. marvellous :))

Gartner  has also predicted that this technology will shape the business  in future. 
following is an excerpt from gartner report.

Escalation of 3D Printing Capabilities Will Change Retail Models and Threaten Intellectual Property. he technology of 3D "bioprinting" (the medical application of 3D printing to produce living tissue and organs) is advancing so quickly that it will spark a major ethical debate on its use by 2016, according to Gartner Inc. At the same time, 3D printing of non-living medical devices such as prosthetic limbs, combined with a burgeoning population and insufficient levels of healthcare in emerging markets, is likely to cause an explosion in demand for the technology by 2015.
"3D bioprinting facilities with the ability to print human organs and tissue will advance far faster than general understanding and acceptance of the ramifications of this technology," said Pete Basiliere, research director at Gartner. Already in August 2013, the Hangzhou Dianzi University in China announced it had invented the biomaterial 3D printer Regenovo, which printed a small working kidney that lasted four months. Earlier in 2013, a two-year-old child in the US received a windpipe built with her own stem cells.There are immense applications of  this technology ,we can bring our imagination to reality using this technology.

Once i made the design of the lamp as shown above, i went for some improvements in my next design the new design looks as below. In the new design the wire that goes from  the electronic circuit in the base to the LED which are  installed in the head of lamp is completely inside the structure of lamp  and hence is a better design also in this attempt i given even more attention towards the dimentions so that every thing snaps in perfectly. all these improvements were because i am  able to see my previous design actually in front of me and hence i am in a better situation to analyse the flaws in my design.

Thursday, 15 May 2014


A printed circuit board (PCB) mechanically supports and electrically connects electronic components using conductive tracks, pads and other features etched from copper sheets laminated onto a non-conductive substrate. 
 PCB Substrates are specialized materials that do not conduct electric current. They act as laminated insulator between the circuitry.

Following are the common types
1. FR-2
2. FR-4
3. RF
4. Flex
5. Metal

1. FR-2(Fire resistant 2)
         It is a low grade substrate and is made up of impregnated paper also called phenolic. It is easy to machine over as compared to a fibre glass substrate. this type of substrate is found in inexpensive electronic products.

2. FR-4(Fire resistant 4)
         It is made up of woven fibre glass material and is impregnated with flame resistant material. this substrate is more stronger than FR-2 .It is usually found in higher grade electronics.

3. RF
         These substrate are composed of material having low dielectric value and are used in applications where high power radio frequencies are involved.

         Thin and flexible plastics or films are used to make them. These are used at places where bending is required or repetitive bending is required or their is constraint of space.

         As he name suggests these are made up of metals and have non conductive coating,these are used in high power circuits and act as heat sink in addition to providing path for flow of current. Usually found in high wattage LED base.

Wednesday, 14 May 2014


A PCB is a backbone of every electronic product. while studying and eventually when i got an opportunity to  work at National institute of Electrnics & Information Technology chandigarh , i came across this  domain of electronics.  I worked on orcad 10.5 and Orcad 16.5 ,there has been a drastic change in the look and feel of the two versions like for example in 10.5 you make schematic in the capture save the .mnl file and then open the layout to work on it ,while in the 16.5 version it takes you automatically to the layout. there is also change in the GUI and there are many new softwares added to the bundle. no doubt OR-CAD is a industry standard tool with high precision and wide range of tools to work with and cater all the needs of industry. I particularly like the Pspice which lets you simulate the circuit prior to fabrication of PCB.
 The downside to or-cad i see that first of all it is not OPEN SOURCE (at the time i am writing it the cost i inquired was 1.67 lakhs per licence for education purposes ) and  for a beginner it becomes difficult to acclimatise with the tool ,there are so many libraries that a hobbiest or a student would never need but since they are there it becomes difficult at times to find out the component with right footprints ,although there is a facility of creating your own footprints in case one donot find one in the library but sometimes there is time constraint and sometimes in my case i am too lethargic to do that.
I came across another tool EAGLE CAD which has a lite version which is free and a paid  professional version . But for all the hobbiest and students lite version is good enough ,here i assume that no simulation is required prior to implementation.  the limitations in lite version are that you cannot make a PCB having more that two layers and also there is some constraint on the dimentions of PCB.In Eagle i have all the common components at one place the libraries are much more easier to go through and in case i don't have a component there are so many open source libraries to download and use. link to one such library is below for those who want to use them. i really like this library caters all my needs.

I have done some videos to explain how to install and create a PCB using EAGLE CAD

TUTORIAL 1: Downloading & Installing EAGLE CAD 

TUTORIAL 2:Making a schematic on Eagle and importing new libraries