Is the PICAXE 08 27MHz tollerant?

Grogster

Senior Member
I have a very simple circuit here, which waits about 5 seconds after an input goes low, then trips a relay to control something else. I have a 27MHz micro-power transmitter link which goes active when the relay closes, but at the very instant that the relay closes, the transmitter DOES activate, but the relay drops out again within about 200ms or so, yet it is supposed to stay closed for one second.

The code is beyond basic:

high 2
wait 1
low 2

That's it, but the relay is not staying active for the 1 second.
If I disconnect the relay contacts, so that the circuit operates, but does not trip the transmitter, the circuit works perfectly, and I have my 1 second "ON" delay. The second I reconnect the relay contacts, the relay drops out too soon, which is why I am wondering how the PIC is reacting to the 27MHz signal...

Relay contacts are clean - they are not directly(via the PCB) ground-referencing or tieing high, anthing connected to it. The transmitter itself runs directly from the 12v supply, and you ground the enable line to activate the transmitter, so I have done this via the relay contacts - connect the NO and COM lines from the relay across the transmitter's GND and EN lines.

PSU is regulated 12v @ 1.25A, regulated down to 5v for the PIC via 7805, with darlington transistor arrangement driving the relay from the 12v supply. The 12v input has a 470uF filter along with 100n, and there is also a 100n right beside the PICAXE to help filter off any noise in the PSU.

27MHz transmitter draws 40mA when transmitting - including a flashing red LED, so the actual transmitt power must be flea-powered.

So, I am wondering if the PICAXE, or any other PIC does not like 27MHz or for that matter, any other frequencies.
 
Last edited:

westaust55

Moderator
How close is your 27MHz transimtter to the PICAXE?

Try operating with the transimtter further away.

I had some difficulties with a 6kHz signal from a humidity sensor when the sensor board and another baord with the PICAXE 08M and a 433MHz transitter were in extremely close proximity. Moved the sensor about 6mm further away and no further problems.
 

Grogster

Senior Member
Thanks.
Transmitter is about 1 foot away from the 08.

The really odd thing, is that if I reprogram the code for a two second "ON" time instead of a one second "ON" time, the problem vanishes.

I'll keep it in 2-second "ON" time for now - I don't understand the logic of this one...:confused:

BTW, westaust55 - the PICAXE breadboard emulator - very nice work indeed. :)
 
Last edited:

MartinM57

Moderator
Worth putting in some debugging to see what's going on....you can't tell if the PICAXE is resetting/terminating the wait early or something else...

sertxd ("reset", CR, LF)

main:
sertxd ("going high", CR, LF)
high 2
sertxd ("waiting", CR, LF)
wait 1
sertxd ("going low", CR, LF)
low 2
goto main
 

Grogster

Senior Member
Another excellent idea - thanks - will see if I can find time to try that tomorrow. :)
sertxd is not supported on the 08 PICAXE, but I could easily change that to serout...
 

hippy

Ex-Staff (retired)
All semiconductors and circuits can be prone to interference, hence EMC regulations on what products can generate and what they must be immune to. EM interference can come through power supply, any circuit wires and even induced in the chip itself. The PICmicro / PICAXE are no more susceptible to EMI than any other chips in my experience.

The odd behaviour when holding the relay for two seconds is strange, as in the first case the relay drops out before it even had a chance to complete one second, but such bizarre things do happen. It could be some unrecognised external effect, leaning differently on a desk when running one program and the other.

As suggested, add SERTXD messages so you can see if the PICAXE is resetting and observe how the program progresses. Best to add a PAUSE 2000 at the start to give the Terminal time to open before sending the first message.
 

manuka

Senior Member
Mmm "Micropower"- just how strong is your TX? Shielding? Weak but firm pull ups/pull downs? Almost any modern circuitry near to a TX runs the risk of crystal set style pickup, especially if wiring is not short & direct. I had a lot of logic woes once with a powerful AM radio station ~1km away causing bizarre breadboard behaviour. Reducing wire lengths helped ease this. However I've run ½ Watt 470 MHz UHF CBs very near 08M/18X with no troubles. Of course my wiring these days is very clean !

Have you done the obvious & switched something other than the TX with these commands? Tried using another 08? These original 08s are pretty well obsolete of course,so have you tried a much superior (& standard since 2004!) 08M? These of course support SERTXD too.

THOUGHT: How about a few pictures for us to ponder- we may well spot something!
 
Last edited:

kevrus

New Member
This is interesting, I would spend some time trying different delay combinations, for example...

Code:
high 2
wait 1
wait 1
low 2
to see if two '1 second' delays work?
and/or

Code:
high 2
pause 500
pause 500
low 2
to see if two '500 millisecond' delays work?
and/or

Code:
high 2

do
inc w0
pause 1
loop until w0=1000

low 2
another '1 second' delay (excluding the time for the loop)

Nothing scientific here, just interest. I would try it myself but don't have a circuit suffering from the same problems
 

Dippy

Moderator
Have you tried disconnecting Tx so that you simply trigger the relay?
i.e. trigger relay electrically but no RF switched?

How, exactly, have you connected relay?
Is it possible to trigger EN with a transistor?

Have you tried a decoupling cap right next to PICAXE power pins?
Have you checked to see if there is a spike/droop in power supply line when it triggers relay? You may need a scope for this.

Many circuits can be upset by unsuitable physical wiring.
So, nice PCB, nice stripboard or horrible hairy mess? :)
 

fernando_g

Senior Member
"Have you tried disconnecting Tx so that you simply trigger the relay?
i.e. trigger relay electrically but no RF switched?"

My thoughts, exactly.
If you disable the RF transmission, and it works, at least you know that electromagnetic interference is the cause for the bizarre behavior.

Back in the good old analog audio days, high gain preamplifiers for moving coil pickups were very prone to interference. There was an old National Semiconductor app note which had a bunch of proposed fixes: shielding, grounding, bypassing, short wires, capacitors, ferrite beads, and praying.
 

Grogster

Senior Member
From my 1st post:

If I disconnect the relay contacts, so that the circuit operates, but does not trip the transmitter, the circuit works perfectly, and I have my 1 second "ON" delay. The second I reconnect the relay contacts, the relay drops out too soon, which is why I am wondering how the PIC is reacting to the 27MHz signal...

The 12v input has a 470uF filter along with 100n, and there is also a 100n right beside the PICAXE to help filter off any noise in the PSU.
I could try an 08M as suggested.

The problem is more academic at this point, as with 2 second delay, the unit is working as expected, so I don't plan to do any more work on it, unless it proves to be a problem.

I still have the original on the breadboard, so I could tinker with that. :)
Thing is - I never connected the transmitter to the relay, as I did not figure that would ever be a problem, as it is just an on/off switch via the relay. Go figure... Next time, I will hook up anything else designed to be controlled on the bench too.

Here is an image of the PCB:
http://img193.imageshack.us/img193/7163/doorlockdelay.gif

KEY is for connecting a day-mode keyswitch, which bypasses the alarm so the door can stay open.
There is a microswitch in the door, which is operated when the door lock is engaged, and this microswitch connects across the LOCK input.

Basically, when NOT in day-mode, people have 60 seconds to unlock the door, get in, close the door and relock it again. If the circuit does not see the door locked after 60 seconds, it activates the relay, which in turn activates the 27MHz transmitter, which links to a paging system and sends a message to the night-staff's belt-pager that the door is unlocked.
 
Last edited:

Grogster

Senior Member
Hey, no problem - thanks for being so honest...
Many other forums' moderators would not be that forthcoming...
:)
 
Top