frankvanderkruijs:
But one of the microswitches is always on. I measured resistance and when it's open I still measure high resistance.
Let's make sure we're all on the same page terminology-wise.
frankvanderkruijs:
But one of the microswitches is always on. I measured resistance and when it's open I still measure high resistance.
Let's make sure we're all on the same page terminology-wise.
dougp:
Let's make sure we're all on the same page terminology-wise.
I work with sensors every day and night. So I know what nc and no is.. the thing is that when my switch is in (normally) open position. I still measure resistance. All other 3 switches are working fine. And this one was working fine too. But now it seems to be broken.
What value do You read?
Disconnect one terminal on the switch and measure it. The instrument might send the measuring current around through other curcuitry.
Railroader:
What value do You read?
Disconnect one terminal on the switch and measure it. The instrument might send the measuring current around through other curcuitry.
I read 200k or something..
Time to replace that switch.
blh64:
Time to replace that switch.
Yeah, no doubt, only thing is that I did that already one time. Then it was ok for only a while.. not sure why they are dying. I was thinking maybe it's not suitable for the pc817 board or so? Or it can't handle 12v? (Sounds not logical to me) But I couldn't find a datasheet.
https://www.amazon.com/Pokerty-Joystick-Replacement-Operation-Fighting/dp/B0812357YH
frankvanderkruijs:
I read 200k or something..
With disconnected lead/leads?
Railroader:
With disconnected lead/leads?
Yes. I'm wondering if I am connecting the pc817 board right. I use 12v on in1 and on the other side v1 is connected to my input. Ground is connected to my esp ground which is coming from the same 12v battery.
Here is a schematic of a port on the board. Why is the 3k resistor used? Does it matter to a input?


The 3 k resistor below V1 looks like removable in Your application.
HI,
Are you using a ready made 817 board or just the 817 chip?
If a board can you please post a picture/link to its specs please?
If you are using just the IC.
Volt drop across 817 LED = 1.2V
Volt drop across LED = 1.6V
If using UNO, then output signal = 5V
Series resistor = 3000R
Voltdrop across the 3000R is 5 - ( 1.2 + 1.6 ) = 5 - 2.8 = 2.2V
Current through 3000R and so through the 817 LED
2.2 / 3000 = 0.0007 A == 0.7mA
The 817 LED needs up to 50mA
So say 20mA to see.
So series resistor should be:
2.2 / 0.02 = 110R
Use 120R
See what happens.
You could check by measuring the output pin of the 817 to see if it changes.
We need a proper circuit diagram, including power supplies and switch connections.
Thanks.. Tom.. ![]()
PS. What DMM do you have?
Railroader:
The 3 k resistor below V1 looks like removable in Your application.
It's mounted on a prefab board. So not easy to remove. But does it matter if I leave it? You will have a voltage divider but because the internal pull up resistance is way higher,It will still work in my opinion. In what situation it would be usefull? When you power a led from it or?
Btw I disconnected the joystick and when I measure directly on the pins I measure 20k in open state. This was also the value with one lead. Not 200k. It's totally strange to me because it's the second time..
TomGeorge:
HI,
Are you using a ready made 817 board or just the 817 chip?
If a board can you please post a picture/link to its specs please?If you are using just the IC.
Volt drop across 817 LED = 1.2V
Volt drop across LED = 1.6V
If using UNO, then output signal = 5V
Series resistor = 3000RVoltdrop across the 3000R is 5 - ( 1.2 + 1.6 ) = 5 - 2.8 = 2.2V
Current through 3000R and so through the 817 LED
2.2 / 3000 = 0.0007 A == 0.7mA
The 817 LED needs up to 50mA
So say 20mA to see.So series resistor should be:
2.2 / 0.02 = 110R
Use 120RSee what happens.
You could check by measuring the output pin of the 817 to see if it changes.
We need a proper circuit diagram, including power supplies and switch connections.
Thanks.. Tom..
PS. What DMM do you have?
Hi Tom,
I use the ready made board, I tried to make an schematic below. I also inserted a picture of my DMM.


Hi,
Good nice Fluke.. ![]()
Does the 817 board already have a series resistor onboard?
Can you post a picture of it please.
A picture of a hand drawn night have been easier. ![]()
Thanks.. Tom.. ![]()
PS, I'll redo the calcs when I find out about the opto.

TomGeorge:
Hi,
Good nice Fluke..Does the 817 board already have a series resistor onboard?
Can you post a picture of it please.A picture of a hand drawn night have been easier.
Thanks.. Tom..
PS, I'll redo the calcs when I find out about the opto.
It has a resistor at the output side as well indeed.

Hi, what is the input series resistor?
From specs.
Product Introduction:
- Driving Port Signal Voltage:3.6-24V
So 3V3 from the ESP32 will not be able to reliably operate the opto.
That 3K resistor is a compromise to allow industrial 24V systems to operate it.
You need to parallel another resistor with the 3K series input to get enough current from the 3V3 logic to reliably operate the LED in the opto.
Tom... ![]()
TomGeorge:
Hi, what is the input series resistor?From specs.
So 3V3 from the ESP32 will not be able to reliably operate the opto.
That 3K resistor is a compromise to allow industrial 24V systems to operate it.
You need to parallel another resistor with the 3K series input to get enough current from the 3V3 logic to reliably operate the LED in the opto.Tom...
Hi Tom, I use the opto as an input. Not as an output. As you can see in the diagram. So the 12v is turning on the led. Which is working. The other side is connected to input pin and ground.
Hi,
Product Introduction:
- Driving Port Signal Voltage:3.6-24V
2. Output Port Voltage Port:3.6-30V
I presume you only have 3V3 as the applied voltage via internal pull-up and the 3K on the PCB makes it troublesome.
Can I suggest you measure the voltage going into the ESP32 input pin under closed and open applications of the 12V input.
You may need to add an external pullup rather than use the relatively high internal pullup of the ESP32.
Tom... ![]()
PS. The internal pullups can be from 30K to 80K, the value is different from ESP32 to ESP32.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.