I have 4 24v solenoid valve that control an irrigation system. The controller has failed the M5Stack relay Controller appeared in a deal list, seeing i2c and the relay specs impulse buy made. Having looked for python code to use with a spare Rpi quickly discovered that it doesn’t exist :( .
Is there a way of being able to switch one relay on (sending 24v dc to one of the solenoid valves until switched off). The code would need to switch each solenoid valve on for a period of minutes then off in turn then sleep for a period of time (usually 24hrs.
Seems to be three options:
- write something in an RPi language if it is possible.
- get an Arduino board or emulator and link that to the Rpi and M5Stack module
- Cancel the order and look for an alternative.
I am a novice at writing code but have managed to get a cambot working using i2c components which came with set up code.
Help, ideas, or observations will be gratefully received!!
Yeah, its meant to be used with an M5 Core module.
Might be tricky getting it to work with a Pico or Pi?
There is some info here on i2c if you scroll down far enough.
Way above my skill level I’m thinking?
STM32F030x4/x6/x8/xC and STM32F070x6/xB advanced ARM®-based 32-bit MCUs - Reference manual
Thanks, It does look more complex than I am confident with. Need to talk to a pirate early tomorrow!!
Digging further it may be that with the right base it would do what I am looking for perhaps setting it up via windows.
The M5Stack range really requires its own support software as that includes the required libraries for the hardware. An AtomS3 Lite will get you started if you can manage without a display.
For Micropython you need to flash the Atom with UiFlow2. It is all well documented on the M5Stack website but you do need the technical page rather than the “shop” page. Keep drilling down through the layers of information until you find what you need.
As for development you can get started with UiFlow2 and its visual, Blockly-based approach, or switch to Thonny which works just as well with ESP32 processors as it does with RP2040s.