IoT: In the Cloud

Enter Your Project for a chance to win an Arduino MKR WAN 1300 Kit with a Compatable Lora Gateway or an MKR 1400 GSM with a Shield Combo + a $100 shopping cart!

Back to The Project14 homepage

Project14 Home
Monthly Themes
Monthly Theme Poll


I've been distracted and just realized that the deadline for the IoT: In the Cloud project is fast approaching.


Time to get back to work to connect and test the relay module.


Here are pictures of the RPi 3B and 5 inch touchscreen display mounted in the enclosure.  The relay module is not mounted yet.  And I still need to drill out the wiring access at the bottom of the enclosure.

Display with frame in control box

Display w/o frame in controller box


Here is the front bezel mounted on the display.  I have added a surface mount pin header on the back of the display PCB to break out the GPIO pins that I need for the relay control (the display passes through the first 26 GPIO pins - including the ones used for the display)

Display mounted in frame


Here is the RPi on a baseplate that I 3D printed to mount in the enclosure.  Next to the RPi is a proto breakout board that I wired to interface the 6 pin cable to the relay controller.  I decided to use a breakout board since it will allow me to easily add an RTC module later.  The breakout board plugs onto the surface mount header on the back of the display.

RPi with GPIO adapter


I was having some problems with the touch screen so I enlarged all of the controls to make them easier to operate.  I should have used a capacitive touch screen but I couldn't find one that would fit in the enclosure that I selected.


Here is the new layout.


Here is a short video showing the relay module being controlled using the tkinter GUI interface.  I am operating the interface via VNC.  Apologies for the lack of clarity.  I need to improve my video setup.


I discovered that there is an anomoly with the operation of the tkinter button interface.  For the "Run once" mode, I wanted the radiobutton to turn green while the sprinklers were running and turn back to white when they were finished and also turn the Zone labels green to show which zone was running.  Unfortunately, it appears that button attributes like color do not change until AFTER the button command (callback) function has completed.  I am controlling the relays in the command function so the button colors won't change until after all the sprinklers have run.  I haven't found a way to work around that yet.


My next steps are to implement the cloud communication via MQTT to the Cayenne Dashboard.  That way I can monitor and control the interface from a browser or mobile app.