4 pump doser with 2 relays - feedback

dajester

New Member
View Badges
Joined
Apr 25, 2022
Messages
4
Reaction score
8
Location
Australia
Rating - 0%
0   0   0
Evening all,

First time poster, short time lurker. English is my first language, but still expect errors...

Ive seen some setups and good walk throughs using relay banks or using L298D circuits to control motors. And honestly i can achieve this as i have the parts.

However, my lightbulb moment is this and for simplicity il stick to a 2 motor controller using 2x TIP122 and 1 relay. I would post a circuit, but im on my mobile.

Set up a 5v SPDT relay in equipment tab to switch a relay on or off depending what doser motor you want to drive. Switching is achieved through the timer tab. Using gpio18 (jack0) route it to the Common on the relay, and then NO routed to Motor1 TIP122 base and NC to Motor2 TIP122 base.

This way your PWM signal is only sent to 1 of 2 motors depending on if your relay is energised.

My circuit and question:
Circuit has a 800(ish)ohm resistor from pwm to base, collector to 1 side of motor, other side to 12v with a 1N4001 diode across the motor terminals to protect against EMF (despite the TIP122 having internal protection) and emitter to gnd with no resistor. I see this circuit having benefit over a l298d due to less inputs from the rpi. And i can achieve this relay circuit using the l298d as well. But are there and benefits to a l298d over a tip122 circuit?

Ive got the l298d circuit set up to control 2 motors substituting 12v input for 5v (waiting on motors in the post) and have it working in reefpi to blink an led but it requires a timer for relay on and off (to provide pwm to either side of the L298d) followered by a timer to turn the motor direction rpi pin on and off and finally a timer to turn the doser on for xx seconds.

Using the TIP122 would mean i can cut out timers for 4motor direction control pins for each L298d, simplifying the reefpi timers and the circuit.

I hope this makes sense. I will attempt to throw up a wiring diagram of each of the 2 options tomorrow and the reefpi configuration for each once i jump on my pc.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Evening all,

First time poster, short time lurker. English is my first language, but still expect errors...

Ive seen some setups and good walk throughs using relay banks or using L298D circuits to control motors. And honestly i can achieve this as i have the parts.

However, my lightbulb moment is this and for simplicity il stick to a 2 motor controller using 2x TIP122 and 1 relay. I would post a circuit, but im on my mobile.

Set up a 5v SPDT relay in equipment tab to switch a relay on or off depending what doser motor you want to drive. Switching is achieved through the timer tab. Using gpio18 (jack0) route it to the Common on the relay, and then NO routed to Motor1 TIP122 base and NC to Motor2 TIP122 base.

This way your PWM signal is only sent to 1 of 2 motors depending on if your relay is energised.

My circuit and question:
Circuit has a 800(ish)ohm resistor from pwm to base, collector to 1 side of motor, other side to 12v with a 1N4001 diode across the motor terminals to protect against EMF (despite the TIP122 having internal protection) and emitter to gnd with no resistor. I see this circuit having benefit over a l298d due to less inputs from the rpi. And i can achieve this relay circuit using the l298d as well. But are there and benefits to a l298d over a tip122 circuit?

Ive got the l298d circuit set up to control 2 motors substituting 12v input for 5v (waiting on motors in the post) and have it working in reefpi to blink an led but it requires a timer for relay on and off (to provide pwm to either side of the L298d) followered by a timer to turn the motor direction rpi pin on and off and finally a timer to turn the doser on for xx seconds.

Using the TIP122 would mean i can cut out timers for 4motor direction control pins for each L298d, simplifying the reefpi timers and the circuit.

I hope this makes sense. I will attempt to throw up a wiring diagram of each of the 2 options tomorrow and the reefpi configuration for each once i jump on my pc.
Hi, welcome to the world of reef-pi.

The TIP122 should work just as well as the L298D if you only need one direction, I've tried both (not TIP122, other NPN's) and end result is the same. If you don't have enough GPIO's that relay idea is nice but yeah you'll have to manage it with timers and insure it's set correct or you could have an accident. You have the wiring correct, here's a diagram. It is good to add a diode across the motor terminals, this will stop kickback voltage. I added another TVS diode (SMAJ5.0A) you could add for extra protection. I also added a pulldown resistor (4.7k - 10k) on the signal wire, this will make sure the NPN stays off when no signal, without it the pin could be floating and cause random on/off.

tip122.jpg
 

Lavey29

10K Club member
View Badges
Joined
Apr 29, 2021
Messages
11,274
Reaction score
11,919
Location
United States
Rating - 0%
0   0   0
And I will be moving on from this thread because I have no idea what this is but I wish you much luck.
 
OP
OP
D

dajester

New Member
View Badges
Joined
Apr 25, 2022
Messages
4
Reaction score
8
Location
Australia
Rating - 0%
0   0   0
Hi, welcome to the world of reef-pi.

The TIP122 should work just as well as the L298D if you only need one direction, I've tried both (not TIP122, other NPN's) and end result is the same. If you don't have enough GPIO's that relay idea is nice but yeah you'll have to manage it with timers and insure it's set correct or you could have an accident. You have the wiring correct, here's a diagram. It is good to add a diode across the motor terminals, this will stop kickback voltage. I added another TVS diode (SMAJ5.0A) you could add for extra protection. I also added a pulldown resistor (4.7k - 10k) on the signal wire, this will make sure the NPN stays off when no signal, without it the pin could be floating and cause random on/off.

tip122.jpg
Thanks for the response. The dropdown and the tvs i didnt think to add in, but will do so. Im thinking the tip122 circuit might be the go. Its a simpler circuit with less reef-pi configuration requirements. Frim a doser perspective there no need to drive your motors the other way. I am surprised to not find any circuits using a relay to route the pwm signal tho.
 
OP
OP
D

dajester

New Member
View Badges
Joined
Apr 25, 2022
Messages
4
Reaction score
8
Location
Australia
Rating - 0%
0   0   0
@robsworld78

Just an update, ive made my circuit, minus the TVS, thought i some but i did not. Few photos attached. I designed, printed and etched the motor board myself. Pictures only show one relay setup to output to 2 motors. Im still waiting for my motors to arrive.

For reef-pi:
Relay signals from gpio 23 and 24 to each relay and then set up in the equipment tab.
2x Doser pumps created on the doser tab
Timer set up will be along the lines of:
Doser pump (j0) on for xx sec, then off
Once doser pump off, Relay (j0) on
Doser pump (j0) on for xx sec, then off
Once doser pump off, relay (j0) off

Repeat the same for doser pump j1

Time to investigate macros and see if they are what i think they are and if i can improve my timer situation
 

Attachments

  • 20220508_220549.jpg
    20220508_220549.jpg
    92.9 KB · Views: 35
  • 20220508_220539.jpg
    20220508_220539.jpg
    101.6 KB · Views: 31
  • 20220508_220528.jpg
    20220508_220528.jpg
    81.5 KB · Views: 31
  • 20220508_220519.jpg
    20220508_220519.jpg
    104.5 KB · Views: 33

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
@robsworld78

Just an update, ive made my circuit, minus the TVS, thought i some but i did not. Few photos attached. I designed, printed and etched the motor board myself. Pictures only show one relay setup to output to 2 motors. Im still waiting for my motors to arrive.

For reef-pi:
Relay signals from gpio 23 and 24 to each relay and then set up in the equipment tab.
2x Doser pumps created on the doser tab
Timer set up will be along the lines of:
Doser pump (j0) on for xx sec, then off
Once doser pump off, Relay (j0) on
Doser pump (j0) on for xx sec, then off
Once doser pump off, relay (j0) off

Repeat the same for doser pump j1

Time to investigate macros and see if they are what i think they are and if i can improve my timer situation
Right on, looks good, glad you got it worked out. :)
 
OP
OP
D

dajester

New Member
View Badges
Joined
Apr 25, 2022
Messages
4
Reaction score
8
Location
Australia
Rating - 0%
0   0   0
@robsworld78 @Ranjib
Just an updated photo for you if you are interested. With Reef-pi, Relays work manually under the equipment section and ive hidden them under the pi. Pumps work as well from the doser tab with calibrate. Ive set up each of them individually. Last thing i have to do is set up the timer as follows:
Pump1 run and stop
Relay1 on
Pump2 run and stop
Relay1 off
Pump3 run and stop
Relay2 on
Pump4 run and stop
Relay2 off

Now to finish gluing the case together and test it for a few days before going live.
 

Attachments

  • 20220521_234956.jpg
    20220521_234956.jpg
    133.8 KB · Views: 27
  • 20220521_234950.jpg
    20220521_234950.jpg
    139.9 KB · Views: 26

High pressure shells: Do you look for signs of stress in the invertebrates in your reef tank?

  • I regularly look for signs of invertebrate stress in my reef tank.

    Votes: 41 32.0%
  • I occasionally look for signs of invertebrate stress in my reef tank.

    Votes: 29 22.7%
  • I rarely look for signs of invertebrate stress in my reef tank.

    Votes: 25 19.5%
  • I never look for signs of invertebrate stress in my reef tank.

    Votes: 33 25.8%
  • Other.

    Votes: 0 0.0%
Back
Top