NOTICE: This forum has been archived (i.e. registration and posting is disabled).

Please go to the new forum at https://forum.kylegabriel.com

Any reason why I sh...
 
Notifications
Clear all

Any reason why I should not use this PCF8574 based I2C electromagnetic relay with mycodo?

Page 1 / 2

bartleby
(@bartleby)
Active Member
Joined: 11 months ago
Posts: 14
Topic starter  

Hi.  I've been reading some relay related posts here:

https://kylegabriel.com/forum/general-discussion/initial-support-for-8-and-16-channel-relay-driver-boards-using-mcp23008-or-mcp23017-and-the-uln2803a-darlington-array/#post-672

https://github.com/kizniche/Mycodo/issues/813

https://kylegabriel.com/forum/general-discussion/review-of-a-nice-8-channel-i2c-solid-state-relay-board-available/#post-605

I've decided to try to go with an off-the-shelf I2C electromagnetic relay which I've found on ebay: https://www.ebay.com/itm/8-Channel-I2C-Electromagnetic-Relay-Module-for-Arduino-Raspberry-3-3V-5-0V-iot/392779209301?hash=item5b73771a55:g:lx0AAOSw1w1ep7hE

I figure if I can't get it to work I'll use the mcp23008 tutorial above and put together my own.  Thanks to @tico for that write-up on the mcp relay tutorial.   Any reason I should not use this relay?  Any help is appreciated.  Here are the specs for the relay:

8 Channel Electromagnetic Relay Module with I2C Interface
 
 
- PCB board dimension 72mm x 150mm
 
- Compatible with DIN rail plastic holder
 
- Operation DC voltage – 3.3V and 5.0V
 
- Maximum current @5.0V – 700mA
 
- Maximum current per relay – 10A peak
 
- LEDs indicators for each electromagnetic relay channel
 
- Relays with SPDT switch contacts: Normally Open, Common, Normally Closed
 
- Relay contact resistance 100 milliohms max. ( initial value )
 
- Relay insulation resistance 100 MOhm min. (DC 500V)
 
- Relay operation time 8 ms max
 
- Relay release time 5ms max
 
- Relay dielectric strength 750 VAC, 50/60Hz between contact
 
- Relay dielectric strength  1,500 VAC, 50/60Hz between all elements
 
- Relay expected life Mechanical - 10,000,000 operations min.
 
- Relay expected life Electrical - 100,000 operations min. at rated load 
 
- Working temperature range - 25 C ~ + 80 C
 
- Comes with different slave address 0x27 or 0x3F, depends on the batch
 
- Each board can be assigned an I2C address between 0x20...0x27 (0x38...0x3F) by the DIP switch
 
- The module contains an PCF8574 or PCF8574A chip
 
- The logic power supply voltage should match the voltage levels on the I2C bus. The SDA and SCL lines are pulled up to VDD with 5.6k resistors on the relay module. 
 
- Up to 8 boards can be connected to I2C bus line.
 
 
Arduino sample code for 0x27 slave address - https://drive.google.com/open?id=1bhoR4dusLg54g0WM_b_a0Efto5wGJ3SZ
 
Arduino sample code for 0x3F slave address - https://drive.google.com/open?id=14HXx25LMoYRrmThCqxxRv5AvvmoChJDV
 
 
 
Code for controlling each channel separately - https://drive.google.com/open?id=1xvJZBvRlOtW8DJ1urEnSKOScQ5fM5Zs1
 
 
 
 
Multiboards youtube video - https://youtu.be/E5-fe9CRfko
 
 
 
Device controlling via ESP8266 and REMOTEXY APP - https://youtu.be/qEnsk7ZU8qE
 
 
 

Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 6 years ago
Posts: 612
 

I can't think of a reason not to try it. @tico and I got the PCF8574 muli-channel output working several weeks ago (1, 2), so it should work out of the box with Mycodo.

Mycodo Developer


ReplyQuote
bartleby
(@bartleby)
Active Member
Joined: 11 months ago
Posts: 14
Topic starter  

Thanks Kyle.  I'll get the necessary components and report back.


ReplyQuote
tico
 tico
(@tico)
Trusted Member
Joined: 11 months ago
Posts: 80
 

@bartleby -- Thanks for the comments -- Yeah, I suspect you'll find the Krida PCF8574-based board to be pretty reliable -- I've had good success with it both with my original crude bash scripts that I posted, as well as with the Python module that @kylegabriel committed to recent versions of Mycodo.

Just make a note that some versions of the board will be "default on" when they are first powered on and others will be "default off" depending on which you got. Both should work fine.

Because my board is "default on" and I didn't want to have various blowers / heaters / coolers / humidifiers / etc running non-stop during the 30-90 seconds in between a system reboot and Mycodo running and setting all relays off (other than the ones I want to have off at bootup), I had the 110VAC line source that would power all of the SSRs on the Krida relay board first run thru a single electromechanical relay that is default off, so that no power flows until Mycodo has booted up and disables the relevant SSRs and then enables that electomechanical relay.

Anyhow,

You'll probably also find the MCP23017 and MCP23008 based relay drivers to be a joy. I've been too slammed to write more than the bash scripts which I've already posted, however that solution has worked very well. I like using the MCP23017 and some ULN2803s  with a separate +12VDC power supply to drive some of the cheapo knock-off fake Fotek SSRs that are available on amazon/ebay/aliexpress/etc ...

Honestly I prefer the MCP chips over the PCF chips since the state can be read directly from the chip on the MCPs...

Those chips are also very cheap on digikey as well. If you go that route and have questions I'm happy to help. Cheers!


ReplyQuote
tico
 tico
(@tico)
Trusted Member
Joined: 11 months ago
Posts: 80
 

@bartleby -- correction -- In my last comment I forgot that you were mentioning the mechanical relay version of the Krida board -- not the SSR version that I've used. I'm sure it'll work fine as well, and I've found emails to the builder to be responded to pretty quickly and in great detail (though I used Russian, not English). Anyhow, my previous comment otherwise should apply just as well to the mech relay version.

The only thing that might be a concern is if the supply current to drive all of the relay coils on that board would overwhelm the limited +3.3V capacity of your RPi if all of the relays were enabled simultaneously.

If that were the case, you might consider running that portion of your I2C bus (and the + supply line for the board) it through a 3.3V to 5V logic level converter, since the 5V rail has a greater current supplying capacity. Those are widely available from adafruit, amazon, etc for a dollar or so.


ReplyQuote
bartleby
(@bartleby)
Active Member
Joined: 11 months ago
Posts: 14
Topic starter  

@tico thanks for the additional information.  I should avoid relays with default "on" behavior if I can.  But here's a question I should have asked before with regard to reading the pin states of the PCF8574 and MCP23017:  is one method more reliable than the other?  My intuition tells me that querying the pin state from the MCP chip directly is most reliable.  Am I thinking about this correctly?  

Also,  is this board sold on amazon the equivalent of your MCP23017 circuit described here: https://kylegabriel.com/forum/postid/672/:

https://www.amazon.com/gp/product/B08DFNR2JW/ref=ox_sc_act_title_1?smid=A31G33MT63S07E&psc=1

Any help is appreciated.


ReplyQuote
tico
 tico
(@tico)
Trusted Member
Joined: 11 months ago
Posts: 80
 

@bartleby -- No prob -- happy to help! What I can tell you is that with the Krida relay board that I mentioned before (uses PCF8574 chip), version 1 of the board is default on, however in version 2 of the board you get default off behavior. (This was confirmed to me in emails with the manufacturer). Both boards are visually identical except for the V1 or V2 marking on the PCB. They're on ebay and amazon.

As for reading pin states -- the PCF8574 (and 8575) are both pseudo IO pins, they can be one or the other. In the case of a relay board driver, any transistor relay connected to pin of the PCF chip will always result in either a hi or low state if you try to query the pin status from the chip, regardless of whether you previously told the PCF chip to bring that pin hi or low. You have to basically keep track of the state of the pins in a variable or lockfile or somewhere else in your program. You can see how I did that in kind of an ugly way with my original bash scripts to control the PCF8574 board, and in the case of @kylegabriel 's PCF8574 output module, those states are maintained in the database.

The MCP chips provide a separate register, so you can query that register (OLAT/OLATA/OLATB) to see what the current output states are. If you're using the MCPs (or the PCFs) to just get more input pins, then this difference wouldn't matter at all, however in our case we're driving relay drivers, and have to write a complete byte to the chip to switch the pin state of a single pin, so it's important to be able to keep track of what the state of unrelated pins are/were, so as to calculate the correct byte value to send back to the chip.

As for what's more reliable, I don't think there's a difference, as long as only one process (Mycodo for example) is modifying the state of a single relay board. If you wanted to have unrelated processes modifying other relays connected to the same Pi, it would probably just be safest to give that other process its own relay board, in order to keep things simple.

That link you sent on Amazon is functionally equivalent -- it's just a small form factor version of the MCP23017 on a breakout board. I built my other relay system using DIP sockets and DIP chips -- MCP23017 and MCP23008 are both available in DIP form (DIP10 and DIP18) which makes soldering thru-hole components on cheapo breadboards easily, or even just using prototype boards. As I rambled about in my other post, they pair up well with the ULN2803a chips in order to drive "active low" relay boards and shift the current supply off of the PI and onto an external 5v or 12v power supply.  Also, using DIP sockets is really nice when you have a loose wire and you mistakenly dump 110VAC into a chip and fry it ... since it's just a matter of pulling the old chip and replacing it and being more careful subsequently. :)

https://smile.amazon.com/Adafruit-MCP23008-output-expander-ADA593/dp/B06WD3DD2W/ref=sr_1_3?dchild=1&keywords=MCP23008&qid=1602521541&sr=8-3

and

https://smile.amazon.com/MCP23017-input-output-port-expander/dp/B00I6OEWJM/ref=sr_1_4?dchild=1&keywords=MCP23008&qid=1602521541&sr=8-4

are the first two links that came up, but they're available cheaply from a number of sellers (including adafruit, digikey, etc)

If you're interested, the PCF8574 *is* available in DIP form, but its 16-channel cousin, the PCF8575 only exists in surface mount forms (SOIC, SSOP, VQFN, etc).

 

Also, I recently discovered that Krida's 16-channel SSR relay board uses the MCP23017 chip already, and it's available for $65-69 ebay or amazon (if you want it shipped from the US)

https://smile.amazon.com/IOT-Electronic-Channel-Compatible-Raspberry/dp/B084BMZ5SJ/ref=sr_1_2?dchild=1&keywords=16+channel+ssr&qid=1602521898&sr=8-2

or $56 if you want it shipped from Latvia

https://www.ebay.com/itm/16-Channel-I2C-SSR-Solid-State-Relay-Module-Raspberry-Arduino-2A-120VAC-240VAC/124213685960?hash=item1cebb66ec8:g:EjwAAOSwUXFcWzNz

 

The bash scripts i've posted will work for driving either the MCP23008 or 23017 chips when using "linux command" outputs in Mycodo, and when I finally get a free moment I'll finish making a Python output module for them so they can be supported natively in Mycodo. Regardless, mine have been working well for a while now with the bash scripts.

One last thing to consider, besides the fact that I've found techsupport for the ubiquitous Sainsmart relay boards to be nonexistent, is that apparently the blue relay boards are all active low regardless of whether they're mechanical or SSR. (And therefor easy to drive using the ULN2803a darlington array.) However, if you get one of their black relay boards, the input pins for the relays are all active high, and therefor require a different transistor arrangement if you're *not* planning on driving them directly from a Pi or MCP230xx or PCF857x GPIO pin.

Also, after fighting tons of weird I2C communication problems correlated with switching on and off inductive loads (motors, humidifiers, solenoids) in conjunction with mechanical relays (see my previous posts about either the sparkfun relay board, and/or my adventures with the BME680 sensor for an example), I try to stay away from mechanical relays where possible (to avoid arcs that cause EMI on the I2C bus) as well as adding RC snubber circuits across the terminals of any AC inductive loads, and also using snubber diodes when switching DC inductive loads.

If you're in the beginning stages of planning a build, you might want to consider that up front. :)

Cheers!

This post was modified 6 months ago by tico

ReplyQuote
bartleby
(@bartleby)
Active Member
Joined: 11 months ago
Posts: 14
Topic starter  

Thanks for the detailed explanation and links @tico.  I'm ordering this one from your links to save some soldering and get the MCP chip: https://smile.amazon.com/IOT-Electronic-Channel-Compatible-Raspberry/dp/B084BMZ5SJ/ref=sr_1_2?dchild=1&keywords=16+channel+ssr&qid=1602521898&sr=8-2

I have one of the black SaintSmart boards which I'll save for another project.  Thanks for the default behavior info.

I'm developing some prototypes of a system for growing plants aeroponically.  Developing the physical hardware continues but I think it's usable and now it's time to integrate some electronics and software which will allow for more growing precision and reliability.  Therein lies the challenge for me.  I'm not a programmer and have only a basic understanding of the electronics and general electrical theory.  I am willing to learn and with the help of generous people like you and modern software like mycodo I'm optimistic 😀 

I do want to avoid any pitfalls that I can so I'm putting together a list of all the components I have planned and perhaps you could give me your opinion on my choices.  I should mention that I'm planning on using ruuvitags (bluetooth) for temp and humidity data for the system and I ordered some recently.  They are impressive in how consistent they are across all 3 sensors with both temp and humidity so I wanted to mention it just in case you are interested.  I first read about the BME280 here: http://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.html  

Kind regards.         

 

 


ReplyQuote
tico
 tico
(@tico)
Trusted Member
Joined: 11 months ago
Posts: 80
 

@bartleby -- You're very welcome! If the build quality is as consistent as it was with my 8ch version of it you should be pretty pleased. I can't comment about the ruuvitags (or any bluetooth sensor tbh) because I haven't used them, and I haven't tried to test the reliability of the bluetooth interface on the Pi, especially when polling sensors frequently.

I've pretty much stuck with I2C (almost entirely using soft-gpio to work around the Pi's I2C clock-stretching bugs that affect a lot of chips) and using an I2C multiplexer and various bidirectional isolators and/or 3.3v-5v level shifters and/or differential extenders to work around the electrical issues in my environment, while still trying to drive a lot of sensors and relays. I've tested 5 of the BME280 chips that seemed to keep in-line pretty well even in 95%RH, however the ones mounted on the purple PCBs have annoyingly small solder pads if you want to shift the I2C address, versus the blue- or  grey-PCB breakout board versions sold by adafruit, which have them all exposed on thru-hole pins.

One thing I would recommend thinking about it when you're working with moisture and electronics (especially having AC and DC in close proximity), is making sure that all AC power to the area is on a GFCI-protected outlet or circuit breaker, and that you have also bonded the metal frame of any enclosures together and to the AC ground. I have gotten some shocks due to poorly-isolated equipment in my mushroom grow area, and before a recent rewiring, I was able to measure as high as 30VAC stray ground-to-neutral voltage between the floorboard or the base of the grow tent versus the ground pin of the electrical outlet. No good. (Also probably responsible for some I2C chips that recently got fried when I was hooking up a new board, due to the floating AC potential between either + or - of an isolated DC power supply versus either AC ground or neutral.)  Bonding any metal surfaces together electrically to the building electrical ground (NOT TO NEUTRAL) eliminated that problem.

Also, you might want to consider how you're going to keep the DC power well separated physically and isolated (especially NOT tying DC- to ground as is common in cars/boats) from the AC power, and also separate from your sensor wiring. For me that involves separate conduit ports into my grow tent for each, and keeping my control board with AC relays on one end, DC relays and power supplies on another end, and Pi and sensor and I2C wiring in-between and on yet another end.

Also, don't forget individual fuses for any of your AC or DC relay-switched loads. And since when SSRs fail due to overcurrent/overheating, they tend to fail closed -- ie, *conducting* current -- you might want to have a plan for detecting that and managing that safely.

It's been a lifesaver to have a spare Pi and spares of sensors to do prototyping and testing whenever something inevitably starts misbehaving (or doesn't want to work in the first place).

Anyhow, as usual I'm rambling, and this may not even apply to your scenario.

Do you have specific electrical concerns regarding your aeroponic setup that you're designing/building?


ReplyQuote
bartleby
(@bartleby)
Active Member
Joined: 11 months ago
Posts: 14
Topic starter  

Hey @tico.  You've read my mind as I've been looking at the GFCI stuff recently and was also planning to ask you about "polyfuse" protection for the rPi which some recommend if powering the rPi via pins.  It seems the fuse for the rPi is in the transformer so I'll have to add it if I get rid of the supplied transformer and go with power via the pins. 

I have this type of GFCI in mind as I have lots of DIN rail space to connect them: https://www.amazon.com/NDB2-63C10-1-Circuit-Breaker-Supplemental-Protection/dp/B00NTVARAK/ref=sr_1_2?dchild=1&keywords=gfci+din+rail+10amp+nader&qid=1602790869&sr=8-2

I think I'll get a larger amperage GFCI for now, perhaps 16 amps,  until I can determine the rest of the components.  Is it reasonable since I don't know final load values?

My thinking on the BME280's in bluetooth form is that I can easily move them about inside and outside of the grow tent and not have to deal with the wiring for now.  We shall see how that works. 

Thanks for the explanation of the potential interference problems with the AC and DC wiring.  I will isolate wiring with this in mind.

I was hoping that many of the problems with the rPi would be fixed with the latest 8gb version but I guess some persist.  There are definitely some very nice and powerful SBC's out there now.  I'm actually considering getting the vim3 just for fun: https://www.khadas.com/vim3

I've attached a .png of a spreadsheet (couldn't attach .ods file) I made which lists components I want to use with Mycodo now and in the near future. I'm hoping you could take a look to see if there is anything that jumps out and looks like it could be problematic. Some additional questions:

  1. can you recommend an I2C extender to buy or avoid? I'll likely need one but hopefully not for electrical interference reasons.
  2. Can I run a 3 amp 120v resistive load through 2 channels of the SSR (max 2 amp per channel). In other words, can I split a load that's too large for a single channel among multiple channels of the krida ssr?
  3. Are the PWM --> 0-10V boards the easiest way to control the EC fan and LED dimming with the raspberry pi?  The data sheet on the Meanwell power supply says: "Output constant current level can be adjusted by applying one of the three methodologies between DIM+ and DIM-: 1 ~ 10VDC, or 10V PWM signal or resistance." Datasheet: https://www.meanwell-web.com/content/files/pdfs/productPdfs/MW/HLG-240H-C/HLG-240H-C-spec.pdf

Thank you again tico.  I appreciate all your help with this.

 


ReplyQuote
tico
 tico
(@tico)
Trusted Member
Joined: 11 months ago
Posts: 80
 

@bartleby -- Quick initial reply, since I'm in the middle of a wiring crunch --

With SSRs the common advice is to assume 50% capacity for the running load, especially without heatsinks and/or forced cooling.

And if you could be 110% sure that both the SSRs enabled and disabled in the same microsecond (to avoid one momentarily taking the whole load), *AND* you could be sure that the wire resistance for both paths was identical, then technically you could bridge them. That being said, my recommendation for such loads is to get some standalone 10/20/40Amp SSRs, and drive their +5V DC input either via a Pi GPIO pin (3.3V) thru a transistor to enable via +5V, or grab a standalone MCP230xx chip and optionally a ULN2803a as described in another post of mine in order to drive each standalone SSR.

Example: https://smile.amazon.com/TWTADE-SSR-25-3-32V-24-380V-Solid/dp/B079BBFKP4/ref=sr_1_2?crid=XEFCB5YYPZ2P&dchild=1&keywords=ssr-25da+solid+state+relay+3-32v+dc+%2F+24-380v+ac+%2F+25a&qid=1602799218&sprefix=ssr+DC+AC%2Caps%2C267&sr=8-2

Crydom SSRs are great but a bit pricy. If you get some of the cheapo TWTADE or Fotek SSRs on Amazon/ebay they're probably counterfeit (I'll let you google that), but if you use them at 25% capacity with heatsinks they're great. I would consider that especially for anything that gets up to 1+ amps. Also consider that pumps/fans/solenoids have very high starting surge currents, easily 10x their running loads. Also, look up adding RC snubbers for those inductive loads to protect your SSRs *and* reduce/eliminate radiated electrical noise that can affect your sensors, wireless or not.

I'll have to dig into the PWM details a bit more. Also are you sure that your pump is only 25W??

Your amperage demands so far to seem well within range of that GFCI breaker. Looks like a nice option.

In the alternative, I've wired up a couple of these in surface mount utility "job boxes" nearby my panel -- https://www.leviton.com/en/products/g5262-gy

i2c extenders are great. I like the Sparkfun extender board since it's a quick process to plug in a pair and use plain jane ethernet cable with the included jacks.

These are the first ones I used and I still like them and use them -- as I said before, despite being backordered on sparkfun website they're still available on digikey.

https://www.sparkfun.com/products/14589

I've run fussy BME680 sensors on the other end of one of these that was connected thru 50' of old CAT5 ethernet that was coiled on top of my welder, and had a buddy run some stick welding beads at the same time, and successfully pulled measurements at like 99% success or something like that. (previously I would have errors somewhat often just over 12" of wire with no welding or anything like that happening nearby, just motors and pumps and relays in the same room occasionally turning on/off). $10/ea X 2 saved a ton of headaches.

I'm starting to test other differential extenders (the other chips i mentioned previously) but don't have solid results yet to share.


ReplyQuote
tico
 tico
(@tico)
Trusted Member
Joined: 11 months ago
Posts: 80
 

@bartleby

Okay, had a few spare seconds to look at that Meanwell PS and its dimming function. I'm not 100% sure of this, but it appears that you can *either* add a separate +10VDC PWM signal (not powered from the same power supply) to the DIM+/- terminals, with the PWM controlled externally (via some PWM generator, either standalone or driven by Mycodo via the Pi in some way?) for controlling brightness *above* the constant +10V baseline,

OR

you can add a resistive load between the DIM terminals (ie, a potentiometer) to control brightness *below* the constant +10V baseline.

I do not have that model Meanwell, and in fact the only one I have operating currently does not have any of those functions at all, so I can't test and confirm that.

Despite the datasheet saying that "direct connection to LEDs is suggested, no additional drivers are needed," if either of those options isn't feasible, I don't see why you can't treat the meanwell PS as a typical DC power supply and use it to power a separate PWM circuit of some sort that you can control via Mycodo (if that is your intention -- if you just want to have brightness manually adjustable and have Mycodo just turn it on/off via a relay, then any of the inexpensive DC PWM modules available on amazon/ebay should do the trick, assuming you double/triple/quadruple the amperage rating requirements to play it safe.

Okay, now I'm gonna finally scribble up a hopefully somewhat comprehensible schematic for some of the powersupply and relay driver stuff that I've been talking about. Give me a moment.

The attached image is how i'm using the original Pi power supply via USB, *as well as* a separate 5V power supply for handling lots of additional 5V devices on the Pi (serial devices, I2C, lots of 1-wire devices, powered I2C extenders over sometimes longish cable runs, etc) without causing a voltage sag for the Pi or those devices, and also protecting the Pi from overvoltage (via a blocking diode) as well as possible overcurrent (if the power supply was off but the Pi was on, and trying to charge the power supply's leveling capacitor) via another blocking diode.

Testing the voltage forward of the blocking diodes (for each power supply, before connecting them together) shows a .5V to 1V voltage drop as expected, for each.

I adjusted the external power supply such that its voltage forward of the blocking diode was about .1-.2V above that of the Pi's +5V rail (forward of the blocking diode as well). Then shut everything down, connected them together, and rejoiced at having a +5V supply where the external PS would always supply the majority of the load for devices powered from in-between both blocking diodes.

Additionally, I have yet another 5V power supply (and a +12V supply as well, not shown) for switching on and off power-hungry or noisy loads, like mechanical relay coils or other loads switched via ULN2803a arrays.

You may note that I'm not using a polyfuse for the Pi, because I'm protecting the Pi from voltage from external power supplies and powering the Pi itself thru its own USB port. I suppose I could add a polyfuse (and/or additional protections as well) but I haven't done so yet (for this portion of the overall circuit).

I'll make another post with a diagram of my original MCP230xx + ULN2803a setup.

 

This post was modified 6 months ago by tico

ReplyQuote
tico
 tico
(@tico)
Trusted Member
Joined: 11 months ago
Posts: 80
 

@bartleby (and maybe @kylegabriel , if you're interested), here's another crude schematic of how I've used MCP230xx + ULN2803a darlington transistor arrays to control either low-level active relay boards and/or independent DC loads such as a pile of Fotek/TWTADE/Crydom-clone SSRs using separate +5V (or +12V) power supplies. If you get the DIP package version of these chips they line up really well to put the chips right next to another on a breadboard and use solder bridges to connect them. Ugly, but cheap and works very well so far.

Don't forget to tie +3v3 or +5v to the RESET pin on the MCP chip if you want it to talk to you :)

 

 


ReplyQuote
tico
 tico
(@tico)
Trusted Member
Joined: 11 months ago
Posts: 80
 

@bartleby -- I forgot to mention -- regarding your circuit breaker -- I assume you're familiar with wire gauge requirements for different amperage ratings, but since you mentioned having a basic understanding of electronics in general I felt it's important to make sure that it's clear that if you're using a 16A (or 10A) breaker to protect a circuit, then that means that *ALL* wiring downstream of that breaker (including AC ground connections) *MUST* be capable of safely carrying that full amperage, and in general sized for 80% capacity, unlesss it branches to its own branch that is protected by a smaller and appropriately-sized fuse or circuit breaker for that sub-branch. General rule (in most US jurisdictions that use NEC as far as I'm aware) that means that 30A = 10gauge, 20A = 12gauge, 15A = 14gauge (assuming THHN stranded copper wiring rated for 60degrees Celsius or higher and not having a ton of conductors within same conduit or anything like that).

If you have concerns about that *please* find a buddy that's a licensed electrician in your jurisdiction to help, tho I'm happy to attempt to answer questions if you can double check with a legal authority where you live. :) Not to be pedantic, but *Please* be safe -- fires and shocks both suck a lot. My recent ugly surprises have given me another wake-up call.

This post was modified 6 months ago by tico

ReplyQuote
bartleby
(@bartleby)
Active Member
Joined: 11 months ago
Posts: 14
Topic starter  
Posted by: @tico

@bartleby -- Quick initial reply, since I'm in the middle of a wiring crunch --

With SSRs the common advice is to assume 50% capacity for the running load, especially without heatsinks and/or forced cooling.

And if you could be 110% sure that both the SSRs enabled and disabled in the same microsecond (to avoid one momentarily taking the whole load), *AND* you could be sure that the wire resistance for both paths was identical, then technically you could bridge them. That being said, my recommendation for such loads is to get some standalone 10/20/40Amp SSRs, and drive their +5V DC input either via a Pi GPIO pin (3.3V) thru a transistor to enable via +5V, or grab a standalone MCP230xx chip and optionally a ULN2803a as described in another post of mine in order to drive each standalone SSR.

Example: https://smile.amazon.com/TWTADE-SSR-25-3-32V-24-380V-Solid/dp/B079BBFKP4/ref=sr_1_2?crid=XEFCB5YYPZ2P&dchild=1&keywords=ssr-25da+solid+state+relay+3-32v+dc+%2F+24-380v+ac+%2F+25a&qid=1602799218&sprefix=ssr+DC+AC%2Caps%2C267&sr=8-2

Thanks @tico.  I understand using multiple SSR channels for a single load is asking for problems.  I'm rethinking the strategy as as the LED power supply is at the max 2 amps when at 100% and an air heater will likely exceed this too and possible the reservoir water heater.  Perhaps a 4-channels of TWTADE SSR will do it. 

Crydom SSRs are great but a bit pricy. If you get some of the cheapo TWTADE or Fotek SSRs on Amazon/ebay they're probably counterfeit (I'll let you google that), but if you use them at 25% capacity with heatsinks they're great. I would consider that especially for anything that gets up to 1+ amps. Also consider that pumps/fans/solenoids have very high starting surge currents, easily 10x their running loads. Also, look up adding RC snubbers for those inductive loads to protect your SSRs *and* reduce/eliminate radiated electrical noise that can affect your sensors, wireless or not.

I'll have to dig into the PWM details a bit more. Also are you sure that your pump is only 25W??

Yes the pump is 25 watts.  I'm not sure about the startup inrush of current.  The pump is low-volume and high-pressure at about 330 psi at zero flow.  The actual pumps I'm using are made in china but are very similar to the one with a link in the spreadsheet - but cost significantly less.  The swiss mfr has a better website though. 

Your amperage demands so far to seem well within range of that GFCI breaker. Looks like a nice option.

In the alternative, I've wired up a couple of these in surface mount utility "job boxes" nearby my panel -- https://www.leviton.com/en/products/g5262-gy

i2c extenders are great. I like the Sparkfun extender board since it's a quick process to plug in a pair and use plain jane ethernet cable with the included jacks.

These are the first ones I used and I still like them and use them -- as I said before, despite being backordered on sparkfun website they're still available on digikey.

https://www.sparkfun.com/products/14589

ok that's good to know that they're on digikey as I'm thinking that an easily accessible lcd, selector switch, and a couple of buttons on i2c would be nice.

I've run fussy BME680 sensors on the other end of one of these that was connected thru 50' of old CAT5 ethernet that was coiled on top of my welder, and had a buddy run some stick welding beads at the same time, and successfully pulled measurements at like 99% success or something like that. (previously I would have errors somewhat often just over 12" of wire with no welding or anything like that happening nearby, just motors and pumps and relays in the same room occasionally turning on/off). $10/ea X 2 saved a ton of headaches.

I'm starting to test other differential extenders (the other chips i mentioned previously) but don't have solid results yet to share.

edited to make my responses bold.

 


ReplyQuote
Page 1 / 2