DIY DIY - Affordable? Soil NPK, pH & EC sensor (NPKPHC-S)

Hello @Bob's Auto's , I noticed something strange when I went to connect the 5v power to my esp, actually it does power up the controller and I can see from the blynk app the mosture % and the led about the pump being enabled or disabled, but , for some reasons, it doesn’t activate the relay … but if the circuit is connected to my pc … it does.. i tried different power sources at 5v 1A, 5v 2.5 A, but it doesn’t change … the relay only works connected to my pc.. it may be something about libraries or ??
75FiIgY.jpg
 
Hello @Bob's Auto's , I noticed something strange when I went to connect the 5v power to my esp, actually it does power up the controller and I can see from the blynk app the mosture % and the led about the pump being enabled or disabled, but , for some reasons, it doesn’t activate the relay … but if the circuit is connected to my pc … it does.. i tried different power sources at 5v 1A, 5v 2.5 A, but it doesn’t change … the relay only works connected to my pc.. it may be something about libraries or ??
75FiIgY.jpg
Mhmmm...Show me some pictures how the hardware is connected please. Seems like some ground issue to me. If the setup works connected to the pc. It should work connected to 1A charger as the pc only outputs about 200mA or something.
Did you also try another usb cable? ie, the cable you use to connect it to the pc, but connect that to the adapter instead...
 
Mhmmm...Show me some pictures how the hardware is connected please. Seems like some ground issue to me. If the setup works connected to the pc. It should work connected to 1A charger as the pc only outputs about 200mA or something.
Did you also try another usb cable? ie, the cable you use to connect it to the pc, but connect that to the adapter instead...
Yeah I can share pics/video .. it s a bit Rudimental I admit.. I use the same things … the strange part is when I start the power of my pc the device boots even if windows isn’t already on this makes me suppose you may be right .. but still strange isn’t it, at least from my knowledge.

ps. Plug power supply doesn’t have ground, maybe the pc is supplying it and power plug isn’t ?
 
Yeah I can share pics/video .. it s a bit Rudimental I admit.. I use the same things … the strange part is when I start the power of my pc the device boots even if windows isn’t already on this makes me suppose you may be right .. but still strange isn’t it, at least from my knowledge.

ps. Plug power supply doesn’t have ground, maybe the pc is supplying it and power plug isn’t ?
Do you have a laptop? If so connect it to that without the laptop being connected to the power supply. Then you also don't have real ground and in theory it shouldn't be able to work as with the powerplug.
 
It s not working .. it may be the problem .. how am I supposed to add ground to the circuit..?
Il found a 5v power supply with ground, I’ll try to use it for powering up the esp… hopes that s the problem .. it s making me crazy
 
Last edited:
It s not working .. it may be the problem .. how am I supposed to add ground to the circuit..?
Il found a 5v power supply with ground, I’ll try to use it for powering up the esp… hopes that s the problem .. it s making me crazy
Show some pictures from your hardware please. It should work with a phone charger anyway, which makes me think you don't have ground between the relay and the esp. Could also be that the 3.3V isn't enough to trip the relay...That's why a picture is worth more then a thousand words ;)
 
Show some pictures from your hardware please. It should work with a phone charger anyway, which makes me think you don't have ground between the relay and the esp. Could also be that the 3.3V isn't enough to trip the relay...That's why a picture is worth more then a thousand words ;)
Relay is 12v and has his own power supply, I thought about the same about the ground .. il check it …

P.S. HAHAHAH I didn’t connect the ground between the esp and the relay… I though it wasn’t needed since they were powered by different power supplies… I was wrong… now it works….

thanks bob … you are very helpful … :bighug: :pass: All I can do it s sharing a boof.. for now
 
Relay is 12v and has his own power supply, I thought about the same about the ground .. il check it …

P.S. HAHAHAH I didn’t connect the ground between the esp and the relay… I though it wasn’t needed since they were powered by different power supplies… I was wrong… now it works….
Sorry for laughing, but ground had to be connected over all the devices connected to each other. It's called common ground and it's necessary so the voltages don't go out of spec. Also, if you send a voltage over a cut line it don't do shizzle :pighug:
It's one of the most common mistakes when building something :thumbsup:
 
Hey tinkerers :wiz:

Today was the perfect time for me to hack the TS-1000 as it was lights out in the current grow. So now I can control it from the comfort of my chase long:hookah:

Let's begin by saying, I TAKE NO RESPONSIBILITY IF YOU ELECTROCUTE YOURSELF WHILE DOING THIS!!
Ok, now that that's out of the way...It's actually not that hard. But always unplug everything when working on the innerts...
Below picture show's us which color cable is what. This is important as we need a common ground for this to work...
1671122699140 _small.jpg


On the NodeMCU everything stays the same as in the diagram.
Digital Light Control SchemaB.png


On the resistance side of the digital potentiometer we connect the positive wire to VL and the ground wire to VW. In the back you see a red (yes red, I didn't have black at hand) wire which is connected to ground and we will use in a moment.
1671122699143 _small.jpg


The grey and purple cable from the LED driver. I did clean up the connections with a soldering iron...
1671122698913 _small.jpg


I replaced the twist on connections that MH used to connect the wires together by using Wago clamps. These can be used to connect soft and hard core wore together, so they'll do ;)
I connected the positive wire from the potentiometer to the wago with the purple cable from the driver and connected the negative cable from the potentiometer and the ground (YES, red!!!) from the NodeMCU to the wago with the grey cable.

Just like the manufacturer I used my good old glue gun to stick everything in there snug. Oh, I disconnected the entire setup in the box, so the knobs and flip switches are just for visual effect. If need be in the future I can just remove my NodeMCU and connect the wires from the original setup to the wago clamps and we're back to the stone age :rofl:
1671122698909 _small.jpg


As you can see there's one wire that's going into the box that wasn't there before and that's 5V via an USB charger for the NodeMCU.
1671122698901 _small.jpg


I don't need the light for a couple of days now and for that time being the light is being tested on my workbench...




Regards,

Bob :toke:
 
The code for this project...
C++:
// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID           "TMPLxxxxxx"
#define BLYNK_DEVICE_NAME           "Device"
#define BLYNK_AUTH_TOKEN            "fill this in yourself"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <FastX9CXXX.h>

//Potmeter1
#define X9_1_CS_PIN 4
#define X9_1_UD_PIN 2
#define X9_1_INC_PIN 0


char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Name network";
char pass[] = "Password network";

FastX9C104 Potentiometer1(X9_1_CS_PIN, X9_1_UD_PIN, X9_1_INC_PIN);

int step1 = 0;



BLYNK_WRITE(V2) {
  if (param.asInt()) {
    step1 = param.asInt(); // assigning incoming value from pin V2 to a variable
    Potentiometer1.JumpToStep(step1, true);
    Serial.print("step1 value:");
    Serial.println(step1);
      Serial.print(F("Potentiometer 1 current resistance: "));
      Serial.print(Potentiometer1.GetEstimatedResistance(), DEC);
      Serial.println(F(" Ohm\t"));
  }
  else {}

}

void setup()
{
  // Debug console
  Serial.begin(115200);

  Blynk.begin(auth, ssid, pass, "IP.Local.Blynk.Server", 8080);

}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}
 
Back
Top