I had bought a qtr-8rc array sensor , but some problems face me , so that I want anybody help me
How can I programme this sensor using MikroC Pic to use it in linetracking robot ?
The two sensors at the side of array sensor , whom may broke off , don’t work separately , but if one of them be 1 the other be 1 and if the first be 0 the other be 0 , why ? and how I can separate them ?
I do not have MCU-specific code I can give you. The procedure for reading the sensors is described on the product page. Do you have any specific questions about that procedure?
Also, I do not understand the description of your problem. Can you describe exactly what you are doing with the sensors that you broke off? How are you reading the sensors? Did you add the included resistor? Pictures of your setup might help.
The way the sensor works is that you initially charge the sensor’s capacitor (by driving the line high for 10 us) and then you time how long the capacitor takes to discharge through the sensor’s phototransistor. If there is a lot of incident IR on the phototransistor, the capacitor will discharge quickly. If there isn’t much incident IR, the capacitor will discharge slowly. However, even in the dark, the discharge time is probably going to be a lot faster than 150 ms. Can you try setting your last delay to something much shorter, like 500 us or 1 ms?
Ultimately, it might be most informative if you actually try to time how long it takes the sensor output to go from high to low and return that time value so you can get a better sense for what the sensor is doing when the lights are on and off. Also, keep in mind that the sensor responds to IR light; if your room light does not have a significant IR component, you won’t get much of a response from the sensor.
You should look for a bug in your code or a connection problem. Do you have access to an oscilloscope? Can you tell me how you have everything connected? A picture of your setup might help. Also, can you try using a basic digital camera to verify that the IR LEDs are on?
Posting a tiny picture of a battery isn’t really a helpful answer to my question. Are you passing that battery through a regulator before using it for Vcc. If so, what are you using for your regulator? What voltage is the battery? Do your PIC and QTR sensor share a common ground?
You can use an oscilloscope to monitor the sensor outputs to see what they’re doing. That is much more useful than the threshold-type approach you are taking with your code.
The 7805 has a drop-out of > 1.5V, so you’re not getting 5V out of a 6V battery (unless the battery is very fresh and greater than 6V voltage.)
If you want to turn 6V to 5V (or, a variable input rate to 5V) you might want to try the pololu step-down converters, or the pololu SEPIC up/down converters.
Or you can use a LVDO part with 0.35V drop-out, like the LF50ABV (has the same pin-out as 7805, maximum current 500 mA.)
Note that I have no idea whether the voltage is actually causing this particular problem, but it’s likely to cause other problems in the future if you expect to actually have 5V proper.
We have the schematic for the sensor available on the product page. Can you start probing voltages/currents in an attempt to figure out why they aren’t working? The sensor has two parallel sets of four LEDs, so if none of the LEDs are working, the problem is not likely to be with the LEDs themselves. Note that we test the board before it ships, so the best place to start would be things you did/added/changed.