First of all - thanks! All of you have really opened up new worlds. I hope this thread is still active. Anyway - I have just embarked on this little project using all of the same (or at least similar) hardware. I have gotten it going in several configurations, all of which I'm sure are not recommended (I've read the 3.3v to 5v issue on several of the threads).
I've never really done circuits before, and have only ever really worked in software userland. That said, forgive me if my questions seem silly.
Gordon mentioned the ULN2803 (which I think is something like this: http://www.mouser.in/Semiconductors/Dis ... yvZ1z0y4di
). Let me start off with my goals:
I'm trying to switch AC 230v (Euro) power via the pi and some temp/RH sensors. I've not fried my pi yet (fingers crossed), however this thread is interesting because I want to go on holiday and make sure my winter garden is taken care of (and be lazy when I get back). Also, I figured the opto-couplers were in there because of the AC / DC switching.
Anyway, in the data sheet, it says, "the ULN2308A device has a 2.7 kOhm series based resistor for each Darlington pair for operations with TTL or 5v CMOS devices."
Perhaps I'm getting hung up on the mentioning of 5v CMOS things, but ... if the GPIO pin is 3.3v, does that mean anything - e.g. if the pin isn't high, is there 5v going to it? Or, does that just mean that it will be 1.22 mA going from the GPIO pin to ground (the setting the pin to low to turn on the relay confuses me)?
I suppose I'm also worried about drawing too much current from the GPIO pins. Is that something to be concerned about? There was a thread about this which I can't find anymore, but in it, iirc, it was mentioned there's a max limit on the current from GPIOs - something to the effect of 15-20 mA, w/ some 50 or or 60 for the whole "bank" [which I assume is 1-17].
So, the ULN2308 is there to separate the 3.3v from 5v and to amplify the current from the GPIO pin to the optocoupler (x8)?
hopefully all this makes sense.