Having got the sensor module working, I shifted my attention to the Actuator module. This is built on an identical board to the Sensor Module, but has the following connectors instead of the I2C bus connectors:
- Interface to relay board. I'm using a separate, but cheap, Arduino two-channel relay board. This requires a 5V power supply, but can be interfaced to the controller at 3.3V. Some people have said this is unreliable. Thus far, I've had no problems at all, but if it becomes an issue, it's just a matter or replacing a couple of resistors on the relay board. Ultimately, I'd like to combine this into a single board with the controller.
- Connections for two push buttons. To save GPIO pins, these modify a potential divider to produce one of four different voltages for the ADC pin on the Thing.
- Connections for a rain sensor. This is another separate board that provides a digital signal when the sensors gets wet.
At the moment, I only have the relay board connected. I've updated the Actuator sketch to control the relays, operating the vent motors. One issue that I currently have is that there's no feedback loop for me to know the actual vent position. Instead, the Actuator module forces the vents closed when it boots, thus giving me a 'known state'. The original vent controller didn't do this, which was a problem if it had to be restarted or the power failed. It's also responding to commands over MQTT to set the vent position. This is how the system will ultimately function; an external cloud-based service will determine the desired vent position from the sensor data and send a message to the Actuator Module over MQTT to establish that position. At the moment, my test service sends random position commands to the module, so it's sitting here clicking relays on and off on an irregular basis.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.