strange picaxe crash

I am running both a small 08m circuit and a cellphone off the same 3.7volt lith-ion battery.

The 08m circuit drives small relays directly which simulate pressing the buttons on the cellphone.

Up until now the whole system has been behaving very well, but every now and then the picaxe seems to "crash" and the only way to get it going again is to reset it by dissconnecting and reconnecting the battery.

I am using the disableBOD command so the power consumption is reduced to almost zero, as well as underclocking the chip to 32khz. I have no filtering on the circuit currently.

Will filtering help (a capacitor across the power input to the AXE)? could this be casued by the diableBOD command? or the underclocking?

Cheers for any insight, its really fustrating as it is faluts seem to be totally random.

mark
 

BeanieBots

Moderator
Switching relays is very noisy. Filtering is ESSENTIAL.
You must also have a catch diode on the relay coil to protect the transistor.
The energy "caught" by the diode is dumped onto the power rail. Without filtering, this will go straight into the PICAXE and on a bad day could even damage it.
I'd suggest 10uF near the catch diode and 100nF near the PICAXE.
 
The relays are tiny, from memory SY4096 from jaycar.co.nz (at work with limited internet acess so cant check :( ). No coils or anything, smaller than a 08m with only 6 legs. would they still casue problems?
 

westaust55

Moderator
Mobile phones also generate a lot of RFI that can get into electronic circuits.

Try putting a mobile next to a CRT type computer monitor in particular and every now and again you will see the CRT screen become distorted while the mobile sends out a signal as part of detecting where it is.

That how your location can be traced by the telephone co/police when you have your mobile on even if not making calls. :)

My guess is the occassional RFI may be disrupting the operation of your PICAXE chip. small 100nF capacitors on the suppy and other wires (which act like antenna) can help filter out some of the "noise" but not any RFI directly acting on the IC circuit.

Still at this point give some small cap a try.
 

hippy

Ex-Staff (retired)
One thing you can try is modifying the code so it uses SERTXD to report what it is doing to the Programming Editor Terminal or other terminal emulator, then see what happened prior to it going into its hung state.

That could be a time consuming and resource hungry job though.
 
never thought of the circut acting like an antenna

make sence. Have u seen those little sticker things that attach to your mobile phone. When you are making a call or sending a txt a little LED flashes, all powered by a small antenna and the RF given off from the phone.

haha i almost got the cat number right, i am driving those relays directly off the pic, will that casue any problems?

I have made a few of these circuits, and have had a couple of them crash, they usually last several weeks of continued operation before getting hung up.

The problem has become more a lot more common after taking out an input (reed switch, on when high) to the pic and instead grounding it with a 10k resistor. The code changed slightly but nothing that should casue a unexpected crash. i wonder if by doing this it has turned the redundent track on the PCB into a antenna that casues a voltage spike?

i will add a some capacitors to the circuit. What about some sort of sheilding?

Mark
 

hippy

Ex-Staff (retired)
The problem has become more a lot more common after taking out an input (reed switch, on when high) to the pic and instead grounding it with a 10k resistor. The code changed slightly but nothing that should casue a unexpected crash. i wonder if by doing this it has turned the redundent track on the PCB into a antenna that casues a voltage spike?
Could be. You could try replacing it with a 1K or even wiring it directly to 0V.
 

westaust55

Moderator
The SY4090 has an operating current range of 5mA to 20mA.

data sheet does not state a forward voltage drop but suggest try a 330 ohm resistor rather than direct connection. That will give around 10mA current.
 

boriz

Senior Member
Also..

“off the same 3.7volt lith-ion battery”

Could be noise/surge’s on the power line. 3.7V is not too far above AXE minimum. The phone ‘checking in’ might put the AXE supply voltage below tolerance briefly.

Definitely need power filtering. Try a 100nF cap across the AXE power pins, as close to the chip as possible, AND an electrolytic 470uF cap in the same place. Break the +ve supply wire upstream (closer to the battery) from the caps and insert a series resistor of the order 10R to 20R ish. This will allow the battery voltage to fluctuate a little and not effect the AXE voltage too much, so long as the fluctuations are short lived. A series diode would be better instead of the resistor, but you can’t really afford the voltage drop.

If you notice an improvement, but still get crashes, make the resistor smaller and the electrolytic capacitor bigger. Don’t replace the 470, just add another in parallel. This will double the capacitance and half the effective series resistance.

Can you get hold of aluminium self adhesive tape? Just the thing for shielding small circuits. Wrap the circuit up in the tape (one continuous conducting length) and make sure that it is electrically connected to 0V (battery –ve) someplace. Careful not to allow the tape to make electrical contact with any other part of the circuit.

You might also consider a small switching 5v boost regulator to provide a nice clean 5V supply from the noisy 3.7V supply. You can find them all over the net fairly cheap.
 
Top