diff --git a/README.md b/README.md index 6fb16b7..b6a38f1 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,11 @@ At this point, everytime the relay closes the circuit, apart from the "click" so Notice that we're using GPIO5 in the board when creating the `cs` object and channel #5 on the MCP chip when creating the `analog_ic` object, respectively: +**Note**: The MCP3008 allows up to 8 different sensors in its 8 different channels. One only has to create: +- another `digitalio.DigitalInOut` object using the same pin on the raspberry pi (GPIO5 in our case) +- another `MCP.MCP3008` object using the new `DigitalInOut` +- another `AnalogIn` object with the correspondig MCP channel. + ```python linenums="1" import adafruit_mcp3xxx.mcp3008 as MCP @@ -92,10 +97,13 @@ def test_sensor_in_out_water(): spi = busio.SPI(clock=board.SCK, MISO=board.MISO, MOSI=board.MOSI) # create the chip select cs = digitalio.DigitalInOut(board.D5) + #cs_2 = digitalio.DigitalInOut(board.D5) # create the mcp object mcp = MCP.MCP3008(spi, cs) + # mcp_2 = MCP.MCP3008(spi, cs_2) # create an analog input channel on pin 5 analog_ic = AnalogIn(mcp, MCP.P5) + # analog_ic_2 = AnalogIn(mcp_2, MCP.P6) try: while True: print(f"ADC Voltage value: {analog_ic.voltage:.3f}") @@ -131,4 +139,10 @@ def test_relay_on_off(rly=None): time.sleep(1) except KeyboardInterrupt: gp.cleanup() -``` \ No newline at end of file +``` + +## To-Do + +[] Integrate Telegram bot to allow `water-on-demand` + +[] Monitor moisture levels in Grafana \ No newline at end of file