Hello everyone, I am attempting to build my first project that will start and stop a diesel engine and wish to use some form of a app on my phone to do so. I would like the app to be a simple button that when pressed it makes a digital pin 6 HIGH and says “Pump ON” and then when pressed again it says “pump OFF” and makes digital pin 6 LOW and pin 7 HIGH.
I can change the pin states with HTML but that is not convenient as I would like to be able to run the app on at least two phones.
Could someone point me in the right direction please as I have never programmed before I am struggling with the best way to do this.
Thank you in advance.
Hey Darren,
Just wondering what hardware you are using to turn the motor on and off and connect to a wireless or mobile network?
Hello Clinton, I am using the Particle Electron 3g for the device. It will switch some relays. One relay simply connects the starter motor to crank and the other will be activating a solenoid for the engine stop lever. I will be adding monitoring of oil pressure and water pressure and if wither drop it is to activate the engine stop relay.
Hey Darren,
A quick look around and there seems to be a set of tools called Blynk That lets you interface with the Particle in just the way you want.
I have looked at that but cant see how i can make it change the pin number between on and off for a single switch. As when on it needs to activate a pin for 3 seconds and when off activate a different pin for 5 to 10 seconds.
I am not sure but I would think it would be possible to program the Particle to take the signal from blynk and run a function that turns a pin on for 3 or 5 seconds. Do you have any code for what you are trying to do?
No I don’t have any code yet. I am about learn fast as I need to have this programmed tonight as we head away boxing day. And that was the reason for this project as I need to keep the lawns irrigated for our wedding next month. But unfortunately haven’t had time with the day to day stuff.
I am open to any suggestions or assistance. I would appreciate any help. I have a simple HTML to make it work at the moment but the web page doesn’t refresh and I would like to be able to check to see if a digital pin is in a high or low state (engine oil pressure switch). I will find what I have which is very simple. Its not the Blynk method I was hoping to do but if it works for the time being I am happy.
1 Like
Hey, the HTML you mentioned, is this HTML generated returned by the chip itself or hosted somewhere else and queries are made to the chip? How does the HTML communicate with the chip does it have a static ip? Or does it have a phone number and you can sms it?
If you can communicate directly with the chip you could just build on your HTML to make it fancier. Have the chip respond to requests for status by returning jsonp or just return HTML. The HTML page can query it using Ajax every few seconds and then render the response onto the page. Just google jquery, and jsonp.
If you want it to be an app, you could look at a tool like Cordova or phonegapp to take your HTML page and package it as an app. Alternatively you could google Progressive Web Apps. You can have your web page work off-line and add itself to the home screen like an app. It behaves and seems like an app but is just actually a browser without the toolbar. Or just copy the HTML page to your phone and open it in the browser. This is probably good enough? I did this with my chicken shed.
1 Like