Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using 5v-12v as input sensor
#20
Ok, well I've made some progress... the good news is that I think 12V NPN NO sensors _will_ work the way as was expected above, directly connecting the signal output to a DI pin. Have not tested with 5V yet, and I'm fairly sure that PNP won't work at all without some sort of additional transistor circuit (e.g. an 2N2222 would probably do the job).

The bad news (and the reason why it took so long to confirm the point above.....) is that there appears to be a bug in the PCF8574 library which Kincony use in their demo scripts, that causes the values returned by digitalRead() to be zero if you call it twice in quick succession (it seems related to the internal buffering it employs here: https://github.com/xreef/PCF8574_library...4.cpp#L869 )

But switching to using Rob Tillaart's library instead, I can consistently read a NPN sensor at least! https://github.com/RobTillaart/PCF8574
Reply


Messages In This Thread
using 5v-12v as input sensor - by amararsa24s - 09-08-2024, 11:05 AM
RE: using 5v-12v as input sensor - by admin - 09-08-2024, 11:26 AM
RE: using 5v-12v as input sensor - by amararsa24s - 09-09-2024, 07:08 PM
RE: using 5v-12v as input sensor - by amararsa24s - 09-09-2024, 06:10 PM
RE: using 5v-12v as input sensor - by admin - 09-09-2024, 11:03 PM
RE: using 5v-12v as input sensor - by amararsa24s - 09-10-2024, 07:32 AM
RE: using 5v-12v as input sensor - by amararsa24s - 09-11-2024, 05:08 PM
RE: using 5v-12v as input sensor - by admin - 09-11-2024, 11:42 PM
RE: using 5v-12v as input sensor - by amararsa24s - 09-12-2024, 06:31 AM
RE: using 5v-12v as input sensor - by amararsa24s - 09-14-2024, 11:11 PM
RE: using 5v-12v as input sensor - by tanoshimi - 02-01-2025, 03:01 PM
RE: using 5v-12v as input sensor - by twostar - 02-02-2025, 12:13 AM
RE: using 5v-12v as input sensor - by admin - 02-02-2025, 12:39 AM
RE: using 5v-12v as input sensor - by tanoshimi - 02-02-2025, 09:28 AM
RE: using 5v-12v as input sensor - by twostar - 02-02-2025, 10:04 AM
RE: using 5v-12v as input sensor - by tanoshimi - 02-02-2025, 10:26 AM
RE: using 5v-12v as input sensor - by twostar - 02-02-2025, 10:35 AM
RE: using 5v-12v as input sensor - by tanoshimi - 02-02-2025, 10:44 AM
RE: using 5v-12v as input sensor - by twostar - 02-02-2025, 11:21 AM
RE: using 5v-12v as input sensor - by tanoshimi - 02-02-2025, 07:47 PM
RE: using 5v-12v as input sensor - by twostar - 02-03-2025, 03:44 AM
RE: using 5v-12v as input sensor - by tanoshimi - 02-03-2025, 07:56 AM
RE: using 5v-12v as input sensor - by admin - 02-03-2025, 05:32 AM
RE: using 5v-12v as input sensor - by twostar - 02-03-2025, 05:35 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)