Monday, 29 December 2014

CircuiTricks ~ Simplest way to make simple circuits with JUST a pencil

I was sitting with my younger brother trying to explain him what is "conductivity", how a circuit gets completed and electrons get a path to flow, how does resistance increases with length, increases with increase in area and all the other stuff..

Boiling down everything to equations can be boring.. But I managed to get all this through his head that how does circuits work by this very simple concept...

Not stretching too long, here I will show you what all you can do with a "9B" graphite pencil.

Have a look:








Well, isn't this quite simple?

Take up a pencil, button cells and a LED..
When you do this by yourself, you will realize that the intensity decreases with increase in length of the path drawn. And if you draw out a broad path, intensity will increase.

That is because: R = (Resistivity)*(length)/Area.

The only trick here is the 9B pencil that gives a conducting path!!

So, go ahead and make your cool stuff with CircuiTricks..

To know more about CircuiTricks, visit www.ciruitricks.com.

And also, if you have cool ideas to make things with Pencil and electronics, write to us at jeni@circuitricks.com and you can get a FREE CircuiTricks kit or a CircuiTricks Tshirt..

Go ahead, and show your creativity..

Thursday, 2 October 2014

Program to interface PIR sensor with atmega 32


About PIR Sensor:

Pyroelectric Infrared Radiation Sensor (motion sensor) module basically detects human motion (within 6 meters range). You can open the white cap(Fresnel Lens) and see the sensors within. 

There are various modules available. I have used the one with 3 pins(1-VCC, 2-OUT, 3-GND).


How does it work?

I have tried to add enough comments which can help you understand the working. PIR sensors take 1-2 minutes to settle down. During this time it captures the infrared radiation of the room, and after that if someone comes in front of the sensor, the radiation picture changes, due to human temperature. 

The output pin goes low when it detects motion.

Nevertheless, you can refer the pdf for exact description.

Program :


#include"avr io.h"

#include"util delay.h"

#include"compat deprecated.h"

void main()

{

 DDRA = 0x00;                     //PORT A as input

 DDRC = 0x0F;                    // LED at PORT C as input

 while(1)

 {

  if(bit_is_set(PINA,0))        //no motion detected

  {  

   sbi(PORTC,0);

   sbi(PORTC,1);

   cbi(PORTC,2);

   cbi(PORTC,3);

  }

  else if(bit_is_clear(PINA,0))   // motion detected.

  {

   cbi(PORTC,0);

   sbi(PORTC,1);

   sbi(PORTC,2);

   sbi(PORTC,3);

  }

   

 }

}


You can find all the files on Github too.

If you come across any doubts or have queries, feel free to comment


Would you like to know "How to make a bump avoidance circuit using aluminum foil" ?







Wednesday, 17 September 2014

DIY clap activated LED bracelet

Imagine all the people in a group wearing the bracelet and they all glow at the same time on clapping!!

This tutorial will guide on how to make this simple DIY wearable device

Wearable Clap lit bracelet

Components Needed:
·         Mic. (I took it from one of non working earphones)
·         Potentiometer 10k.
·         Resistance 1k.
·         Colored LEDS – 8.
·         Transparent plastic pipe. (Diameter approx 1 cm).
·         NPN transistors. – 2
·         3v lithium cell.
·         Battery cap.

Few wires, soldering iron, and a small piece of GPB and there you go!



Basic Circuit:





Working :
We will use two transistors in cascade to provide amplification of current. Using two transistors will be enough to light up 7-8 leds using just 3v supply.
According to our circuit, the LEDs will glow only when Q2 turns ON, thus providing a ground path to LEDS. Q2 will turn on when Q1 does not conduct. So, we have to set the potentiometer in such a way that when you clap, only at that time the Q1 goes off. This value usually comes in between 4-4.5 k.
Note: Be careful about checking out positive and negative terminals of mic before soldering. Otherwise you may not get the output.

Let’s Get Started:

Mount the above circuit on a small piece of GPB. Since we are making a wearable, we will try our best to adjust it all in the smallest size possible.


Cut out the unused portion of the board.
Next, solder the MIC and the battery cap.
And then connect LEDs in parallel.


After connecting it to the circuit, set the potentiometer.
Done?
 Place it inside the tube.





We have covered the circuit with a thread. A hole is made in the pipe and ribbon has been taken out from it. A similar hole on the other end, and there you go!!

Wanna See?

Wear it, clap, and have fun!



Sunday, 24 August 2014

Getting familiar with arduino programming syntax

Today I had given a small presentation on getting familiar with programming syntax of arduino. Here is the presentation


Thursday, 14 August 2014

Getting the shape drawn by pen by image processing in matlab

I recently got a small project of filtering out the image drawn by pen on white paper to just black and white.





Although the code seems huge, actually it is quite simple. It is divided into two parts.

First part is to convert from rgb to black and white. Each time the threshold frequency may change, so i chose to take the maximum index across all rows and columns and then took mean of it, and by experiment, I found that adding 40 to the value thus found gives the maximum result.

The next part was to remove the black part of un-illuminated area that comes in BnW image. For that, i have tried to find out 'lrange', and the 'hrange'. lrange is the lower value of column from which the cropped image will begin and hrange is the highest value of column for cropped image.

Here is the code:



%first convert to grayscale image and then to binary.
clc;
clear;
clear all;
ima = 'C:\Users\Admin\pen2.jpg';
 im1 = imread(ima);
im1 = imresize(im1,.5);
imshow(im1)
title('original image')
pause(1);
im1 = rgb2gray(im1);

[a,b] = size(im1);
min1 = (zeros(a,1))+100;
for i = 1:a                 %automatic threshold
    for j = 1:b
        if(im1(i,j)<min1(i,1))
            min1(i,1) = im1(i,j);
        end
    end
end
    th = mean(min1);
 im3 = im1 > th+40;
 %figure; imshow(im3);
 title('b n w')
 im4 = im3;
 im4 = bwareaopen(im4,16,8);

 %%the following code is to crop the black portion that has came due to
 %low intensity at the bottom of the image.
 lrange = 0;  
 hrange = b;  
 var1 = 0;
 for lc = 1 : abs(b/10);      
     for lr = a : -1 : a-250
     var1 = var1 | im4(lr,b);
      end
      if var1 == 0
          lrange = lrange + 1;
      end
 end
  for hc = b : -1 : (b-abs((b/3)))
      for hr = a : -1 : a-250
      var1 = 0 | im4(hr,b);
      end
      if var1 == 0
          hrange = hrange - 1;
      end
  end
  im5 = imcrop(im4,[lrange,0,hrange,a]);
  %% This code crops the image due to low intensity at the top of the image
  lrange1 = 0; hrange1 = b;
  for lc1 = 1 : abs(b/10);
     for lr1 = 1 : 250
      var1 = var1 | im4(lr1,b);
      end
      if var1 == 0
          lrange1 = lrange1 + 1;
      end
  end
 %figure; imshow(im5)
  for hc1 = b : -1 : (b-abs((b/3)))
      for hr1 = 1 : 250
      var1 = 0 | im4(hr1,b);
      end
      if var1 == 0
          hrange1 = hrange1 - 1;
      end
  end
  im6 = imcrop(im5,[lrange1,0,hrange1,a]);
  imcomp = imcomplement(im6);
 w = ones(7,7);
 im7 = imfilter(imcomp,w,'replicate');
figure; imshow(imcomplement(im7))
title('final image')


You can view the same on Github

Tuesday, 12 August 2014

Competition for Tech Fest : Electro Heist

If you are searching for a new idea for electronics event in college, then this could surely be a good idea for first round..!

We had conducted an event by the name 'Electro Heist' in 2014.


The first round was kept as a crossword puzzle round. The question paper along with the answers are attached in the form of image below.

Across:



Down:


Answers:




                                               Hope you will like them :-)


Saturday, 8 March 2014

Simple Program to see whether Termite / Hyper terminal is workin or not

/* download the two files "uart.c" and "uart.h" from the blog and include it in the same folder where your file is saved*/

#include<avr/io.h>
#include "uart.h"
#include "uart.c"
#include <avr/interrupt.h>
#include<util/delay.h>
 void main()
 {
 uart_init(UART_BAUD_SELECT(9600,F_CPU)); // Syntax to select baud rate.

 while(1)
 {
  uart_puts("Termite Working!!");
  uart_puts("\n");
  uart_puts("\r");
  _delay_ms(1000);

 }
}

/* You need to install 1) Prolific Driver to attach serial cable with PC  2) Termite or 2) Hyper terminal to view data on the computer screen.*/

/*In case you are not able to download them, kindly comment here*/

Powered by Blogger.