Using Two PICAXE Circuits

les101975jud

New Member
I am a newbie who in a past life many years ago knew a bit about electronics but I am very rusty so my apologies in advance if I am asking a dumb question on here. Basically, I am wondering if my understanding is basically correct. I am proposing to use a PICAXE 28X2 to operate 3 infra sensors as inputs, 4 relays and four LEDs with another output feeding a secondary PICAXE 8M which will operate one servo. If I am correct servos need to use the timer so I decided to use the PICAXE 8M to provide this function. I will need to use the timer on the PICAXE 28X2 to provide timing info for the rest of the equipment and did not want to compromise this by using a servo. Is my understanding on the right lines? Any advice will be gratefully received and thank you in advance.
 

erco

Senior Member
Servo management runs in the background, leaving your program free to do lots of timer-related functions. Offhand, I would bet that a single 20M2 could do everything you ask. If your 4 LEDs turn on and off in sync with your 4 relays, then a 14M2 is also up to the task. Picaxe is great, you'll love it.


My main question is why (here in the US) a 14M2 costs nearly the same as a 20M2, or more, such as at Robotshop http://www.robotshop.com/en/catalogsearch/result/?q=picaxe&order=stats_sales_order_count&dir=desc ?
 
Last edited:

inglewoodpete

Senior Member
I am proposing to use a PICAXE 28X2 to operate 3 infra sensors as inputs....
Depending on what you want to do with the 3 IR receivers, you could probably use just 1 input pin on the PICAXE to receive all three. Most IR receivers have an open collector output which requires a pullup resistor (to +5v) to work. When the receiver senses the IR carrier, it pulls its output low. So if using three sensors mounted in a triangle facing outwards, all 3 outputs can be tied together to just one pullup resistor. When any of the sensors detect an IR carrier, the output will be pulled low.
 

erco

Senior Member
External pullups aren't usually required unless IR receiver modules are connected to high-current circuits (ie, not required going to a Picaxe input). From www.vishay.com/docs/80069/circuit.pdf

As shown in figure 1, the digital output of the TSOP IR receiver modules is an open collector transistor with an internal pull up resistor. An additional external pull up resistor can optionally be used if more current is needed to drive the input of the decoding device or if a faster switching time is required. The logic low level will be below 0.2 V even at a sink current of 2 mA. The output can continuously drive a capacitance of up to 1 nF without risk of damaging the output stage.


I've built dozens of circuits without the pullups and decoupling caps shown in many datasheets, without any issues. IR receivers are remarkably bulletproof and reliable from my experience. I've never tried connecting three modules together directly as you suggest. With the outputs fighting each other, it seems like there would be some effect, perhaps the combined output signal would not go down to the 0.2V described. But since the Picaxe high/low transition voltage is ~1.4V, it might still work. Worth a shot.
 

BeanieBots

Moderator
I've built dozens of circuits without the pullups and decoupling caps shown in many datasheets, without any issues.
Sorry erco but I can't let this go without comment.

I've literally just got back from a trip abroad that has cost two flights and two nights in a hotel (not to mention three days of my life) and several thousand pounds because some moron built a circuit that worked fine on the bench but not in the field because they didn't bother to fit a tuppeny decoupling capacitor!
They cost pence, just fit the damn thing weather you think you can get away with it or not.

Also, in this particular application, the OP is using servos. Decoupling is absolutely essential when using servos. I'd even go as far to say that a simple decoupler across the micro will not be enough. The servo and micro really do need to be decoupled from each other. I would suggest a low value resistor between the two as well as a high uF value cap on BOTH sides in addition to the 'recommended' 0.1uF across the micro.

If you really want to scrimp on cost, leave out the IC socket and download circuit. These are simply a convenience and do not add to reliability. (though I and many others would strongly suggest fitting them). Decoupling is as important as looking both ways when crossing the road. You can "get away with it" if you live in a country village but you want last long in major city. Sticking with the analogy, a servo is the equivalent of crossing a motorway.

PLEASE, ALWAYS fit decoupling as a matter of course. There are countless examples on this forum of issues that have been cured by a simple decoupling cap.
 

rq3

Senior Member
Sorry erco but I can't let this go without comment.

I've literally just got back from a trip abroad that has cost two flights and two nights in a hotel (not to mention three days of my life) and several thousand pounds because some moron built a circuit that worked fine on the bench but not in the field because they didn't bother to fit a tuppeny decoupling capacitor!
They cost pence, just fit the damn thing weather you think you can get away with it or not.

Also, in this particular application, the OP is using servos. Decoupling is absolutely essential when using servos. I'd even go as far to say that a simple decoupler across the micro will not be enough. The servo and micro really do need to be decoupled from each other. I would suggest a low value resistor between the two as well as a high uF value cap on BOTH sides in addition to the 'recommended' 0.1uF across the micro.

If you really want to scrimp on cost, leave out the IC socket and download circuit. These are simply a convenience and do not add to reliability. (though I and many others would strongly suggest fitting them). Decoupling is as important as looking both ways when crossing the road. You can "get away with it" if you live in a country village but you want last long in major city. Sticking with the analogy, a servo is the equivalent of crossing a motorway.

PLEASE, ALWAYS fit decoupling as a matter of course. There are countless examples on this forum of issues that have been cured by a simple decoupling cap.
BeanieBots, I don't think you're being firm enough. Truly I don't. Each and every manufacturer's exemplar for ANY one of their integrated circuits, since 1967 anyway, has shown decoupling capacitors. They would have included them on the chip itself, had there been room.

EVERY IC needs at least a 100 pF cap immediately between its supply and ground to decouple high frequency noise. The ground MUST be common. In NO CASE can the ground currents running through the ground impedance result in ground being anywhere near enough to upset the local digital logic low, or the local analog zero volt reference.

EVERY BOARD needs some level of high current, large, capacitance. The faster the logic, or the higher the current (motor drivers, etc.), the bigger the cap. 10-10,000 uF is not unreasonable.

Bless you. Been there, done that. Multi-hour over-seas flights. Lick finger, touch logic circuit board. Place 100 pF cap HERE. Problem solved.

The problem on this forum is that folks get away without decoupling, and then think it's OK. And then move onto more esoteric designs (driving arc welders or motors, or lifted grounds) and wonder why what worked before no longer does.

Rip
 

erco

Senior Member
@ Impassioned Lads: I said IR receivers don't need pullups or their own decoupling capacitors. My entire post was about IR receivers. I never said a micro didn't need one, of course they do.

Jeepers.
 

tmfkam

Senior Member
I would suggest that if a circuit genuinely fails to work, but does work with the addition of a single decoupling capacitor, the decoupler is masking some inherent problem with the design.

Saying that, I always have a few 100uF of capacitance for each supply rail, if the supplies are fed to additional boards, more 100uf and I like to see 100nF as close as possible to the supply pins of each IC in any design. That doesn't mean that some consideration shouldn't be given to increased track widths for supply lines and grounds and possibly entirely separate tracks (and supplies) for any high current circuits. With special care being taken to avoid high currents in shared ground tracks.

If that is done, the circuit should be reliable *before* any tuppenny decouplers are added.

For the very low currents that IR receivers consume, unless they are positioned at the end of some very long cables in an electrically noisy environment I'd be surprised if their inclusion made the difference between a working circuit and a non-working circuit. Still, if there's room on the board, no harm in including them...
 
Top