I was really excited - until I started reading the instructions on how to install Raspbian OS, and nodered. Now my brain is fried and I need a new one…
Thanks for posting. Will enjoy building this some day, as my desire for automation is increasing with each new grow - and I love building stuff like this!
It really isn’t that difficult. Helps if you are slightly baked. At least it does for me with Linux. At least you don’t have to “make” anything for these. I always follow the simple rule, which seems to work for me, “It’s easier to Make when you is BAKED!”
Just FYI, the Pi has 3.3V signal outputs. Don’t get the 5V relays, make sure you order the 3.3v relays.
If you wanted to get really inventive, you could custom write your own code, use an I2C serial bus and control up to 112 slave pi devices, each controlling a dozen relays…
If you did not want any interface you could write a program to operate the relays on a timer in about 10 lines of code.
It’s really simple, get an SD card, flash it in windows with a NOOBS (new out of box software) image, put it in the pi, power it on. If you get a 3B+ they are easier to work on for new users.
I can do it in my sleep these days, drop me a PM and I will walk you through it if you like. It would not be too much bother to install raspbian, install this software, then rip that image and put it in my dropbox for you.
Thanks for the heads up! For $5 I’ll give that a shot. I thought the rasberry was like $30
The Pi 3B and 3B+ are $35 to $40. What we are looking at is the Pi Zero (limited, but still good piece of hardware) which runs around $10 to $15 (upward to $30 to $40 if you buy a “kit”).
Remember, make sure it is the Pi Zero W (“W” means WiFi on board).
If you have a Micro Center near by, it is a HELL of a deal. I don’t know whether it is a walk in price or only a reserve online price. The nice thing is, if you have to reserve online, they have it on their “18 Minute” policy, which means it will be available to Pick up in 18 minutes.
Even if you don’t want to use it for this, it is a fun little gadget to mess around with and the fact that it uses an actual OS makes it pretty versatile. There are a bunch of apps out there for it, but I would definitely learn a little Java or Python if you really want to get into it. Hell, an actual computer at the price of an Arduino… WOW!
Have been thinking for a while to pick up a 3B+ to mess around with a HTPC but never seem to get around to it.
I thought they were 5v which would allow you both 3.3v and 5v. Than is good to know. I don’t know why the seller said it would work with the zero. There has got to be a compatible hat out there for this. Any one knows, let us know.
I started doing some research and found that pins 2 and 4 are 5v output. As long as the hat uses these pins as 5v input, they should work.
AFAIK they are a constant 5v output to power something and are not logic outputs. They can be used as reference voltage outputs too.
Note, pins 2 and 4 of the pinout are not the same as the outputs 2 and 4, which are pins 3 and 7 of the pinout. Pin 1 is the 3.3v reference voltage output pin for example.
EDIT : It should not be a problem if the relays you have are for the pi. There are two types, the sort that works with a pi and the sort that don’t. Sounds like you have the right sort
I posted for the people who are reading the thread and might go on Ebay and get the first relays that look like the ones in the thread. They should make sure they are 3.3V relays or they won’t switch reliably.
The OP links to the 5v relay. Would be good to have a definitive answer on this.
Here is the schematic for the OPs listing (source: 4 Channel 5V Relay Module - Wiki):
4_channel_relay_Schematic.pdf (17.1 KB)
Relay datasheet:
Relay_datasheet (1).pdf (91.7 KB)
VCC is the IO voltage level.
JD_VCC is the coil drive voltage
SRD-05VDC-8L-C from their photo indicates that a 5VDC coil is used.
If the PI output is open-drain, then you can utilize 5VDC for both. But, you must be certain that the output is true open drain. Also, the opto-isolators would be a bit pointless in that case. The size of the current limit resistors on input to the isolators is not defined but would assume the current is modest.
Otherwise, VCC is tied to the IO voltage level output from the microcontroller (whatever that is, 3V3 for instance). JD_VCC at the two pin jumper goes to the 5VDC (with the jumper removed).
Here is an example illustration from one of the PI variant that would not be open-drain (it’s push-pull):
Anything greater than rail voltage of 3V3 minus any drop from the diodes (which I don’t know off hand) for the example illustration will essentially short the 5V0 to 3V3 and probably break the PI.
The documentation for your PI variant will tell you if the specific GPIO pin is open-drain or push-pull.
The one that I found was specifically for the Pi and the seller stated that it was compatible with the Zero. Looking at the diagrams, the 3B/3B+ pinouts are the same as the Zero, am I wrong? so it should work for the Zero, if it works for the others.
As for 8K’s hook up, I haven’t analyzed it, just happy it is possible.
BTW… I was a BAAAAAAAAD BOY!!!
I just got me TWO Zeros for $5 each!!!
Went in and asked if they had any and how much. Salesman asked me how many I wanted and I said, “oh just one”. Told me $5 and got me one. Went and paid for it, took it out to the car and then came pack in to pick up the one I reserved. One for the project, sometime, and one to play.
Looking at his circuit, he has VCC coming from pin 2 which is 5v output. This would be used to power the board itself, at 5v, would it not? I don’t know, it has been MANY moons since I really did anything more than basic electrical stuff and no real electronics. I rely on those who know, to tell me what I need to buy and how to hook it up, at least until I start getting comfortable again.
I have a programming question about nodered software.
One of the things I want to do is have a timer start in the ON mode as soon as the Pi powers up, and stay on for a certain amount of time. Is that possible?
I need a circulating pump to turn on and run for one minute - before a compressor turns on - but keep running the entire time the compressor is running.
The compressor turns on when a pressure switch activates when the pressure in my tank gets too low. My plan was to have the pressure switch turn on the Pi, which would immediately start the circulating pump on one timer/relay. Then, one minute later, the compressor turns on from another timer/relay.
Then, when the pressure gets hi enough to turn the pressure switch off, all power is killed to the Pi and both timer/relays turn off as soon as the power is off.
The cycle needs to repeat next time the pressure switch turns on, which will turn the Pi back on, with no action by me - fully automatic.
Can it do that?
What I am trying to do is mix the nutes in a rez for one minute before they get pumped into a hi-pressure accumulator tank. I do NOT want the nute circulating any other time - due to PH issues.
I did not find the full schematic and it appears they have provided only a partial schematic.
Briefly looking at the PI Zero, it appears the board takes 5VDC (either via the connector or USB) and has an on-board regulator that generates 3V3 and 1V8.
The 3V3 and the 1V8 power the processor.
If the processor GPIO rails are 3V3 (likely) having a 5V (minus the diode drops) appearing at the GPIO would be “danger” territory. I can’t really tell the intent without studying the OPs diagram or the PI documentation.
Here is a note from the other PI variants:
The internal diodes shown in the figure are not really substrate diodes, but they are actually parasitic FETs. Electrically, their I-V characteristic looks like a diode’s, but with a greater forward drop and a more gradual knee. They may protect against low current transient events caused by transient out-of-range voltages applied to the pins, but they are not intended to protect against the application of voltages greater than the supply voltage or less than ground, even with an external series resistor. In brief, you should never deliberately forward bias those “diodes”. Consequently, you can not safely place an external pull-up resistor to 5V on the I/O pin. That would forward bias a parasitic FET and owing to its poor internal impedance to the chip’s internal power rail it may overheat, or worse, it may bias up parts of the chip to voltages greater than they can handle. So, don’t do it!
On the relay board, I can not tell what optoisolator part number is and would not be able to determine if any drop is sufficient to bring the IO voltage under the rail voltage. Typically protection diodes on the processor are designed to start conducting at some 3V3 + drop. Maybe 1V over the rail for instance. Might be in the documentation. They will also state things like 5V tolerant IO if it safe otherwise they will not. The other question would be if the optoisolator would be able to operate from a 3V3 supply.
Look around to see if the IO are open-drain. I kind-of doubt. The OP may be doing this purposefully and he may have some further insight.
Besides that, there are certainly relay boards specifically for the PI as well. This one, I think, was targeted towards the Arduino.
The relays @8k_feet listed have a jumper option for external power at 5v. Use the 5V power rail from the USB (5V pins). The inputs in that mode are buffered by transistors that will switch the gates with the 3.3V output. Should be no harm to the pi, but I was careful to select the relay that he listed, because of the external power feature. Not at 4ch relay boards list that option, so others may or may not be suitable.
The GPIOs are operating as push/pull outputs with protection diodes. The protection diodes are the weak link. If anything much more than the rail voltage appear at the GPIO, the rail protection diodes will conduct. You want to avoid forward conduction of those in all cases except for very brief transients.
VCC (5V as wired) takes a voltage drop during conduction (active low) through the optoisolator, the pull-up resistor, and, it appears, an LED. That may be sufficient drop. If you do not see a voltage at the connector in either the on or off state exceeding 3V3 then that sounds fine. Otherwise…
Anyways, carry-on. I just wanted to post the relay board schematic that someone was looking for.
What I was trying to say is that the relay board itself has transistors in addition, (I think) creating high impedance inputs. The relays can operate in two modes, depending on a jumper. It looks like the pathway through the optocoupler gets bypassed in that mode… but without studying traces, I’m not sure. The ground pour and wiring on the transistor makes me believe that it’s the drain, so no worries on the pi end.
I’ll let everyone know if it browns out pins on my pi, but so far so good!
I was goin gto order the Pi and power supply from Sparkfun as per the links in the OP. The total cost with shipping and tax came to $26.53.
Then I found this ‘kit’ on Amazon that has all that plus so,e other extras - including a header, heatsink, and other goodies for $26.99 plus tax. If you are a Prime member, its a slightly better deal.