Week 4: June 2nd - June 8th
- persaudpremnauth
- Jun 9
- 2 min read
Individual Log - Prem
Since the logic controller operated on 12V and all GPIO pins had a maximum threshold of 3.3V, circuits needed to be designed to buffer these inputs and outputs to prevent damage or malfunction of the MCU.
The first input was the generator detection which will be used to send wake and sleep commands to the rest of the system. The MCU has a 3.3V regulated output, so this was fed back into the logic controller, and through a pull-up resistor, the LM311 will create an active low command that has a range of 0-3.3V.
The next circuit was the moisture sensor, which already creates an active low signal, but with a range of 0-12V. A voltage divider was used to reduce this range down to 0-3.3V for interpretation of the MCU.
A voltage division circuit was designed for the temperature input after determining that the temperature sensor had a 50K ohm NTC thermistor. A lookup table was referenced, and if a range of 32F to 150F was used for this thermistor, it will have resistance values of 170K ohm and 8K ohm respectively. With this range know, a 470k ohm resistor was added create a voltage range of 0.213-3.19V for the ADC input.
Lastly, a drive transistor was added to the previous SPDT relay used to control the valves, because, at rest, the relay has 12V present on input side of the coil, which would have damaged the MCU if it was connected directly. Another SPDT relay was also added to apply full power to park the valves in purge mode whenever the faucet has been turned off.

All of these inputs and outputs were tested with Conner, and the MCU was able to detect them in addition to controlling the valves based on input commands. The picture below shows all of the added inputs and outputs of the logic controller.

The recirculation pump was also tested, and it purges the hot water line reliably. Various triggers were discussed with Zach and Conner, and a motion detection was determined to be the most effective trigger mechanism for this pump.
Comments