Hello.
I am using a bunch of PCF8574 devices to detect pushes on momentary switches. Unfortunately I ran out of those, so I thought I could use a few spare ADS1115 single ended to the same purpose as this is just input.
Unfortunately, the ADS1115 Analog input plugin doesn't seem to be enough, as it requires at least 1s delay. I hacked the code to remove such restriction, but didn't succeed.
Before I jump into trying to write a plugin for that based on PCF8574 Switch, I am wondering if somebody tried the same before.
ADS1115 as Switch Input
Moderators: grovkillen, Stuntteam, TD-er
Re: ADS1115 as Switch Input
What other I/O boards do you have laying around? Maybe a MCP23017? With that controller you can connect up to 16 buttons (and AFAIR 12 for the PCF8574) when using the Keypad PCF8574/MCP23017 plugin from the Testing build. It may need some careful wiring if the switches aren't close to the controller, as they can't pull to ground on close but have to connect a point in the keypad matrix.
/Ton (PayPal.me)
Re: ADS1115 as Switch Input
Hey
So this is a home automation system. I have 8ch mains detector boards (like this: https://www.aliexpress.com/item/3285379 ... 4c4dOxXHBr) wired to PCF8574, and on the other end, common relay boards also attached to PCF8574. So, the mains momentary switches are pushed the optocoupler of these boards are LOW. So it works fine with inverted logic.
Although since the switches are just for input, I should be able to work with these ADS1115 without much trouble, as this is just input anyways... So, if value is higher than a set threshold, that is 1 or 0, pretty much.
That's unfortunately the only things I have around for now.
Thanks
So this is a home automation system. I have 8ch mains detector boards (like this: https://www.aliexpress.com/item/3285379 ... 4c4dOxXHBr) wired to PCF8574, and on the other end, common relay boards also attached to PCF8574. So, the mains momentary switches are pushed the optocoupler of these boards are LOW. So it works fine with inverted logic.
Although since the switches are just for input, I should be able to work with these ADS1115 without much trouble, as this is just input anyways... So, if value is higher than a set threshold, that is 1 or 0, pretty much.
That's unfortunately the only things I have around for now.
Thanks
Re: ADS1115 as Switch Input
Ah, I already was afraid you were going to say something like that
When you tried to modify the plugin, did you add 'case PLUGIN_TEN_PER_SECOND:' just above the line with 'case PLUGIN_READ:' so the values are read 10 times per second, and if the response is (still) too slow, you could even try PLUGIN_50_PER_SECOND (the names do as they suggest )
And you might want to add 'sendData(event);' in there too, just before the 'success = true;' statement, to start sending out the value to any controllers configured (maybe that should only happen 'if (function != PLUGIN_READ)', as I think the PLUGIN_READ action already does that sendData call)
(All air-code, didn't test any of the above...)
When you tried to modify the plugin, did you add 'case PLUGIN_TEN_PER_SECOND:' just above the line with 'case PLUGIN_READ:' so the values are read 10 times per second, and if the response is (still) too slow, you could even try PLUGIN_50_PER_SECOND (the names do as they suggest )
And you might want to add 'sendData(event);' in there too, just before the 'success = true;' statement, to start sending out the value to any controllers configured (maybe that should only happen 'if (function != PLUGIN_READ)', as I think the PLUGIN_READ action already does that sendData call)
(All air-code, didn't test any of the above...)
/Ton (PayPal.me)
Re: ADS1115 as Switch Input
Please make sure to only call 'sendData(event);' when there has been a change.
It does set a whole chain of events in motion, so if you call it on every call to PLUGIN_FIFTY_PER_SECOND, then I can tell you it won't run at 50 times a second anymore
It does set a whole chain of events in motion, so if you call it on every call to PLUGIN_FIFTY_PER_SECOND, then I can tell you it won't run at 50 times a second anymore
Who is online
Users browsing this forum: No registered users and 34 guests