Welcome to #INVOOTECH !!
We provide Technical support and Videos related to different microcontroller and microprocessor like 8085,8086,Arduino, PIC, AVR, ARM, Rasberry PI, etc.
Servo motors are used to control many things as it offers very precise rotation of 1 degree. For this it uses the feedback from a potentiometer connected.
For controlling the angle it require a pulse of certain duty cycle which can be achieved using the pulse with modulation (PWM) signal.
For 0 degree it takes a 800us pulse (us = microseconds)
For 90 degree it takes a 1500us pulse
For 180 degree it takes a 2200us pulse
Note:- This pulse can vary with different model of servo motor.
We can control is using the PIC16F877A
For this we have to understand the PWM working of the micro-controller.
PIC has overall 3 timers
TIMER0
TIMER1
TIMER2
We will use the TIMER1 for generating the PWM
Register Associated with TIMER1 as a TIMER/COUNTER
TIMER1 Control Register
TIMER1 Block Diagram
The prescaler value is set to 1:1
The Crystal frequency used is 20MHz
You can connect the Bluetooth and send the command to control the angle of the servo motor.
If the data received is 0 the motor rotates to 0 degree
If the data received is 1 the motor rotates to 90 degree
If the data received is 2 the motor rotates to 180 degree
Note:- Compiler or the software used here is MikroC pro for PIC
THE CODE: -
/*code for generating 800us, 1500us and 2200us pulse for controlling servo motor 0, 90 and 180 degree
Send the code from the bluetooth to the PIC16F877A for conrolling the angles
In the figure the IR0, IR1, IR2, IR3 and IR4 represents the transmitter and D0, D1, D2, D3 and D4 represents the receiver.
The receiver IR is connected to the analog pins of Arduino uno or any other micro-controller.
Note: - Adjust the placing of the IR sensor after measuring the distance and place them in this order and way only. Further if you want to change the positioning then you should make slight adjustment in the code accordingly.
MOTOR DRIVER IC L293D
L293D IC
This IC can controll two DC motor. And can be used to control left and right motor in line following robot.
Four address inputs (A, B, C, D), an
active-low blanking (BL) input, lamp-test (LT) input, and a latch-enable (LE)
input that, when high, enables the latches to store the BCD inputs. When LE is
low, the latches are disabled, making the outputs transparent to the BCD
inputs.
Note: -It is used to control Common Cathode Seven Segmented
display.
A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n junction diode that emits light when activated.[5]When a suitable voltage is applied to the leads, electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence, and the colour of the light (corresponding to the energy of the photon) is determined by the energy band gap of the semiconductor. LED's are typically small (less than 1 mm^2 ) and integrated optical components may be used to shape the radiation pattern.
HOW DOES LED LOOKS LIKE?
Different Types of LED's
Symbol of LED
HOW TO FIND POSITIVE (ANODE) AND NEGATIVE (CATHODE) TERMINAL...........
It's quiet easy............
There are three methods:-
FIRST METHOD
By looking at there legs we can figure out the anode and cathode.
The Leg are of different size, i.e., The shorter leg is the NEGATIVE or CATHODE of the LED and the longer one is the POSITIVE or ANODE.
So simple.
A Normal LED
This LED has legs of different length but there is a possibility that you get the LED with both legs of same length.
LED with both legs of same length
Now what to do, here comes the
SECOND METHOD
By looking inside the LED.
You can look inside the LED and find the ANVIL and POST.
In this figure you can clearly see two structure of different width. The one with the greater width is the ANVIL and other is POST
So now clearly the Anvil that has the greater width and is NEGATIVE or CATHODE where as the Post has the smaller width and is POSITIVE or ANODE of LED.
There is one more possibility that your not able to see though the LED and cannot figure out the ANVIL and the POST or you can say CATHODE and ANODE, So what now......
THIRD METHOD
So in this method you can touch the sides of the LED and search for a flat spot.
The leg near the flat spot or edge is CATHODE or NEGATIVE.
So you can clearly differentiate the POSITIVE and NEGATIVE leg of the LED.
Flat spot in LED
This was the last method for finding ANODE and CATHODE.
If you are unable to find these three things then the last option is to check it by connecting it to the battery.
WARNING :- Always remember to connect a resistor of suitable value to limit the excessive current else you might damage or burn the LED.
YOU CAN ALSO SEE VIDEO ON THE SAME EXPLAINING IT :-
This was all about finding the LED Anode and Cathode.
Note:- Some images are taken from the net we thank all the source. This is meant for educational purpose only.
The lux (symbol: lx) is the SI unit of illuminance and luminous emittance, measuring luminous flux per unit area. It is equal to one lumen per square metre. In photometry, this is used as a measure of the intensity, as perceived by the human eye, oflight that hits or passes through a surface.
Q) What is LDR?
A photoresistor (or light-dependent resistor, LDR, or photoconductivecell) is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity; in other words, it exhibits photoconductivity. A photoresistor can be applied in light-sensitive detector circuits, and light- and dark-activated switching circuits.
LDR Sensor
LDR SYMBOL
We can connect the LDR to the Analog Pin of any micro-controller and in few steps we can directly convert the value to the illumination (lx).
Connection for LDR
Connection
Connect LDR and Resistor in Series (Take resistance of value 10K).
Now Ground one pin of the LDR (Which is not coonnected to Resistor).
Connect one pin of the resistance to power supply that is not connected to LDR (Do not connect it to higher power supply than the micro-controller usually +5V).
Connect the common pin of LDR and of RESISTOR to the Analog PIN of the micro-controller.
CALCULATIONS INVOLVED
RL=500/lux
V0=5*(RL/(RL+R))
V0=LDR_value*ADC_value
lux=(250/V0)-50
Where:
RLis the resistance of LDR
Ris the resistance connected to LDR
LDR_valueis the Analog value read by micro-controller pin
ADC_value is system_voltage/Resolution of ADC
V0 is the analog measured voltage
lux is illumination calculated
A sample example using ARDUINO UNO micro-controller