-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Enable one or more A/D inputs already on the STM8S #224
Comments
A prototype of this function is in test now. If anyone wants to participate in test (in addition to me and the requestor) respond on this Issue. No GUI at this point, just a bare bones test prototype.
Possible improvement: When the ADC period is set to 100 ms MQTT gets flooded with messages. Each ADC input produces a message every 100ms, so that's 20 messages per second, even if the inputs are not changing. A possible improvement is to only send a message if the input changed from the previous sample, perhaps with a minimum transmit period of 5 seconds (or 10 or 20 ... something just to maintain confidence it is working). This would minimize messaging when the inputs are static, and maximize messaging when the inputs are changing. I'm still not sure how we'll make sure we aren't over-running the transmit queue when messages are attempting 100ms refresh periods. |
Until the requestor is ready to perform Beta testing I will withhold this feature from general release. |
A request was made by email to enable one or two A/D inputs already on the STM8S. I've always resisted this because it requires modifying the HW-584 by removing a couple of resistors if present (BR4 and/or BR5), then attaching wires to enable connection of the A/D inputs. This requires some skill to avoid damaging the HW-584. The requestor seems to have this skill, so I will look into the request more closely. (Note to self: email 3/5/2024).
The basic concept:
Attach wires to the two pads pointed to by the arrows in this picture.
Bring those wires out to an externally accessible pin or connector. How this is done will have to be left up to individual preference.
Firmware will collect data from the A/D connected to those pins and will report it as a sensor value in a Home Assistant MQTT payload. For now I'm not planning any reporting via the Browser GUI.
Add a checkbox in the GUI to enable use of the pins as A/D inputs. This is necessary so that the float protection pullup is removed from the pins with the assumption that the user has implemented appropriate external circuitry.
The A/D on the STM8S only measure voltages from 0 to 3.3V, so the user would have to build their own hardware to make sure they protect the input from over/under voltage, and would require a divider scheme to re-range voltages that exceed those limits. Not rocket science, but they need to know what they are doing. Whatever appears on the pin could then be sent to a requestor via MQTT. Then the user would need to write their own MQTT integration (in Home Assistant or Domoticz) to interpret the value into human readable form.
The text was updated successfully, but these errors were encountered: