Automation HAT(s) with Black HAT Hack3r?

Howdy. Quick, maybe stupid, noob question for you guys. Possible to run two automation hats via the Black HAT Hack3r?

I noted the command in the sample code is just automationhat.relay.one but maybe with I2C its possible to give each hat a unique address?

Combining loads onto a relay would exceed 2A, albeit not by much, but discrete control and monitoring of each load would be snazzy. At this point I’ve got 6 pumps I’d like to control independently.

Thanks in advance!

Unfortunately not, the relays, inputs and outputs are all directly connected to specific IO pins on the Pi, so there’s no address to change.

There are, however, enough free pins left over on the Pi to wire up another Automation HAT manually. See the pinout of the HAT here: https://pinout.xyz/pinout/automation_hat

If you were to connect the 3 relays of a second Automation HAT to any of the available free pins, and hook up power/ground connections, then you would be able to switch them.

Sharing i2c only works if all the devices have unique addresses. To put two or more of the same device on i2c means that device has to have a way of changing its address. Some devices will let you do that some won’t. Even then, it only works if those devices don’t use any of the same other resources like GPIO Pins etc.
And some devices don’t even have an ID EPROM. The no shared PINs rule still applies though.

You may want to use one or more of these to make wiring easier.




Kinda had a feeling that was going to be the case, but figured it was worth a shot. Thanks for the fast feedback, exactly why I picked up your products. Btw that hammer header is fantastic.

I did find an example of some custom work to make an I2C relay board, http://www.instructables.com/id/I2C-Relay-Board/. Assuming it works, nice to have all the relays addressable but not so sure it’s worth all the effort, espescially with everything hard wired and u know what’s connected where.

All this reminded me of an article I read a few years back on the new USB PD spec. Still not much around on it, but supports 5,12,20V and up to 100W, more than enough. Probably still too early, maybe someone’s looked into it?

For a bit of context on what I’m up to, I’ve hacked this indoor vertical herb garden from IKEA parts, the LED grow lights are controlled by a smart plug for now and the peristaltic irrigation pumps by the raspi. Admittedly, overly ambitious, I’d like to make it modular/plugin play so it’s easy to add pumps, lights, monitors whatever else with little to no additional coding once you’ve got it up and running. Ie you could just plug into a USB bus, have it read what kind of device it is and then allow u to control by the pi, power through the USB PD. Yeah…probably overly ambitious.

Inprogress…
https://instagram.com/p/BbSJMxPlOdF/

The Pi Zero could potentially do this. With the newer, more powerful way of configuring USB device settings it can simulate pretty much anything. It wouldn’t be too difficult to build some firmware for Pi Zero that just slaves it to the Pi. Absolutely overkill, though!

Your best bet is to look for cheap Arduino Leonardo compatible boards, if they sport the atmega32u4 then you can set them up as USB serial devices and just do all your ID and command & control over the serial port when it pops up.

You’d probably need external power supplies for each node, but I don’t think it’s that ambitious! What you describe isn’t far from our Flotilla system. Although, granted, Flotilla doesn’t have modules for pumps.

There are lots of already made relay boards for the Pi. Like this
https://www.modmypi.com/raspberry-pi/relays-and-home-automation-1032/relay-boards-1033/modmypi-piot-relay-board

Just do a search, https://www.google.ca/search?source=hp&ei=6dcFWuG7OcjT0gKVhKKoAw&q=raspberry+pi+relay+control+board&oq=raspberry+pi+relay+control+board&gs_l=psy-ab.1.0.0i22i30k1.1858.9912.0.11657.33.32.0.0.0.0.186.4690.0j31.31.0…0…1.1.64.psy-ab…2.31.4683.0…0j0i131k1.0.O9Bex9ppWZ0

You’ll likely find something usable and affordable. Hopefully ;) anyway.

Ah, that Flotilla system is pretty snazzy!

Honestly, a lot of this is new to me, you guys included, up until a few days ago when I saw your product on the shelf at Microcenter here in Chicago. I, in fact, started off looking at larger relay boards but totally judged a book by it’s cover and had a hunch I’d be able to get in touch and bounce ideas around. So thanks for that! (and kudos to the graphic designer(s))

So here’s an idea…take the perma-proto hat alphanumeric suggested earlier and mash it up with Flotilla. Opportunity being you could have custom circuitry that interfaces w/ the raspi via USB. You’ve got a motor module, you’re already 90% of the way there for a little peristaltic pump. Or a relay flotilla, that’d do the trick as well my case.

As for the Arduino, all of this began with an old UNO I had laying around but I wanted the possibility to monitor/setup via phone. They were selling Pi Zero Ws here for $5, less than the cost of just a WiFi shield, so figured I’d give it a go. Still having trouble wrapping my head around the fact that something smaller than a credit card, costing less than a latte, is more powerful than the computer I had in college : |

What I’ve done with my Proto Hats is use them to add extra sensors and buttons. It makes it easy to add other i2c devices without soldering anything directly to the Pi. Sometimes I mount the device right on the proto hat, RTC boards like the DS3231 breakout board. Other things like a SL1145 light sensor I wired via jumper cables. I just soldered male headers on the proto hat.

Not sure how Flotilla will work with it though? That appears to all use USB?

Patiently waiting for a black Pimoroni version of that. ;)

1 Like

Well played alphanumeric.

Seems like I could borrow/tweak your idea and mount a USB breakout board onto the protoboard, add a relay of necessary amperage, then a simple controller to send the signal to the relay and talk to the USB bus. At the price I could just use zero’s at each node, giving you the option of communicating via USB or WiFi but as Phil said, probably overkill. Any other thoughts? Googling USB controller is obviously not working out.

Also knocked the pumps down to 3 (well +1 for the fertilizer which I’ll control off the unused GPIO pins) so this is only for lights now, monitors like soil moisture, whatever else.

I’m no expert, but I think “building your own” USB controller will be a whole lot of work? To be honest I’m not 100% sure what your plan is, I sort of kind of have an idea. The automation hat leaves a fair number of GPIO unused, why not just use them to control your relays? Then you only need the one PI to run it all.
There are also these proto boards, https://shop.pimoroni.com/products/adafruit-perma-proto-multipack They don’t mount to the GPIO bus, you just mount your components and run wires. The layout is the same as those solderless bread boards. Like this.

There are USB jacks you can solder right to a perf board, https://www.adafruit.com/product/2225 I couldn’t find them here at Pimoroni, they are likely there, I just got tired trying to find them.

So quick update on things, in case anyone is interested, for closure at the very least. After playing around with the relays I’ve gone with a high power shift register for the pumps. http://www.ti.com/lit/ds/symlink/tpic6a596.pdf

Got the idea from those cheap LED strips everywhere. No need to have these little irrigation pumps working at the same time, so a single chip should keep things tidy w/ the ProtoZero.

As for the lighting, MOSFETs seem the way to go for PWM dimming.

Still curious about this whole USB Type-C / PD spec … Right now I’ve got a little power brick for the Pi, a 100W LED Driver and a buck converter for another load a bit too much for the Pi not at the driver voltage. Ideally, there could be just a single cable to the wall/USB bus, right? This is where I was driving at in those earlier emails. I probably confused things by getting into data+power, I’d be totally happy with just power simplicity.

Not sure how they isolate the high power and low power devices on a common bus, or if they even? All the new USB-C hubs I’ve seen only have a single type-c and then a bunch of regular USB ports so I’m assuming they’re not even on a common bus?