![]() | ![]() | ![]() |
| | |||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
| | Thread Tools | Display Modes |
| | (permalink) |
| New Member | I want to signal condition a phototransistor line sensor output to a digital input. Although I am using the PIC16F8680 chip, the answer should be valid for most PIC chips. If not, please let me know. I have designed, built and tested a bank of 8 IR Transmitter/ Phototransistor pairs. They all return 1.2 to 4.2 volts at 3/8ths inch depending on a light or dark surface below the sensors. I ultimately want an 8-bit digital pattern where the sensors might react like this when travelling over a black line. 00011000 00001000 00001100 00000100 meaning the robot is drifting off center. Seems like I have several options: Lets say I use Port B as an input port. 1. If I just run the sensor inputs to the port, it would seem that I would get what I want; zeros or ones. 2. Could I send the 1.2-4.2 volt signal through some kind of chip like an inverter to "clean up" the signal and only produce 0 or 1? I know an opamp could do this, but that seems like overkill. 3. How about an LED/resistor voltage divider to drop the 1.2 down to 0.7 to make sure I get a zero into the chip at low voltage?? 4. I could use ADC, but it seems inefficient to convert the voltage into an 8 bit number just to turn it back into a one or zero. So what would you do??? |
| | |
| | (permalink) |
| Experienced Member | You could use a pair of quad comparators. OR you could use the PICs built in comparators and a 4 to 1 mux chip like the CD4052 or one comparator an 8 to 1 like the CD4053. There's a built in DAC you could use too to set the threshold. |
| | |
| | (permalink) |
| New Member | I'm not familiar with that PIC chip. IMO I like the 16F88 chip. If this is a line follower, you will need to adjust the threshold levels to determine if the robot is on the line and not on the line under varying light conditions and surface conditions. I would bring the voltage into the A/D converter on the PIC, if your PIC has this capability. Covert it to a 8 bit (0-255) number and set/adjust thresholds in the programming. You could output the light level to LCD. |
| | |
| | (permalink) |
| Experienced Member | ADC may seem inefficient, but if you aren't using them for anything else, it's really quite reasonable. You can take ADC readings and use the average to compensate for almost any light conditions. The sensors probably won't be identical. You can compensate for this by adding or subtracting a value from the sensors that are different. (or use the readings to help match sensors). It's not any less efficient than posting identical messages on 4 different forums around the world, and 2 different topics here. |
| | |
| | (permalink) | |
| New Member | Quote:
I see you disaprove. Are you saying I should avoid all forums in the world but one? How would you go about getting as many different responses as you can to a specific question??? | |
| | |
| | (permalink) |
| New Member | Thanks Tyru The PIC18F8680 has multiple A/D so this would be a good idea. |
| | |
| | (permalink) | |
| Experienced Member | Quote:
Maybe if you waited a couple of hours, and mention the other places it's already posted....... | |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Robot wars!University of Cape town Mechatronics project | riki4eva | Electronic Projects Design/Ideas/Reviews | 7 | 28th June 2008 05:52 AM |
| New UK Robot competition | ShinyRed | Robotics Chat | 2 | 23rd February 2008 02:21 AM |
| Good Robot H-Bridge? | Krumlink | Robotics Chat | 37 | 6th February 2008 01:49 PM |
| Base Robot Body | Krumlink | Robotics Chat | 6 | 2nd January 2008 05:09 PM |
| Motor Sizing For Moving Robots | dknguyen | Electronic Theory | 6 | 25th April 2007 10:43 PM |