GPIO pin state changes be the "IF" in a trigger


#1

I need to be able to monitor when a generator starts at a remote location. When the generator starts, be it automatically when there’s a power outage or when it tests itself, there is a pair of relay contacts on it that go hi/lo. I want that relay to act as a switch to set a GPIO hi or low and it will trigger an event such as send me a text (that the generator has started) it’s likely something simple but I don’t see it!!


#2

suggestion: install a pullup resistor on the GPIO.
Cayenne doesn’t default pull a GPIO high,
and even though the relay opens/closes,
that doesn’t necessarily mean that the GPIO gets pulled low or high.
I experienced this exact thing.
A 1K -to- 10K resistor placed between 3v3 and the GPIO is needed.
I usually choose 2.2K because I have thousands of that value. :wink:
Do NOT connect the resistor to +5, it will burn out your GPIO.


#3

You should also monitor engine RPM, current draw, voltage, temperature, oil pressure and fuel levels. -Just a suggestion.


#4

Ok thanks for the reply! In the meantime I found the digital input I need for the trigger. Guess i was too impatient…lol looks like this will work well for me. I do have voltage sensors and I would like to have one on the generator starter battery. Also wouldn’t hurt to send signal of grid power loss, just to confirm actual power outage. Possibilities are endless!!


#5

Funny you should mention this-
right now, I’m designing a dedicated PC board
specifically designed for remote generator monitoring and control.
I’m working on the tachometer input right now.
Trying to see if I can make a software tachometer,
programmed with Python.

The generator has enough unique requirements
that it warrants it’s own dedicated PC board design
-based on a Pi 3.

I build (er, past tense) off-grid estates- so, I definitely have a need…



#6

So yeah I think already found it, but we have a digital input widget that you could use…then create a trigger to send a text message when the signal is HIGH/LOW. Were you able to figure it out? If not I can post a few screen shots. Let me know!

And also feel free to post your project to our ‘Projects Made With Cayenne’ category. There is also a project submission contest going :slight_smile:

See you around,

-B