Pump + Relais + Decoupling
- 
					
					
					
					
 Hi, Picked up the hobby again  
 I would like to build an irregation system with a pump, 4 valves and a sensor to easure the total amount of water in a tank.
 I have found some sketches to help me with the problem. So I hope this would not be the problem.
 I now have tried the relais sketch on my doormagnet (other project), and after a while it will fail (probably noise causes the problem)
 My system is:
 Arduino nano
 radio NRF2401 PA/LNA
 NRF24L01+ Socket Adapter Board
 relais board
 All of this are connected with jumper wires and the arduino + radio are fed seperatly with a charger.Before I try to build the irregation system I would like to know if there is a good method to calcuate the size of the decoupling capacitor. And where do I have to put it. Do I have to put it on the 230V side, or also on the 5V (on the relais board) Hope too get some aswers here, thanks in advance 
 
- 
					
					
					
					
 @Naitsirhc Since you are using the amplified Radio (PA/LNA) with the socket adapter board he decoupling for the radio should be fine. There are a few discussions on the forum on what kind of problems you can encounter. 
 First suggestion I have is lowering the transmission energy#define RF24_PA_LEVEL RF24_PA_LOWand make sure you have a sufficient supply (not the on-board ldo of the nano or an FTDI adapter).
 
- 
					
					
					
					
 @Naitsirhc welcome back  Whatever you do, DO NOT put the capacitor on the 230V side. Doing that will be very dangerous. 
 
- 
					
					
					
					
 Does the relay board have an optocoupler? 
 
- 
					
					
					
					
 To all, Thanks for your answers. Unfortunatly I didn't have time to check your answers. I will keep in touch 
 
- 
					
					
					
					
 Hi, I promised to keep in touch....  I have disconnected the radio from the Arduino, so the radio is fed through a seperate stable 5V. 
 And also the relais board is fed seperately.
 It runs for a cuple of days and it seems to work well. Time to move on.
 To see if the magnet is working or not, I decided to connect a RGB led. When I connect the led, the board is going bonkers. The led is connected on D5 and D6 and the other side to ground (via a resistor)Anybody a clue? 
 
- 
					
					
					
					
 Maybe it's not related, but shouldn't you have a resistor for every color pin of the rgb led? (unless you turn on one color at a time) 
 
- 
					
					
					
					
 Thanks for your quick reply. The led is indicating one colour at the same time. Green for open and red for close. 
 I can give it a try to have more resistors connected...
 
- 
					
					
					
					
 I just remember it from the learning kit it had one resistor for every pin of the colors, but I actually don't know if it can cause issues. 
 
- 
					
					
					
					
 @Naitsirhc could you describe what you mean by "going bonkers"? 
 
- 
					
					
					
					
 Going bonkers is probably not the right word. I actually meant that the owner, and especialy his wife, are going bonkers  
 What I meant is:
 When I connect the led: (red = D5, Green = D6 and the ground is connected through a resistor of 1K.) When I turn on the relay it's answering for aprox. 5 minutes and than it crashes.
 I can only reanimate it by turning off the power
 
- 
					
					
					
					
 @Naitsirhc there are no crashes if you disconnect the led? 
 
- 
					
					
					
					
 Again, thanks all for answering Until now its working 2 days flawlessly. 
 
- 
					
					
					
					
 Unfortunatly the sensor stopped working last night. I have ordered a relais board with opto coupler.... 
 I will keep in touch
 
 
			
			 
					
				
