Showing posts with label robotics. Show all posts
Showing posts with label robotics. Show all posts

September 17, 2011

COLLISION SENSOR




How to detect if your robot has collided with a wall or object?


A Micro switch is one of the easiest ways of letting your robot know that it has collided with something. The simplest way to do this is to fix a micro switch to the front of your robot in a way so that when it collides the switch will get pushed in, making an electrical connection. Normally the switch will be held open by an internal spring.


Micro switches are easy to connect to micro controllers because they are either off or on, making them digital. All micro controllers are digital, so this is a good option.


The following diagram shows a typical circuit for a micro switch bump sensor. The resistor is important because it holds the signal line at ground while the switch is off. Without it the signal line is effectively 'floating' because there is nothing connected to it, and may cause unreliable readings as the processor tries to decide if the line is on or off.

 you can get a micro switch easily from  
RACO 6347 SWITCH SNAP-ACTION SPDT




or if you don't want to get collided you can certainly use an optical sensor as mentioned in my earlier post.
Read more ...

September 15, 2011

My line follower....


How to make a line follower?
What a big question coming in the mind of almost all UG students....
I have a solution for that …..
what basically a line follower has to do is to detect the line with the sensors
The sensors are mainly the optical transmitter and receivers.
They throw light at the surface and receive to detect if the light is fully reflected or absorbed by the surface
absorption means the surface below that sensor is black and reflection means that the surface below that surface is white.

Now let us go to the sensor side...
I have experimenter many sensors related to optical transmission and reception I would like to mention them in brief here
1)first I tried directly with the IR LED and Photo diode but the configuration didn't work perfectly according to my needs.

So I have to go for the other configuration
2)second one is just the enhanced version of first one I included an indicator LED to show whether the sensor is working or not and used a simple transistor as a switch configuration …



Here you can put a potentiometer in the base so that you can vary the sensitivity of the sensor , but we got perfect result with the help of steady values also so you can also try “Trial and error method”.

Many people recommend the sensor based on Photo Resistor(LDR) but I would say “don't go for it”..
and now one video speaks more than one post. 


 
Now you have all you need to start programming a micro controller to make decision and a good algorithm to keep following the line.....

you can go for programming and logic of line follower in my another post
enjoy “sensing” :)


Read more ...

September 03, 2011

How to make a header file for Embedded C?

Hello folks many friends asked me "wouldn't it be better idea if we have our headerfile to include our own functions and not even copy paste them in coding?"
The solution is here, to create your own header file....
first of all make any C program which you want to include in header file...
like the one given here
this is a file for including a password in your micro controller...

basically this program is for the AVR8535 development board by Technophilia. and all hardware connections are assumed to be of that only, but it doesn't matter here which microcontroller I use because you have to make your own header file.........
so take this just as a demo..





After debugging every syntax and (a lot of)logical errors when you think that the program is working fine
you are ready to make your own header file...


step 1)Copy and paste your all codes into a notepad...


step2) edit your function's name
  • we must have to declare the function here which we want to call...
  • like in my demo i changed the name of "main" program to "pass"
  • here you can declare it as any function which can accept values or  return                               programming remains just same as C.
 step3)at the top of your header file you have to define the name of your header file
  • #ifndef _(your header file name)_H      //and do write name without braces
  • #define _(your header file name)_H     //and do write name without braces
step 4)at the end of your header file write
  • #endif 
step5)save the document as "(your header file name).h" as we mentioned earlier...




You are done now
here is how my header file looks like you can see no fuzzy thing is done over here
you can include your program any time you want just dont forget to put the header file in your work directory......


here is the example of how we can minimize the coding time including our own "home made header file"

you can see the size of both the main files and feel the HUGE difference because of including a header file,this is good because we have to deal with less on-chip memory....




so now guys you know that making your own header file  is not Rocket Science....



see ya :)





Read more ...
Related Posts Plugin for WordPress, Blogger...