laserhawk64
Senior Member
I simply can't imagine that I'm the first to think of this. Circuit uses the 08M/2 but could really work with ANY PICAXE chip as I understand it, maybe even non-PICAXEs like an Arduino (not sure) -- it's a nifty trick indeed. It's kinda odd that I haven't seen this mentioned here yet, because of how simple and useful it is.
I was thinking about a project of mine where I didn't really want to use a microcontroller, but that would likely wind up simpler and easier if I "broke down" and went with that instead of discrete circuitry (555 and a bunch of passives and transistors). An 08M or 08M2 would've been perfect, if it had two more outputs.
Then it hit me.
All of those IO pins are tri-state. They can be either logic high (positive voltage), logic low (shorted to ground, therefore negative voltage) or set to a high-impedance "off position" (no current flows). Use a set of homemade LED/phototransistor optocouplers (dead simple and fairly cheap) in a pseudo-charlieplexed connection scheme, and you get two outputs per pin. Wire the LEDs so that only one will come on when the output is positive, and the other when it's negative, and both will be off when the output is "off" (I think). The phototransistors will only conduct when the LEDs light up. (IR emitter/detector pairs are perfect here, IMO, although one could kludge something up with white --or green-- LEDs and a handful of CdS cells...)
Simple, cheap, AND effective -- although one would likely want a secondary (non-photoreactive) transistor to power anything of significance, or even a relay for the really beefy stuff. The IR emitter/detector pair that I saw on SparkFun Electronics ($2 a pair, so a little pricey) maxes out at 100mA of current for the "business end" here. (SparkFun sells it as part # SEN-00242.)
I've got a schematic here for you folks, too...
I was thinking about a project of mine where I didn't really want to use a microcontroller, but that would likely wind up simpler and easier if I "broke down" and went with that instead of discrete circuitry (555 and a bunch of passives and transistors). An 08M or 08M2 would've been perfect, if it had two more outputs.
Then it hit me.
All of those IO pins are tri-state. They can be either logic high (positive voltage), logic low (shorted to ground, therefore negative voltage) or set to a high-impedance "off position" (no current flows). Use a set of homemade LED/phototransistor optocouplers (dead simple and fairly cheap) in a pseudo-charlieplexed connection scheme, and you get two outputs per pin. Wire the LEDs so that only one will come on when the output is positive, and the other when it's negative, and both will be off when the output is "off" (I think). The phototransistors will only conduct when the LEDs light up. (IR emitter/detector pairs are perfect here, IMO, although one could kludge something up with white --or green-- LEDs and a handful of CdS cells...)
Simple, cheap, AND effective -- although one would likely want a secondary (non-photoreactive) transistor to power anything of significance, or even a relay for the really beefy stuff. The IR emitter/detector pair that I saw on SparkFun Electronics ($2 a pair, so a little pricey) maxes out at 100mA of current for the "business end" here. (SparkFun sells it as part # SEN-00242.)
I've got a schematic here for you folks, too...