Simple Switch using Photo Diode

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
OK, this circuit should fill your requirements. Back when Radio Shack actually stocked parts I would select certain components on the basis of what they commonly stocked. This was to make it easier for nubes and casual electronics builders to obtain parts. You can still check for RS availability or a UK member can point you to a supplier. Ebay is another source that I often use.

Note that I didn't include a part number for the PhotoTransistor (FT1). I used a generic model for my simulations. Some components have parameters that make them popular over others. Hopefully someone here will suggest a common and popular part number.

Because you're using a 9V battery I chose CMOS chips to keep your battery drain low. Therefore, the LEDs are the only components that draw any appreciable current. Most LEDs will appear brightest when viewing them directly from their top. You can lower battery drain by increasing the value of R4 at the expense of brightness. You may find that a value of 1K to 2K will suffice.

I've included 3 switches. A power On-Off switch and two momentary push buttons. The "Step" push button manually advances the 4017 counter and lights the next LED. The "Reset" push button resets the count to player 1 regardless of which LED is currently lit.

Any and all critiques of this design are welcome.

Chris

OptoCounter.JPG
 

Nala

Feb 21, 2015
24
Joined
Feb 21, 2015
Messages
24
OK, this circuit should fill your requirements. Back when Radio Shack actually stocked parts I would select certain components on the basis of what they commonly stocked. This was to make it easier for nubes and casual electronics builders to obtain parts. You can still check for RS availability or a UK member can point you to a supplier. Ebay is another source that I often use.

Note that I didn't include a part number for the PhotoTransistor (FT1). I used a generic model for my simulations. Some components have parameters that make them popular over others. Hopefully someone here will suggest a common and popular part number.

Because you're using a 9V battery I chose CMOS chips to keep your battery drain low. Therefore, the LEDs are the only components that draw any appreciable current. Most LEDs will appear brightest when viewing them directly from their top. You can lower battery drain by increasing the value of R4 at the expense of brightness. You may find that a value of 1K to 2K will suffice.

I've included 3 switches. A power On-Off switch and two momentary push buttons. The "Step" push button manually advances the 4017 counter and lights the next LED. The "Reset" push button resets the count to player 1 regardless of which LED is currently lit.

Any and all critiques of this design are welcome.

Chris

View attachment 19129
Hi Chris
Many thanks for producing the circuit, very much appreciated.
As I have been out of the electronic field for quite some time as you might imagine I do have one or two questions, I may have others later:

1. Am I correct in thinking that the capacitor shown as 100n is n for nano farad and so = 1 pico farad ?
2. Not sure about the 'Room light Source' circuit and its relevance to the main circuit
3. I see the FT1 as the main light On/Off trigger but I am unsure about the U1_Out and U1_in, symbols i.e. what they represent ? relevance/use/component value etc.
4. I didn't decide to use a 9V battery (it was just present in the original circuit suggested at the beginning of the thread) and would have preferred a physically smaller battery, are physically smaller 9V batteries available than the regular PP3 ? Or is it an easy modification to run this circuit on a lower voltage battery e.g. button cell or AAA
5. I was expecting 4 LED to indicate player. I see there are 5 LED's so is one simply to indicate circuit is on?
6. The power on/off switch appears to be a push button but I presume this must be a toggle switch ?

kind regards
alan
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
High Alan,
I thought you said there are 5 players. That's why I have 5 LEDs. Though that's easily changed. I have other issues here that I need to resolve. I realize now that I have the logic 180` out of phase. I'm going to rework this circuit and re-post a new one. I will probably eliminate the 555.

Since your questions regard the circuit I posted I will answer them when I post the new circuit. I will also provide you with the theory of operation along with a scope shot of the logic flow.

For now I gotta get out and ride.

Cheers,
Chris
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
I must be getting senile and I'm surprised that no one has brought it to my attention. I'm referring to my last schematic that indicates a 4017 directly driving LEDs. After consulting the CD4017 data sheet I see that I should be using discrete driver transistors or transistor array like the ULN2004. As per the data sheet "Ioh" (Current Output Level High)= 900μA @ 25`C @ 10Vdd. My spice didn't catch this because I had selected "Ideal" for the output pins, which is not real world.

Our Mods will have to decide whether to remove that schematic at the expense of thread continuity. On the other hand bad design is not something we want hanging around here. :oops:o_O

Chris
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
No, the 4017 can be used (and is frequently used) to drive LEDs the way you suggest. There is actually a subtle problem in using a single resistor as you have, which I will explain later.

The specs for the output are those which are guaranteed to maintain a valid logic level at the output. In your case it appears that this valid logic level is not required, so you are able to draw more current from the outputs. I initially thought P1 through P5 were used for something and a logic level was required here, but I can't actually see that.

The subtle problem with wiring LEDs like this into a single resistor is that the 4017 actively drives the output high and low. When any LED is on, the voltage across the resistor rises to the 4017 output voltage less Vled. If this voltage is greater than the reverse breakdown voltage of the LEDs, then you can rapidly damage them. The fix for this is to either use a power supply voltage low enough so as not to make this an issue, place a diode in series with the LEDs, or simply use a separate resistor for each 4017 output.

Another note on this problem is that it tends to be MORE of an issue as you reduce the brightness of the LEDs. This is because the output voltage of the 4017 rises to closer to Vdd, and because the Vf of the LED falls at lower currents. Both of these conspire to cause a larger reverse voltage to appear on the LEDs that are not illuminated.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Steve, thanks for that information. Bringing Vdd down to 3V should solve the LED (Vrev) issue. Does the 4017 have a reputation of working reliably there? On the other hand adding a Diode in series with the limiting resistor isn't a big deal.

EDIT: Oops! After looking at my schematic I fully understand what you're describing. It would require 4 diodes or 4 resistors.

Thanks,
Chris
 
Last edited:

Nala

Feb 21, 2015
24
Joined
Feb 21, 2015
Messages
24
Steve, thanks for that information. Bringing Vdd down to 3V should solve the LED (Vrev) issue. Does the 4017 have a reputation of working reliably there? On the other hand adding a Diode in series with the limiting resistor isn't a big deal.

EDIT: Oops! After looking at my schematic I fully understand what you're describing. It would require 4 diodes or 4 resistors.

Thanks,
Chris
3V sounds good to me Chris it's a better size to accommodate physically in addition to the electronic advantages.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Alan, you didn't answer my question regarding the light source. Are you going to be using ambient light? Do you play indoors, outdoors?

Chris
 

Nala

Feb 21, 2015
24
Joined
Feb 21, 2015
Messages
24
Alan, you didn't answer my question regarding the light source. Are you going to be using ambient light? Do you play indoors, outdoors?

Chris
Sorry Chris , we play indoors in fairly low light.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
I've been designing this with ambient light as the source but this isn't cast in stone. Since you're going to need a domino docking feature (as discussed previously) I see no reason that a microswitch shouldn't be considered in place of an opto solution.

Cheers,
Chris
 

Nala

Feb 21, 2015
24
Joined
Feb 21, 2015
Messages
24
I agree a micro switch would do the job but I want the system to be as discrete as possible and a micro switch will add bulk to a docking feature and so I prefer the opto solution which I am sure I can tweek for optimum performance in the situations where we play.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
They make microswitches as small as an 8pin dip (dual inline package) but if you insist on an opto solution so be it.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Sorry for letting this thread drag on so long. I sense that a microswitch sensor is not to your liking but since your ambient light may be very dim that leaves only the option of providing the light source; IE an LED, which will draw more battery power.

If you navigate to ebay and search "Photo Interrupter" you will get a visual of what these modules look like. They contain an integral LED (Transmitter) and Photo-Transistor (Receiver). Light is blocked when an opaque object is placed in the slot. I don't think these will be acceptable to you because they will obscure the dots on the dominoes.

There are reflective type modules available but I'm uncertain how well they would work with a domino; especially if they're black with white dots.

Chris
 

Nala

Feb 21, 2015
24
Joined
Feb 21, 2015
Messages
24
Sorry for letting this thread drag on so long. I sense that a microswitch sensor is not to your liking but since your ambient light may be very dim that leaves only the option of providing the light source; IE an LED, which will draw more battery power.

If you navigate to ebay and search "Photo Interrupter" you will get a visual of what these modules look like. They contain an integral LED (Transmitter) and Photo-Transistor (Receiver). Light is blocked when an opaque object is placed in the slot. I don't think these will be acceptable to you because they will obscure the dots on the dominoes.

There are reflective type modules available but I'm uncertain how well they would work with a domino; especially if they're black with white dots.

Chris
Hi Chris
Sorry for not replying sooner but for some reason the forum stated I had insufficient privileges to reply and I had to change my email address before I could get back to replying.

Working on the assumption that a push switch mounted with 4 LED's at each corner on the cribbage/domino marking board may be a better solution as the LDR opto solution seemed to be becoming problematic so I did some research and came up with a working solution based on your use of the 4017B and 555 timer. I encountered a problem with 'bouncing' (several erratic LED lighting) but managed to find a very good circuit that overcame the problem and I now have a working, if not automatic system.

I am grateful for you directing me and I am pleased with the result.

alan
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Hi Alan,

I should have asked far more questions regarding Dominos. Heck, I didn't even know that it was played on a board! It's for that reason that the attached circuit may not be applicable but I'm posting it anyway. The Phototransistor can be replaced with a microswitch if desired.

As you can see I've eliminated the 555 and debounced the input to the 4017 with an RC time constant formed by R1, R2, C1 and D1. When QP1 is on (light present) C1 charges quite fast because R2 is bypassed by D1. On the other hand C1 discharge path is through R1 & R2 = 110KΩ. RxC=55mS.

ChrisOptoCounter2.JPG
 
Top