Help with wiring ge...
 
Notifications
Clear all

[Solved] Help with wiring generic dosing pumps  

  RSS

ralphg
(@ralphg)
Active Member
Joined: 3 months ago
Posts: 7
October 30, 2020 1:05 pm  

OK, total noob question here: I'm working on a pH controller currently and hope to add nutrient dosing in the future. I currently have a junction box with a RPi 4 running Mycodo, Atlas pH probe, and a 7" touch screen mounted within the box - all is installed and running great.

Now, I have a SainSmart 8 channel relay, two 12V generic peristaltic pumps, and a 12V power supply that I'm attempting to install in the box to complete the pH controller portion of my project. I'm an ex-Java developer but, assembling electronic components is completely new to me. So, can someone point me to a wiring diagram or other resource that will explain how to wire these last components together? I have tried to research this online but, I haven't found an exact match (or, something reasonably close) to what I'm attempting to put together. TIA for any help and, thanks to Kyle for all the work put in to develop this great framework!


Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 6 years ago
Posts: 368
October 30, 2020 2:05 pm  

Are these mechanical or solid state relays? 

Mycodo Developer


ReplyQuote
ralphg
(@ralphg)
Active Member
Joined: 3 months ago
Posts: 7
November 1, 2020 12:11 pm  

@kylegabriel I've looked at the documentation for the relay but, it doesn't really say. Does this make a difference as far as Mycodo goes?

Anyway, I was able to muddle my way thru (without burning anything up ;-) and everything appears to be working. I just re-mounted the box back in the grow room this morning and added the generic pumps as outputs in Mycodo and did the calibration. So next, I will be looking at the Mycodo manual see how to tie everything together.

EDIT:

I noticed this in the logs:

2020-11-01 14:35:33,390 - DEBUG - mycodo.inputs.atlas_ph_94b25fd1 - pH sensor set to calibrate temperature
2020-11-01 14:35:33,435 - DEBUG - mycodo.inputs.atlas_ph_94b25fd1 - Latest temperature used to calibrate: 5.632
2020-11-01 14:35:34,443 - DEBUG - mycodo.inputs.atlas_ph_94b25fd1 - Calibration returned: 0,
2020-11-01 14:35:35,955 - DEBUG - mycodo.controllers.controller_input_94b25fd1 - Adding measurements to InfluxDB with ID 94b25fd1-0a75-44b5-b53d-814491ae0aeb: {0: {'measurement': 'ion_concentration', 'unit': 'pH', 'value': 5.633, 'timestamp_utc': None}}

Please forgive for mixing topics, but have I somehow incorrectly added my Atlas EZO pH probe? I have calibrated the probe recently but, I entered 25 Celsius when the  low, mid calibration form requested it. I'm a bit thrown off by the log entry stating that "Latest temperature used to calibrate: 5.632," when of course, 5.632 is the pH reading.

Also, struggling with the PID controller. Currently, my controller isn't doing anything (dosing pumps are not switching on) Are there any example screenshots you can point me to as far as Mycodo being used as a pH controller? I'm just simply trying to maintain a hydroponic reservoir at pH 5.8 +/- .1 

TIA, also thanks again for all the great work!

This post was modified 4 weeks ago 2 times by ralphg

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 6 years ago
Posts: 368
November 6, 2020 8:31 pm  
Posted by: @ralphg

I've looked at the documentation for the relay but, it doesn't really say. Does this make a difference as far as Mycodo goes?

It should be a consideration for the electrical devices you want to control. Relays generally come as mechanical (physical moving parts that "click" when activated or deactivated) and solid state relays (SSRs, no moving parts) and control AC or DC voltage. Mechanical relays can usually handle switching AC and DC, but SSRs typically only with with AC or DC voltages. Therefore, it's important to use the correct relay for the application or it could become a fire or shock hazard.

Posted by: @ralphg

"Latest temperature used to calibrate: 5.632,"

I presume you are using the Atlas Scientific temperature sensor? If so, are you using the correct I2C address? If you have your temperature sensor I2C address set to the pH sensor's I2C address, it will return the pH rather than the temperature. In any case, you didn't provide enough information to understand what's going on with your system. You'll need to provide much more for a proper investigation to be conducted.

Posted by: @ralphg

Mycodo being used as a pH controller

I replied in your other thread about this. I would not recommend using a PID controller to regulate pH until you have a firm grasp on PIDs and their tuning.

Mycodo Developer


ReplyQuote
ralphg
(@ralphg)
Active Member
Joined: 3 months ago
Posts: 7
November 18, 2020 11:27 am  

@kylegabriel Sorry for the delay in getting back with you. I really appreciate all the information you provided. I discovered from another person that bought the same relay as I that, it is a mechanical-type relay. I'm switching 12V DC dosing pumps so, the relay I have should be appropriate.

As far as the temperature message in the log file, you are correct, I had the pH and temp set to the same I2C address - thanks again for pointing that out.

Finally, using a PID controller for pH in my particular situation is probably overkill. So, I just wrote a simple script to poll the Atlas probe and dose pH Up and pH Down as required. It's nothing fancy but, it's been running for about a week now with no issues.

Thanks again for all the help.


ReplyQuote