Using Blynk with particle photon to control relay and current monitor

Hi All I have no programming experience but have an electronics background. I am attempting to use a 1 channel relay and a current monitor from to be able to turn on/off my EVSE for my electric car and then be able to see if the current is flowing so I know my car is charging/not charging. I want to be able to do this all via the Blynk app. I can get the current monitor working and I have been able to run sample code on the relay controller but I am struggling to understand how to get all of this working together. I have hit a wall with it as well as with getting blynk to work. I attempted to follow the Blynk tutorial on controleverything’s website and I was unable to connect the Blynk app with my AuthToken.

My end goal is to turn the relay on/off using the blynk app this would allow me to remotely start/stop vehicle charging.
The goal with the current monitor is to be able to monitor current with a gauge, and use the value display widgets for voltage, power, energy used, and total energy. This will allow me to see that the vehicle is indeed charging/not charging and will allow me to monitor my energy usage.

Your assistance would be greatly appreciated.

Below is the current monitor and the relay that I am using with a particle photon.

Welcome to Blynk.

Having an end goal is necessary for the motivation, but before you jump fully into it and possibly get frustrated by the learning curve of the required programming, I would recommend starting over at Blynk’s Help Center (link at the top right of this page): and getting your hardware connected.

Then run a few of the simple examples from the Sketch Builder link:

And comparing the various commands found in the Documents: with their actions in the examples.

I am completely overwhelmed by the links you provided and haven’t an idea as to where to begin with all of that. I have my hardware, I have the blynk app installed on my phone, I have the Auth token and I have attempted to connect the blynk app to my hardware via the software using the examples that controleverything posted and nothing happens. I know nothing of programming and I don’t understand the examples you linked to.

Well… what more can we do? You are there, we are not.

I have shown the links to the documentation, meticulously provided by the Blynk developers… And unless you are much faster at reading than I am, then you haven’t even started looking at them.

Since you are using a Particle Photon, have you tried loading in the Blynk Libraries from the Particle IDE? I am not that familiar with it, as I am an Arduino user, but you might consider looking at their forum as well:

I had previously read the getting started section. I read through about 8 examples (Yes I read incredibly fast). I am a hardware guy trying to understand software. It’s never been my thing. I took some java classes in 2005/2006 and haven’t done anything since.

I too am more of a hardware, hands on type… and you are a year or two ahead of me… I have never taken any programming course… I just learn as I go :wink: It is doable.

But as stated in my previous post, you may have the additional step of getting the Blynk libraries installed and functional in Particle first.

I have the Blynk libraries installed in my app and it appears the lines of code that should connect my photon’s code to Blynk are correct but nothing happens. Blynk just says Offline.

Can you confirm the Library version, and the app version (and Android or iPhone). Is your Photon programmed with a basic example sketch with the proper WiFi parameters and authcode inserted? Is the Photon showing as online and broadcasting anything else in the IDE monitor?

It says Blynk 0.4.7. I haven’t tried inserting the code today because the photon is currently connected to my current monitor and the relay board and is running the software to control both of those. I don’t want to set up virtual pins until I have a solid understanding of this as I don’t want to accidentally damage anything (If that’s possible).

I just noticed this… is it just a typo? The libraries install in the IDE, the app is a separate thing

A virtual pin is just a variable used by Blynk to facilitate a Widget (in the app) interface with code (in the device):

But until you have a proper Blynk sketch loaded and configured to both your WiFi and with the proper auth code for an App project, of course your app will say device off line… because it is.

Also… for now, forget about trying to integrate Blynk into your existing project… get a basic grasp of Blynk, connections, programming & operations first.

Save your current project, then once you get connected to your app, load in some examples and start experimenting.

I had read that about virtual pins but I need to figure out how to write the code to use the virtual pins to do things IRL and I can’t figure that out for the life of me.

Well honestly then, you are in the wrong place… Yes Blynk can work without code, for very basic, simple, things (once you have figured out how to get connected), and honestly, that s all many people want out of it… but “no code” will not work for anything near what you want to do.

I don’t want Blynk to work without code. I have added all the libraries that it should have. I can monitor current output, I can turn relays on and off locally but I don’t know what code to write to in the Particle project I am working on to be able to control the relay and monitor current via the Blynk app. There are examples out there for both but with my very limited understanding of programming I am failing to understand why the code is not compiling, what the error messages mean and I also can’t get the Blynk app to connect even though everything is identical in my Particle project to what I see in the examples provided.

Well, again, I don’t know what you expect anyone here can do for you if you are unable to even compile a code, let alone connect your device to the Blynk Cloud Server and thus the App.

Forget the combined reading of currents, controlling relays and whatever other examples you are refering too… start with the BASICS, confirm the Blynk libraries are properly loaded into Partial IDE (assuming that is what you use) and program in and get connected with a simple sketch like:

And try linking a Button Widget to a digital pin and light up a LED or something.

I am able to compile code to monitor current, and to turn the relay on and off but in the Particle IDE and the flashed to the boards but I am only able to do so locally. When I try and use the examples for Blynk I can’t get any of them to work. The code either doesn’t compile or it does compile, can be flashed and yet nothing works.

The either your Blynk Libraries are not properly installed into Particle IDE (also ask about about that on their forum as there will be other Blynk & Photon users there for sure) and/or you are not connecting your Photon to the internet after loading a Blynk sketch, as is required to link the device with the app, via the Cloud Server.

If you are able to compile and load in a sketch, what does the IDE monitor show?

The IDE monitor for what? Blynk or Particle??? When you say load a sketch what does that mean?

Really?? Well Google around for those answers… Until you have the bare basic understanding of viewing an IDE monitor (serial), loading in a sketch (seriously, how did you monitor your current readings if you can’t do that?), reading basic documentations, etc… then I think I am unable to go much further on this topic.