petermeigs
Posts: 97
Joined: Thu Mar 23, 2017 1:34 pm
Location: Los Altos, California

Re: GPIO.input voltage levels vs edge detection

Wed Aug 22, 2018 8:08 pm

Hi, I also found this product on Amazon: AUSTIN'S PROJECT Power Sense Module. Its a bit pricey for the 16 channels I need. I found this when searching for a MID400 (also a bit pricey) but the oscilloscope output the description included was the picture I am looking for!

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: GPIO.input voltage levels vs edge detection

Wed Aug 22, 2018 8:32 pm

The MID400 also looks like a usable IC for this task. And it is indeed a priced board. However you could make it by yourself, for example buy one and copy paste.
However, I don't see a capacitor at the aux connection. And this is something that we want. See the application-notes for the MID400.

Apparently I forget about the MID400 :?
Brandon92 wrote:
Mon Aug 06, 2018 5:29 pm
EDIT (sorry for the double post, but my images are disappear if I edit the post above)

To give a little more information about how to use the optocouplers. Some more interesting links:
Application note optocoupler
Datasheet MIC400
Application note MIC400
Datasheet HCPL3700
Application Notes - A Guide to Designing With Optocouplers

petermeigs
Posts: 97
Joined: Thu Mar 23, 2017 1:34 pm
Location: Los Altos, California

Re: GPIO.input voltage levels vs edge detection

Thu Aug 23, 2018 2:26 am

Here is a discussion that talks about using the HCPL3700 / a3700:
https://forum.arduino.cc/index.php?topic=231671.0
I'm also having trouble getting the device to do something, all for the same newbie reasons. :oops:
They also found the same datasheet and the app note I found. I'll dig into this and see if they can sort me out.

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: GPIO.input voltage levels vs edge detection

Thu Aug 23, 2018 4:23 am

Ehm okay. How did you connect the device and how wit you connect it to your pi. And what code are you using.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Thu Aug 23, 2018 7:19 am

Brandon92 wrote:
Thu Aug 23, 2018 4:23 am
Ehm okay. How did you connect the device and how wit you connect it to your pi. And what code are you using.

HCPL3700 Preliminary Test

If my toys arrive, I will first do a on table, no Rpi, DC 5V dry run. :) See Fig 9 below.

I think:

  • 1. If input A is 5V, output B should be 0V
  • 2. If input A is 0V, output B should b 5V
Warning: There is 5% chance you will fry you toy. You might like to wait for me to to try my luck first. My toy is only 2 yuan each. :mrgreen:
Attachments
7iQXNIW[1].jpg
7iQXNIW[1].jpg (242.24 KiB) Viewed 3663 times
I am an electronics and smart home hobbyist.

petermeigs
Posts: 97
Joined: Thu Mar 23, 2017 1:34 pm
Location: Los Altos, California

Re: GPIO.input voltage levels vs edge detection

Thu Aug 23, 2018 9:01 pm

I like the idea of testing with just a voltmeter and a 5v power supply. That way we limit the damage to our other stuff until we are ready for the next step. We could go crazy and add an led on the output side...

Here is the circuit I am using derived from yours and figure 10 of the datasheet.
a3700Test.PNG
a3700Test.PNG (11.61 KiB) Viewed 3649 times
C1 is suggested to be .1uF

C2 is 30pF for probe and stray wiring

R1 - This is to limit current through internal bridge and internal led. In the App note 1004 there is an extensive calculation for this but I haven't gotten my mind around it yet. Any suggestions here? The next step will be to try the 24vac across 1 and 4. Any idea what resistance to use here? (I guess I could read the datasheet and app note but I'm willing for someone to tell me so when I go try to figure it out, I can have an answer to work towards)

R2 - This is a pull up resistor. I'd think 10k would be good enough.

In Figure 10, I see that they connect 3 to 4 for off and connect to the voltage source for on. I'm assuming just removing voltage across 3 and 4 is enough. Do you agree?

There has been discussion about a flyback diode to deal with the effect of losing power to the solenoid for the water valve. We have an ac solenoid so I'm not sure what that does to us. Any suggestions on how to deal with this would be appreciated.

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: GPIO.input voltage levels vs edge detection

Thu Aug 23, 2018 9:38 pm

For the first try I think I would use for R1: (Vg2 - Vth+)/ITH+ = (5-3.8)/2.5mA = 480 Ohm.
So, you might need 2*240 Ohm (can you tell me why?) But you could test it first with one. This is also stated in the application note (example 1). And for R2 I would take 1k.
petermeigs wrote:
Thu Aug 23, 2018 9:01 pm
There has been discussion about a flyback diode to deal with the effect of losing power to the solenoid for the water valve.
I thought the relay was driven by a DC voltage, so forget about that one. If you want to make it robust. See figure 15 from the application not for example.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 1:56 am

petermeigs wrote:
Wed Aug 22, 2018 2:19 am
1. I started looking at the A3700 first. This is supposed to be equivalent to HCPL3700 and I have found the following app note:

http://www.slottechforum.com/slotinfo/T ... 20note.pdf

and I think this is the datasheet:

http://www.mouser.com/ds/2/149/HCPL3700M-837969.pdf

2. I'm taking a look at Example 3 - to monitor a computer powerline to sense a loss of line power condition" in the application note

3. This document references a PIA (a peripheral interface adapter). I'm hoping that will be Pin 25 on my raspberry pi with a nice clean edge (or level) but we'll see.

Just a quick answer to 3.

The app note by Agilent Tech is dated 1999, 18 years ago! I skimmed through the app note and found them referring to the very old Motorola PIA M6821, which no body uses nowadays. You only find it in the computer museum. :mrgreen:

I think there is 99% chance that you can safely replace the PIA pins by Rpi GPIO pins.
For me, I will be using MCP23017 GPIO pins, because I don't want to fry my Rpi! :)

Appendices - HCPL3700 references

Threshold Sensing for Industrial Control Systems with the HCPL-3700 Interface Optocoupler Application Note 1004 - Agilent Technologies 1999
http://www.slottechforum.com/slotinfo/T ... 20note.pdf

Power Line Monitoring (MID400) App Note 3007 - Fairchild 2016
https://www.fairchildsemi.com/applicati ... N-3007.pdf
Last edited by tlfong01 on Sun Aug 26, 2018 3:08 am, edited 2 times in total.
I am an electronics and smart home hobbyist.

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 5:34 am

tlfong01 wrote:
Fri Aug 24, 2018 1:56 am
I think there is 99% chance that you can safely replace the PIA pins by Rpi GPIO pins.
For me, I will be using MCP23017 GPIO pins, because I don't want to fry my Rpi! :)
If you connect it in the right way and use the right voltage. Your RPi will survive it :)

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 7:21 am

HCPL3700 Datasheet and Application Notes Reading Notes

I read the HCPL3700 datasheet first and found many things unclear, including the following:

1. How to use a resistor to set voltage and/or current to detect.

2. I forgot, ...

Then next I read the Agilent Tech app notes but found it very boring, because I don't like reading numbers and calculations.

I did not read the Fairchild app notes first, because I thought it was only related to MID400. Since I am not going to use that, so I thought it would be a waste of time reading it.

Just now I quickly read the Fairchild app notes to confirm that is was indeed a wast of time, but very surprisingly found it a very good fundamental knowledge reading for the the newbies of the power-to-logic-interface.

Fairchild gives a very good concise summary to start with, then explains in details why this and that component are used this way and that way. I jotted down a few things that I should remember for understanding more later, including the following:

1. The input diode has 3 states, saturated, unsaturated, and off state. The respectively current values are (1) 4mA+ rms, (2) 0.15mA-, (3) in between

2. In the unsaturated state, the device output is like a 120Hz (or 220Hz) signal generator.

3. The555 timer is still useful in modern days applications. I always thought that 555 is only for hobbyists and hesitate to let other people know that I am still using this old thing, thus losing face and damaging my reputation.

Appendices - HCPL3700 references

Threshold Sensing for Industrial Control Systems with the HCPL-3700 Interface Optocoupler Application Note 1004 - Agilent Technologies 1999
http://www.slottechforum.com/slotinfo/T ... 20note.pdf

Power Line Monitoring (MID400) App Note 3007 - Fairchild 2016
https://www.fairchildsemi.com/applicati ... N-3007.pdf

HCPL3700 Datasheet - FairChild 2016
http://www.mouser.com/ds/2/149/HCPL3700M-837969.pdf
Last edited by tlfong01 on Sat Aug 25, 2018 1:07 am, edited 1 time in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 8:10 am

petermeigs wrote:
Thu Aug 23, 2018 9:01 pm
1. R1 - This is to limit current through internal bridge and internal led.

2. In the App note 1004 there is an extensive calculation for this but I haven't gotten my mind around it yet. Any suggestions here?

3. The next step will be to try the 24vac across 1 and 4. Any idea what resistance to use here?

4. In Figure 10, I see that they connect 3 to 4 for off and connect to the voltage source for on. I'm assuming just removing voltage across 3 and 4 is enough. Do you agree?

5. There has been discussion about a flyback diode to deal with the effect of losing power to the solenoid for the water valve. We have an ac solenoid so I'm not sure what that does to us. Any suggestions on how to deal with this would be appreciated.

HCPL3700 Testing Setup Notes

  • 1. I think R1, Rx, or Zo is used to set the AC/DC voltage level you want to detect.
  • 2. I usually skip all equations. I think the two graphs (Fig 7, 11) can save us from calculations.
  • 3. I think the above graphs can help us. For 24V AC, the resistance Zo should be somewhere between 5K to 20K. So I will use a ten turn 20K trim pot to find out by trial and error.
  • 4. Figure 10, perhaps later.
  • 5. Back EMF, EMI etc - perhaps later.
Attachments
8bfX0Ml[1].jpg
8bfX0Ml[1].jpg (191.08 KiB) Viewed 3587 times
Last edited by tlfong01 on Fri Aug 24, 2018 9:34 am, edited 1 time in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 8:49 am

Brandon92 wrote:
Fri Aug 24, 2018 5:34 am
tlfong01 wrote:
Fri Aug 24, 2018 1:56 am
I think there is 99% chance that you can safely replace the PIA pins by Rpi GPIO pins.
For me, I will be using MCP23017 GPIO pins, because I don't want to fry my Rpi! :)
If you connect it in the right way and use the right voltage. Your RPi will survive it :)


Rpi GPIO is easy, MCP23017 GPIO is hard

Well, there is another important reason I told your earlier when explaining why I don't go the easy linux kernal driver way for DS3231 and DHT22, but use MCP23017 instead, because I learn more new things the hard way.
I am an electronics and smart home hobbyist.

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 1:40 pm

tlfong01 wrote:
Fri Aug 24, 2018 8:49 am
Brandon92 wrote:
Fri Aug 24, 2018 5:34 am
tlfong01 wrote:
Fri Aug 24, 2018 1:56 am
I think there is 99% chance that you can safely replace the PIA pins by Rpi GPIO pins.
For me, I will be using MCP23017 GPIO pins, because I don't want to fry my Rpi! :)
If you connect it in the right way and use the right voltage. Your RPi will survive it :)


Rpi GPIO is easy, MCP23017 GPIO is hard

Well, there is another important reason I told your earlier when explaining why I don't go the easy linux kernal driver way for DS3231 and DHT22, but use MCP23017 instead, because I learn more new things the hard way.
I meant that you Rpi could not be damaged, if you connect this chip to it. And it has nothing to do with the MCP*. And in some cases you want to use your Rpi, if you need to time it precisely without a additional delay.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 1:54 pm

tlfong01 wrote:
Fri Aug 24, 2018 8:10 am
petermeigs wrote:
Thu Aug 23, 2018 9:01 pm
4. In Figure 10, I see that they connect 3 to 4 for off and connect to the voltage source for on. I'm assuming just removing voltage across 3 and 4 is enough. Do you agree?

5. There has been discussion about a flyback diode to deal with the effect of losing power to the solenoid for the water valve. We have an ac solenoid so I'm not sure what that does to us. Any suggestions on how to deal with this would be appreciated.
  • 4. Figure 10, perhaps later.
  • 5. Back EMF, EMI etc - perhaps later.

4. I didn't catch your question of Figure 10. Do you really mean Figure 10, or you might elaborate a bit.

5. There are two problems a. EMF and b. EMI:

  • a. Back EMF (Electromotive Force) problem is related to the relay coil. The solution is using a flyback diode. One more protection is to use optoisolated relay
.
  • b. EMI (Electromagnetic Inference) problem is related to the NO (Normally Open) relay contact. One solution is to add surge protector. We can discuss this later.
I am an electronics and smart home hobbyist.

petermeigs
Posts: 97
Joined: Thu Mar 23, 2017 1:34 pm
Location: Los Altos, California

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 2:56 pm

tlfong01 wrote:
Fri Aug 24, 2018 1:54 pm
4. I didn't catch your question of Figure 10. Do you really mean Figure 10, or you might elaborate a bit.
I was referring to the last page of the hcpl3700 datasheet where there seems to be an A-B switch that either
provides Vff+ to pin 3 DC+ or shorts pins 2 DC+ and pin 3 DC-

I see the confusion. I have been looking at the Rev 1.0.3 of the HCPL3700 Datasheet from 2005. The one you
reference is Rev 1.1 dated 2015. In Rev 1.1 it is figure 12. This is my error and I am changing to the more modern datasheet.

Thanks for the tip about getting the Rx values from the graphs. That will at least give us a sanity check on the values we calculate. I also like the idea of a pot to make trial by error for the resistor. Since the lowest valuse would be 5k, we can put a 5k on one side and a 20k variable on the other.

I'm a little worried I have fried my A3700 with earlier tests. I have a few more but I'm hesitant to go on to the next until I'm convinced the first one is damaged. I don't want to fry them all one by one.

I have ordered some of the parts discussed here (the low cost ones anyway). Once we get the A3700 working, we can see if it has vertical enough edges for on and off for RPi edge detection to work without the pesky bounces at shutoff time. Getting back to what I was originally trying to do, the A3700 is nice as it is not too expensive for the 16 channels I need and I think it will simplify the circuit a lot. If the edge is
not steep enough, perhaps a Schmidt Trigger can be added, with the added advantage that it will reverse the logic so that on is on and off is off.

My next step is to build a test circuit and see it I can get it to produce expected results. I'll report on what works.

All the comments have been very helpful. I'm learning a lot and am also learning techniques on how to read the docs. - Thanks

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 3:06 pm

I think you need a lower value, if you are using it with a 5v power supply. See my post with the calculation and reference.

petermeigs
Posts: 97
Joined: Thu Mar 23, 2017 1:34 pm
Location: Los Altos, California

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 7:54 pm

The following works with 5vdc power. Press the button and the led goes on. Release and it goes off.
a3700Works5vdc.PNG
a3700Works5vdc.PNG (12.61 KiB) Viewed 3532 times
I used a 1k breadboard potentiometer (thanks for the tip) to roughly find the threshold where the led would come on. It happened at about 310 ohms and continued to work at lower resistances. I chose 220 because it was one I had and it was not far from the 280 suggested. I measured r1 amperage at 2.1 ma making the power dissipation 10.5 mW well under the 230 in the Abs Max Ratings and I-in well under the 50 average max. I'm happy to report that I did NOT fry my chip, at least pins 2,3,5,6 and 8. Next, I will try this same type of thing with my 24vac on pins 1 and 5. We're getting closer! :D

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 8:06 pm

Nice to hear that it is working.
If you going to use the 24vac, don't use the dc input, pin 1&4 ;p
If you are going to do the calculations don't forget the maximum voltage. 24*sqrt(2) or 24*1.414 =34v :)

petermeigs
Posts: 97
Joined: Thu Mar 23, 2017 1:34 pm
Location: Los Altos, California

Re: GPIO.input voltage levels vs edge detection

Fri Aug 24, 2018 11:00 pm

Brandon92 wrote:
Fri Aug 24, 2018 8:06 pm
If you going to use the 24vac, don't use the dc input, pin 1&4
If you are going to do the calculations don't forget the maximum voltage. 24*sqrt(2) or 24*1.414 =34v :)
You are right -- I blame my fingers for typing the wrong numbers. Should be 1 and 4. And thanks for the 1.414 factor. I knew that but had forgotten it in this case (or so I claim). In any event, I'll use a potentiometer to make the resistance too high and drop it down slowly until it works. Then I'll measure the resistance of the potentiometer. Then I'll check the calculations to verify theory against actual.

(30 mins later) I just tested 24vac and it works with 11.8k resistor in series with the ac supply. I used a 10k on one side and a 1.8k on the other. Adjusting a potentiometer and retrying, I can see that it does not work when the resistance is 13.3k. It's hard to tell exactly where in between the dividing line is. A couple of times I could see the led flicker but did not measure the resistance at that point.

If I use the 24vac as my voltage, then the resistance for 2.1 mA would be 11.4k. Even at peak voltage 34v, the current would be a little under 3mA, well under the maximum of 50mA max average.

I wonder if there is any advantage of making the current higher. I think I have plenty of capacity on my 24vac circuit when the ac solenoid is on. I tested 2 x 4.7k and they would work, as well drawing a calculated 3.6mA at peak and 2.5mA using the 24vac value. (I don't have an ac ammeter)

Another question I have is that I see the resistor in series with the ac is split between pin 1 and pin 4. Why is that? In my case, it is convenient to use two resistors because I have a 10k and a 1.8k but is there a safety reason for doing this? With 24vac, we may not have this concern but with lethal one, perhaps the is a reason for this. Any ideas here?

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Sat Aug 25, 2018 4:08 am

petermeigs wrote:
Fri Aug 24, 2018 2:56 pm
tlfong01 wrote:
Fri Aug 24, 2018 1:54 pm
4. I didn't catch your question of Figure 10. Do you really mean Figure 10
I see the confusion. I have been looking at the Rev 1.0.3 of the HCPL3700 Datasheet from 2005. The one you reference is Rev 1.1 dated 2015. In Rev 1.1 it is figure 12. This is my error and I am changing to the more modern datasheet.

HCPL3700 Summary Notes

Good. Now I see why I was confused. I read the datasheet one more time and made a summary. I might look at your question later.
Attachments
RNqog0C[1].jpg
RNqog0C[1].jpg (243.33 KiB) Viewed 3505 times
I am an electronics and smart home hobbyist.

petermeigs
Posts: 97
Joined: Thu Mar 23, 2017 1:34 pm
Location: Los Altos, California

Re: GPIO.input voltage levels vs edge detection

Sat Aug 25, 2018 5:20 am

I see the summary and can see the pages in the datasheet where it came from. A few of these items make sense to me but many of them I do not understand.For example: V-TH+ and V-TH- across pins 1,4 with pins 2,3 open. I am using 24vac and it is either on or off. I have V-cc = 5vdc. I'm a bit confused about what the lines for V-TH+ and V-TH- in the diagram are telling me. Many of the other lines in this table are cryptic to me. Any suggestions on what I might read to understand this datasheet better?

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Sat Aug 25, 2018 6:04 am

petermeigs wrote:
Sat Aug 25, 2018 5:20 am
I see the summary and can see the pages in the datasheet where it came from. A few of these items make sense to me but many of them I do not understand.For example: V-TH+ and V-TH- across pins 1,4 with pins 2,3 open. I am using 24vac and it is either on or off. I have V-cc = 5vdc. I'm a bit confused about what the lines for V-TH+ and V-TH- in the diagram are telling me. Many of the other lines in this table are cryptic to me. Any suggestions on what I might read to understand this datasheet better?

Hysteresis Basics

Ah, perhaps you are blocked by the idea of Hysteresis. You might like to read Wikipedia to refresh your memory on hysteresis. Skim first, skip what you don't understand, then read slowly the paragraph on Electronics Circuits, particularly on the Schmitt trigger graph.

Then try to understand the 2 little graphs on the left of the picture (Fig 2, 3) of my first old post below.

Or read my other post on Schmitt inverter. Fig 8, 9 are critical to understand the hysteresis idea.

Hysteresis - Wikipedia
https://en.wikipedia.org/wiki/Hysteresis

(HCPL3700 Basics) RE: GPIO.INPUT VOLTAGE LEVELS VS EDGE DETECTION Post by tlfong01 » 2018-Aug-24 Fri 4:10 pm
https://www.raspberrypi.org/forums/view ... 0#p1356966

(Schmitt Inverter HC14) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-23 Sat 10:49 pm
https://www.raspberrypi.org/forums/view ... 4#p1332019
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Sat Aug 25, 2018 8:04 am

tlfong01 wrote:
Sat Aug 25, 2018 6:04 am
Hysteresis Basics

I am tidying up my forum posts for reference when doing the HCPL3700 Test.

  • Link 16. is the dual psu for 5V DC testing.

  • Link 14/15. is the relay box for AC 12/24V testing.


Relay Hysteresis


1. (Relay Hysteresis) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jun-11 Mon 10:48 pm
https://www.raspberrypi.org/forums/view ... 5#p1326822

2. (Relay Hysteresis)RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jun-12 Tue 4:27 pm
https://www.raspberrypi.org/forums/view ... 5#p1327140

Relay Basics

3. (Surge Protection using Varister) RE: RELAY MODULE KY-019 5V Post tlfong01 » 2018-Jul-13 Fri 7:53 pm
https://www.raspberrypi.org/forums/view ... 0#p1340412

4. (optocoupler EL817/EL354) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jul-14 Sat 2:47 pm
https://www.raspberrypi.org/forums/view ... 0#p1340670

5. (Forbes Recommended Low Level Trigger Optoisolated 5V Relay) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jul-14 Sat 5:37 pm
https://www.raspberrypi.org/forums/view ... 0#p1340703
https://www.raspberrypi.org/forums/view ... 0#p1340696

6. (Low lewvel trigger total optoisolation) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-22 Fri 3:45 pm
https://www.raspberrypi.org/forums/view ... 5#p1331550

7. (KY019 BJT NPN High Trigger no Optoisolation Spec) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jun-02 Sat 10:10 pm
https://www.raspberrypi.org/forums/view ... 8#p1323061

8. (KY019 BJT NPN Thigh Trigger no Optoisolation Schematic) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-07 Thu 10:59 pm
https://www.raspberrypi.org/forums/view ... 5#p1325269

9. (Songle Realy Spec) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-06 Wed 3:23 pm
https://www.raspberrypi.org/forums/view ... 5#p1324588

10. (Schmitt Inverter HC74) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-23 Sat 3:10 pm
https://www.raspberrypi.org/forums/view ... 5#p1331903

11. (MCP23017 + ULN2803 Design) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-08 Fri 3:32 pm
https://www.raspberrypi.org/forums/view ... 5#p1325530

12. (Rpi pinout) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jul-18 Wed 9:35 pm
https://www.raspberrypi.org/forums/view ... 5#p1342280


Testing Setup

13. (3.3V/5V/12V PSU) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jul-08 Sun 10:50 pm
https://www.raspberrypi.org/forums/view ... 0#p1338325

14. (Relay Box Spec))KY019 5V Postby tlfong01 » 2018-Jul-14 Sat 9:38 pm
https://www.raspberrypi.org/forums/view ... 0#p1340760

15. (Relay Box Picture) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jul-02 Mon 6:13 pm
https://www.raspberrypi.org/forums/view ... 5#p1335685

16. (Dual PSU for Testing) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-19 Tue 4:22 pm
https://www.raspberrypi.org/forums/view ... p1330089
Last edited by tlfong01 on Sat Aug 25, 2018 12:20 pm, edited 1 time in total.
I am an electronics and smart home hobbyist.

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: GPIO.input voltage levels vs edge detection

Sat Aug 25, 2018 9:42 am

petermeigs wrote:
Fri Aug 24, 2018 11:00 pm
I wonder if there is any advantage of making the current higher. I think I have plenty of capacity on my 24vac circuit when the ac solenoid is on. I tested 2 x 4.7k and they would work, as well drawing a calculated 3.6mA at peak and 2.5mA using the 24vac value. (I don't have an ac ammeter)

Another question I have is that I see the resistor in series with the ac is split between pin 1 and pin 4. Why is that? In my case, it is convenient to use two resistors because I have a 10k and a 1.8k but is there a safety reason for doing this? With 24vac, we may not have this concern but with lethal one, perhaps the is a reason for this. Any ideas here?
If you apply a "higher" average current, this could have a positive effect on the working on the circuit. For example, if you calculate it with the minimum requirements. It will work. But if you there is a high load on the 24vac the voltage could be a bit lower. And possible the output of the device will give the "wrong" result. Or I need to say, it works good but you expect something else. If you increase the current, this problem could be solved.

The reason why you use two resistors are indeed for savety reason. And to share the dissipation of there powers. In the application note this is better explained and in more detail. Also there are giving a example of the so called hysteresis that tlfong01 explained.

If we forget to explain something or not clear, feel free to ask :)

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: GPIO.input voltage levels vs edge detection

Sat Aug 25, 2018 12:29 pm

tlfong01 wrote:
Sat Aug 25, 2018 8:04 am
I am tidying up my forum posts for reference when doing the HCPL3700 Test.
  • Link 16. is the dual psu for 5V DC testing.
  • Link 14/15. is the relay box for AC 12/24V testing.
14. (Relay Box Spec))KY019 5V Postby tlfong01 » 2018-Jul-14 Sat 9:38 pm
https://www.raspberrypi.org/forums/view ... 0#p1340760
15. (Relay Box Picture) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jul-02 Mon 6:13 pm
https://www.raspberrypi.org/forums/view ... 5#p1335685
16. (Dual PSU for Testing) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-19 Tue 4:22 pm
https://www.raspberrypi.org/forums/view ... #p1330089

My toys arrive today. I checked that they look OK, same lot (2016 week 31), marking sharp, pins no bending.

HCPL3700 Datasheet - FairChild 2016
http://www.mouser.com/ds/2/149/HCPL3700M-837969.pdf
Attachments
7v6Oe4a[1].jpg
7v6Oe4a[1].jpg (106.23 KiB) Viewed 3448 times
Last edited by tlfong01 on Sat Aug 25, 2018 12:43 pm, edited 1 time in total.
I am an electronics and smart home hobbyist.

Return to “Python”