Friday, 23 September 2016

SIMPLE PID LINE FOLLOWER


The simple line follower autonomous robot is a robot which acknowledges and follows a well distinguished colored line.
The following PID controlled line follower robot is constructed using components:

Acrylic Fiber sheet: This forms the base of the robot.
LiPo battery: 9V, 2A to provide current in the system.
Arduino (controller): The brain chip of the robot where the algorithm is fed.
Connecting wires
Motors (X2): To drive the wheels.
Wheels (X2)
Castor wheel: Placed in the front to support the IR sensor array.

Working: Light is reflected from the surface containing the 3 mm sized contrast black tape. This contrast in color bears different IR sensor values. In this way, the robot distinguishes the line from the common white background. So, as the robot deviates from the tape, the IR sensor values change accordingly. Based on this the PWM drivers feeding current to the motors give different duty cycle which in turn varies the RPM of the motors. PID control guides the robot with appropriate proportional, Integral and derivative values (which are tuned in the beginning using the Ziegler-Nichols method of tuning).


Code on:


Friday, 19 August 2016

Electronic Turn: Electronic Turn: Supervised Learning

Electronic Turn: Electronic Turn: Supervised Learning: Electronic Turn: Supervised Learning : Supervised learning is when when we have data in  a paired form. To understand it lets consider an ...

Thursday, 21 July 2016

Simple Thermometer

Components:

1) Arduino uno
2) LCD display (16X2)
3) Thermistor
4) 220 ohm resistor
5) Male to male probes

Method:

LCD:

  • The LCD consists of 16 pins. Starting from the leftmost pin, the first one VSS (gnd), VDD( vcc), VO, RS, RW, E, D0- D7, A, K
  • The VSS and VDD goes to GND and 5V supply from the arduino respectively V0 goes to the potentiometer centre. RS stands for register select. It is connected to one of the digital pins of the arduino.
  • When it is low the LCD accepts commands like clearing, etc. Whereas when it is high the LCD accepts text from the program to the display.
  • RW stands for read/write operation when it is low the LCD is taken for write operation. It is very rare that the program reads data from the LCD, so it is always connected to the ground.
  • The next pin is enable (E). This is a control line used to tell the LCD that you are sending it data. It is attached to one of the digital pins of the arduino.
  • The pins D0 to D7 are used for the 7 segments usually you pass only four segment pins from D4 to D7 for using simple alphabets and numbers. It is only then when you need special characters you connect all 8 pins and define the shape of the character.
  • The last 2 pins of the LCD are not necessary and remains unconnnected.
THERMISTOR:

Then comes the thermistor the analog input is accepted from the thermistor divider circuit as shown along with the 220ohm resistor.
This raw analog input is caliberated and processed using the program following code:

double Thermistor(int RawADC)
{
  double Temp;
  Temp = log(10000.0*((1024.0/RawADC-1)));
  Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
  Temp = Temp - 273.15;        
  return Temp;

}

This function is used to caliberate the analog signal which we get from the thermistor. It varies with differemt resostors.

Easy schematic of the circuit


Tuesday, 21 June 2016

Electronic Turn: Basics of IR

Electronic Turn: Basics of IR: IR sensors are composed of an IR emitter and an IR receiver.

IR emitter is simply an IR LED (Light emitting diode) which emits infrared light when supplied with a voltage. You can check this in action using a camera phone and looking into the LED. You will see a purple colored light coming out of the LED.

 IR LED is connected in forward biased as shown in the figure.












IR receivers are photo diodes, that is they show more diode characteristics when more light falls on them.  And because of this property IR receivers are connected in reverse biased. How this is helpful ?

Well these sensors are used with microcontrollers and microcontrollers understands voltage levels.
The voltage developed across IR receiver will change if its resistance changes (use simple voltage division rule with the current limiting resistor).

Initially the IR receiver has some resistance when connected in reverse biased due to ambient light. However when IR rays from IR emitter fall on the receiver, the receiver will show more diode like characteristic, that is its resistance will increase (reverse biased ). So voltage developed across it increases. This voltage is detected by microcontroller. Now we can use this to implement certain logic in the code.