Hi all,
This is my first real world project after watching the 4hr pico course and the meshtastic course, want to say how good those videos are and well presented!
I am looking for some human advice and guidance as I need some time away from chatGPT due to resorting to typing insults and profanities to a computer I started questioning my sanity! My sanity yes, that has been tested over the last little bit trying to get this project going…
To frame it all..
I live offgrid, and run a marketgarden on the property, I would like to start a local internet of things on the property and farm to help make my life easier and the farm more automated and profitable, and also learn electronics/coding along the way. I settled on the meshtastic format after watching the course as being able to ping from node to node is great to extend range. I will start basic and build on the system as i learn more and get better. The first project which I have started is a wireless tank monitering system.
The system-
3 nodes in total using 2x pico’s per node, 1 with SX1262 LoRa Node hat and the other for sensors etc.. Tank node sends battery voltage, and level of tank as a % to the OLED node to monitor and sound warnings and alerts and be the brains of the system until I build a more powerful interface with a raspberry pi and touchscreen. The 3rd node monitors and controls a solinoid valve on/off relative to the tanks state.
progress so far..
TANK NODE-
Is assembled on a breadboard with a voltage divider into adc26 for Node Battery sensing using 2x 10k resistors, a JSN-SRO4T ultrasonic sensor for water level sensing, meshtastic node hooked up via UART and both powered by a 1100mAH LiPo battery charged by a waveshare solar module D with solar panel.
I have it set up on a private meshtastic channel. I have sent data to the channel but its inconsistant and glitchy, the JSN-SRO4T especially, throwing full readings every 2nd or 3rd reading, pretty sure due to my code but I think its all wired right, it also has a small oled for debugging
=== UART SETUP ===
uart = UART(1, baudrate=115200, tx=Pin(8), rx=Pin(9)) # TX=GP8, RX=GP9
=== OLED SETUP ===
display = create_PiicoDev_SSD1306() # I2C0, SDA=GP4, SCL=GP5
=== JSN-SR04T Sensor Pins ===
trigger_pin = Pin(2, Pin.OUT)
echo_pin = Pin(3, Pin.IN)
=== Battery Voltage Setup ===
adc = ADC(26) # GP26 (ADC0)
VOLTAGE_DIVIDER_RATIO = 2
OLED NODE-
Is assembled on a breadboard with a voltage divider into adc26 for Node Battery sensing using 2x 10k resistors, a 2.42’’ Large SSD1309 OLED screen for monitoring 6 lines TANK%, VALVESTATE, TANKBAT, OLEDBAT, VALVEBAT, ALARMSTATES
it also has a DFrobot Digital Buzzer Module and a push button to silence alarms. it also uses the same Waveshare solar module D and 1100mMA battery for powering both picos. I have had it recieving data via the meshtastic network and the buzzer and button have worked. I just need a good code to put it alltogether which is beyond my current capacity and chatGPTs again I have stability and reliablity issues when i have had some of it working, no doubt through my code I am sure.
UART SET UP
uart = UART(1, baudrate=115200, tx=Pin(8), rx=Pin(9))
— Buzzer + Button Setup —
buzzer = Pin(15, Pin.OUT)
button = Pin(14, Pin.IN, Pin.PULL_UP)
— OLED Setup —
WIDTH = 128
HEIGHT = 64
I2C_SCL = 5 # GP5
I2C_SDA = 4 # GP4
i2c = SoftI2C(scl=Pin(I2C_SCL), sda=Pin(I2C_SDA))
oled = SSD1306_I2C(WIDTH, HEIGHT, i2c)
VALVE NODE-
This has not been assembled yet
Any help or advice is much appreciated, especially the coding side of things, im not too bad with circuits wiring etc.. but I am green as with coding, but am very motivated to learn as I have learnt that AI is just a tool (should just put a fullstop here!) not a prime mover of things.. cheers Nick..