Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Maximum Number of Zones
#51
(2021 Jun 24, 06:55 AM)astrogerard Wrote: Yeah, that is expected behaviour when using fairly long wires (as you have on the breadboard) and not using decoupling capacitors on all the 5v connections.
I would start by putting a capacitor (e.g. 0.1uF) on every hc595 between pin 16 (5v) and pin 8 (GND).  
On the breadboard itself between 5v and GND I would use a 47uF (more or less).

For more info see this and this
 

--Gerard

Hello Gerard

Thank you for the information.  It's makes sense.

"a capacitor (e.g. 0.1uF) on every hc595 between pin 16 (5v) and pin 8 (GND)"

So I would insert the capacitor in the same holes as the  hc595 pin 16 and pin 8?

UPDATED:  I installed four 0.1uF, one for each hc593, wired everything back up, powered everything up and tested.  Results are the same.  Unplugging and plugging the USB irrigation enclosure fan triggers the RELAYS.

You said "On the breadboard itself between 5v and GND I would use a 47uF (more or less)."

What volt 47uF would you recommend? (20v, 30v 50v or more)

Do I install two 47uF on the BREADBOARD, one on the TOP POWER RAIL and one on the BOTTOM POWER RAIL?

Speaking of BREADBOARD the GND of the TOP POWER RAIL is connected to the GND of the BOTTOM POWER RAIL and each POWER RAIL has an independent power supply. (Pi powers TOP RAIL, 2nd power supply BOTTOM RAIL)  Will adding one or more 47uF to the BREADBOARD cause a problem?

I am wondering if this would happen if the Pi was being powered by a better power supply (brick style) rather than a small wall wart (charger style)?

What does this say about the APC UPS?  I would have thought that the UPS and its battery would buffer any power fluctuations.  Is this a noise issue?

Can you recommend a book for someone wanting to learn the basics but not interested in becoming an EE?

Thank you again for your time and assistance.
Reply
#52
(un)plugging an usb device is always a bit tricky especially when it is a fan. A fan is a motor and by disconnecting the fan there will be a (huge) spike on the 5v rail since the usb 5v is directly connected to the 5v pin on the pi. Earlier you mentioned when switching on/off devices on the mains the undesired switching also occurs. I assume you don't have an oscilloscope to identify the problem so you must eliminate the problem with trial and error. putting the right capacitors in various places is a good start.

To your questions/remarks the following:
- the 47uF capacitor should be at rated at 16v or higher when using it on the 5v rail.
- assuming the top rail gets power from the Pi and is only powering the shift registers decoupling with 1 (or 2 on each end) is a good practice
- the bottom power rail makes no sense to me why you have this connected. The best is to use the extra psu only for powering the relay boards and try to keep these wiring away prom the Pi and shift registers.
- do not connect both GND's (top and bottom) together. Keep them isolated from each other.
- the Pi is very sensitive on the supplied voltage. The original psu's deliver 5.1 or 5.2V.  Most 5v adapters are made for charging and usually show a voltage drop to way below 5v. The Pi can then easily brown out or gives erratic behavior.  So, use a good psu for the Pi with the right voltage and use the cheaper ones for the relay board(s).

The UPS I can't say much about it. From the datasheet I see there is noise suppression on the outlets but I'm not sure if this is sufficient or of any influence on your issue.
I always salvage inlet filters (e.g. like this) from old equipment and reuse these on most of the diy stuff I do. Also on my SIP irrigation system such a filter is present so the garden is not watered when I'm turning on the table saw, lathe, mill or start welding  Tongue

For a book recommendation, I'm not the right person to give advice. Although I studied "higher electronics" many many ears ago, the last 30 years I learned by doing. The internet is one huge book of which some is true.  Smile 

Hopefully you will find the solution soon. Don't give up, your almost there.
Reply
#53
(2021 Jun 24, 06:24 PM)astrogerard Wrote: (un)plugging an usb device is always a bit tricky especially when it is a fan. A fan is a motor and by disconnecting the fan there will be a (huge) spike on the 5v rail since the usb 5v is directly connected to the 5v pin on the pi. Earlier you mentioned when switching on/off devices on the mains the undesired switching also occurs. I assume you don't have an oscilloscope to identify the problem so you must eliminate the problem with trial and error. putting the right capacitors in various places is a good start.

To your questions/remarks the following:
- the 47uF capacitor should be at rated at 16v or higher when using it on the 5v rail.
- assuming the top rail gets power from the Pi and is only powering the shift registers decoupling with 1 (or 2 on each end) is a good practice
- the bottom power rail makes no sense to me why you have this connected. The best is to use the extra psu only for powering the relay boards and try to keep these wiring away prom the Pi and shift registers.
- do not connect both GND's (top and bottom) together. Keep them isolated from each other.
- the Pi is very sensitive on the supplied voltage. The original psu's deliver 5.1 or 5.2V.  Most 5v adapters are made for charging and usually show a voltage drop to way below 5v. The Pi can then easily brown out or gives erratic behavior.  So, use a good psu for the Pi with the right voltage and use the cheaper ones for the relay board(s).

The UPS I can't say much about it. From the datasheet I see there is noise suppression on the outlets but I'm not sure if this is sufficient or of any influence on your issue.
I always salvage inlet filters (e.g. like this) from old equipment and reuse these on most of the diy stuff I do. Also on my SIP irrigation system such a filter is present so the garden is not watered when I'm turning on the table saw, lathe, mill or start welding  Tongue

For a book recommendation, I'm not the right person to give advice. Although I studied "higher electronics" many many ears ago, the last 30 years I learned by doing. The internet is one huge book of which some is true.  Smile 

Hopefully you will find the solution soon. Don't give up, your almost there.

The USB fan is NOT connected to the POWER RAIL it is connected to a USB adaptor and plugged into the NON BATTERY side of the UPS.

"putting the right capacitors in various places is a good start."

Should I anticipate that the 47uF will resolve the issue at hand?

"only powering the shift registers decoupling with 1 (or 2 on each end) " 

Just to verify I make the connection between the POSITIVE and the NEGATIVE using the 47uF on the TOP RAIL?

"the bottom power rail makes no sense to me why you have this connected. The best is to use the extra psu only for powering the relay boards and try to keep these wiring away prom the Pi and shift registers."  "do not connect both GND's (top and bottom) together. Keep them isolated from each other."  

There is a ground wire connecting each of the SHIFT REGISTERS to the BOTTOM RAIL. The BOTTOM RAIL GND is CONNECTED to the TOP RAIL GND.  Doesn't there need to be a common GND between the Pi powered shift registers and the secondary powered RELAYS?

I was using the BOTTOM RAIL for power distribution for the RELAYS.  ie I attached the secondary power to the BOTTOM RAIL and then attached the RELAYS JD-VCC and GND.  I will remove the secondary power supply from the BOTTOM RAIL.
Reply
#54
Should I anticipate that the 47uF will resolve the issue at hand?
In general, larger capacitors (47uF.. 100uF) are used to stabilize (flatten) the power. In other words, compensate against small fluctuations.  Smaller capacitors are used to reduce noise. Since noise or spikes are fast events the capacitor needs to be smaller otherwise charging the cap takes too long and the noise is still there. Depending on the type (frequency) of the noise/spikes values between 0.1uF (100nF) and 0.01uF (10nF) are a good start.  According to the datasheet of the HC595 0.1uF between pin16(+5) and pin8(GND) is recommended.

Just to verify I make the connection between the POSITIVE and the NEGATIVE using the 47uF on the TOP RAIL?
Yes. When using longer rails you could use two, on either end one

Doesn't there need to be a common GND between the Pi powered shift registers and the secondary powered RELAYS?
No, there should be absolutely no physical (electrical) connection what so ever. The only connection between the output of the HC595' and the relays is optical through the optocouplers (small 4 pin black devices on the relay boards).  

btw, do you have the "optional" 0.1uF capacitor connected as described in the Wiki. That capacitor is in fact mandatory and not optional.
Reply
#55
(2021 Jun 24, 09:58 PM)astrogerard Wrote: btw, do you have the "optional" 0.1uF capacitor connected as described in the Wiki. That capacitor is in fact mandatory and not optional.

I had it installed but removed it when the anomalies appeared. Reinstalled it but doing so caused n1 on the first relay module LED to energize so I removed it again. I was not able to turn it off via the SIP app. Was installed it above the last SHIFT REGISTER.
Reply
#56
(2021 Jun 24, 11:47 PM)HereComesTheRain Wrote: I had it installed but removed it when the anomalies appeared. Reinstalled it but doing so caused n1 on the first relay module LED to energize so I removed it again. I was not able to turn it off via the SIP app. Was installed it above the last SHIFT REGISTER.

It should be placed on the first hc595 at the connection point of the Pi. Even better is a 100ohm resistor in series. Something like this

Code:
Pi ---[ R100 ]---|-----> to hc595
                 = 0.1u
         |    
Gnd -------------------

Also, never connect wires or components while powered on. I assume you do know this but want to mention it anyway.

Without the right measuring equipment it is trial and error. You will get there I'm sure :-)
Reply
#57
(2021 Jun 25, 09:49 AM)astrogerard Wrote: It should be placed on the first hc595 at the connection point of the Pi. Even better is a 100ohm resistor in series. Something like this

Code:
Pi ---[ R100 ]---|-----> to hc595
                 = 0.1u
         |    
Gnd -------------------

Also, never connect wires or components while powered on. I assume you do know this but want to mention it anyway.

Without the right measuring equipment it is trial and error. You will get there I'm sure :-)

Just to clarify I have the 10k resistor installed.  I do not have the .1u installed.

With regards to .1u placement I was going by the diagram located here https://github.com/Dan-in-CA/sip/wiki/Relay-interface.  Also note the short blue jumper wires going to GND on the BOTTOM POWER RAIL.

I'm a NOOB in all caps but I'm cautious, I halt and power everything off before doing anything. I try to limit the potential for disaster whenever possible.  It would be nice to have a POWER OFF button under OPTIONS / System Restart. For me it would save a trek into the house to start an ssh session into the Pi to issue a shutdown now -P command.  (Dan are you listening?)

I have a multimeter would that be of any help?

"100ohm resistor in series" Would you break that down for me? I'm trying to figure out how/where it goes in relationship to the diagram located at https://github.com/Dan-in-CA/sip/wiki/Relay-interface.
Reply
#58
The 10K in the Wiki is connected to pin 13 of the hc595.
The capacitor and preferably the 100 Ohm resistor is in pin 12 of the hc595. The 100 Ohm resistor should go between the brown wire and the Pi. But as close to the breadboard as possible. The capacitor should go behind the resistor on pin12 of the hc595 and gnd.

Yes I know the wiki shows a connection between the two rails. That is only valid if you have one psu. When using galvanic isolation (by far the best solution) the should not be any connection between the rails otherwise the whole concept of isolation will fail. (and most likely kill your Pi on the next lightning storm)

A power down button is fairly easy to implement but do you/we really want that? A few month per year I'm a 2 day drive away from home so if I by accident push the wrong button my plants will die :-)

A multimeter is essential to have but you can't see noise or spikes. To identify a problem I sometimes use a battery or powerbank to supply 12v or 5v just to eliminate the mains psu and see if that solves the problem. It is not a permanent solution but can push your thinking in the right direction.

@Dan, do you know if there in de code some initialisation of the Pi's internal pull-up or pull-down resistors?
--Gerard
Reply
#59
Yes I am listening and learning.

Gerard is far more knowledgeable about the electronics that I am his input is greatly appreciated.



A shutdown button has been considered but not added for the reason Gerard mentioned. If SIP is killed from a remote location there would be no way to restart.



Dan
<p><br></p>
Reply
#60
@Rob,

Lets do a little experiment.  Big Grin

In the picture from the Wiki there is a purple wire connected to pin 13 on all the hc595

Can you pull that wire from the Pi and connect this wire to GND? And test again?

Pin 13 of the HC595 is inverted OE (Output Enable). According to the datasheet, if this pin is high the output of the HC595 goes in "high impedance" mode which essentially means it is neither high or low. 

I have unfortunately no spare HC595 to test so everything I suggest is based on theory.

--Gerard
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)