Particle Electron hooked fish signal

I am doing a project for my school where we have a automated fishhooking mechanism. My job in this project is to use the Particle Electron to send an SMS message whenever a fish is hooked. We are using a loadcell amplifier to measure tension on the fishing line. Basically, I want the Electron to notify the user with an SMS message telling them that a fish has been hooked when the loadcell amplifier reads a certain force. I have made a Twilio account and set up the webhook on the particle IDE.

Here is the code I got off an example:

int sendMessage(String command);

void setup()
{
    Particle.function("sendMessage", sendMessage);
}

int sendMessage(String command)
{
    Particle.publish("twilio", "Your fish has been hooked! This is a message sent from your Particle device!", 60, PRIVATE);
}

Any advice on how I should go about doing this?

A Particle.function is something that is called from the outside; an app, a web page, the CLI, etc. If you want your Electron to post a message whenever the strain gauge indicates a fish is hooked, you should not put the Particle.publish inside a Particle.function. It should go in loop, inside some if-clause that evaluates to true when the fish is hooked.

2 Likes

Like a typical fisherman…

if(fish == hooked)
{
  generateLiesAboutItsSize();
}
5 Likes

You can also use Ubidots.com to receive the updates and then send SMS & Email messages when you trigger a threshold on a variable. It’s free and super easy to work with.

1 Like

Thanks for the replies guys!

I am looking into Ubidots.com and it seems perfect for what I am trying to do. Thank you

1 Like