Hello ... I am brand new to this site, and a beginner in electronics. I have designed a circuit to count parts as they fall through the slotted optical switch. I have a prototype of the system operational, however, there are problems. I will include a schematic of my project, and the data sheet for the switch. The project involves counting parts about the size of a drop of water. The output from the switch goes to an Arduino, which is suppose to count the parts. In the sketch, I found that just by using "counter", the parts were twice as many that actually fell through. So the output is counter divided by 2. The system works fine, as long as the parts fall through slowly, around 1 per second. If I speed things up, to 3 parts per second, the count gets pretty far off. I have tried changing the interrupt to RISING, and LOW, but only RISING gives me the correct count, as well as FALLING. (Until things speed up.)
I believe the problem lies with my wiring of the optical switch. I started with a 100 ohm resistor to the LED and worked up to 560 ohms. My reasoning was that the circuit is dependent on the LED, so the dimmer it was, the more accurate the reading would be. I added the 180 ohm resistor to the Totem pole circuit to see if this would improve things. I'm not sure it did anything.
My questions are as follows:
1. Shouldn't the output from the totem pole be 1 or 0?
2. It seems like the output from the totem pole is erratic, hence the count divided by 2. Also, when things speed up, things get really erratic. How do I get rid of the erratic output?
3. How do I wire this up so the output is 1 or 0?
Thanks in advance for any help with this.
Tomar
I believe the problem lies with my wiring of the optical switch. I started with a 100 ohm resistor to the LED and worked up to 560 ohms. My reasoning was that the circuit is dependent on the LED, so the dimmer it was, the more accurate the reading would be. I added the 180 ohm resistor to the Totem pole circuit to see if this would improve things. I'm not sure it did anything.
My questions are as follows:
1. Shouldn't the output from the totem pole be 1 or 0?
2. It seems like the output from the totem pole is erratic, hence the count divided by 2. Also, when things speed up, things get really erratic. How do I get rid of the erratic output?
3. How do I wire this up so the output is 1 or 0?
Thanks in advance for any help with this.
Tomar
Attachments
-
355.9 KB Views: 56
-
219 bytes Views: 31
-
25.7 KB Views: 76