Project with Picaxe28*2 randomly starts on its own

ausiey

New Member
Hi, recently i built a project with a Picaxe*2 chip and randomly the project activates or starts on its own, it has switches as inputs wired in cat 5 cabling to various areas no longer than 3 mts away from the main board.
This random activation may happen once a week, the project is run on a 12 volt car battery, not connected to power mains power at all.
At first i thought it may be fluorescent lighting switching on and off but have not been able to prove it because i cannot make it happen at will.
Anyone have any ideas, it would be much appreciated, thanks
 

inglewoodpete

Senior Member
Without protection, both inputs and outputs can cause a PIC or PICAXE to restart.
  • Does the PICAXE drive an inductive load?
  • Have you included capacitors close to the PICAXE chip's power pins?
  • Is the download resistor pair permanently wired to the PICAXE?
  • In some situations, 3 metres of cable can provide enough of an invitation for noise to restart a PIC or PICAXE. How are the long leads wired to the PICAXE?
 
Last edited:

ausiey

New Member
* Yes the picaxe does drive a inductive load via a relay. But every time it happens all inductive loads are in the off state.
* No capacitors close to the pic axe power pins direct connection to battery, what do you recommend?
* The download connection is done directly on the board supplied, i will have to check on the model of the board.
* The leads are wired in cat5 network cable, how would you suppress the noise, THANK YOU FOR YOUR ASSISTANCE
 

lbenson

Senior Member
Can you post your circuit and perhaps a photo?

Without protection, both inputs and outputs can cause a PIC or PICAXE to restart.
One thing that this means is that a separately powered input pin can power the PICAXE, even if the PICAXE is not powered. For instance, a serial input from a powered device can power the PICAXE.
 

AllyCat

Senior Member
Hi,

What do you mean by "starts on its own". Is it permanently powered via a regulator from the 12 volt battery? Of course you do have a pull-down resistance on the Programming Input don't you. ;)

If so, is the program normally Sleeping, or running a polling loop, or waiting for for an interrupt? Could the "start" actually be a re-boot (i.e. a reset) caused by a supply dip, or by a pulse on the Serial Input (Programming) pin? Are you using the "Input Only" pin (usually Leg 4) as an input, and if so have you added a "protection" diode from it to the supply rail?

Or is it some type of "push-button and self-latch power on/off" arrangement?

Cheers, Alan.
 

inglewoodpete

Senior Member
* Yes the picaxe does drive a inductive load via a relay. But every time it happens all inductive loads are in the off state.
* No capacitors close to the pic axe power pins direct connection to battery, what do you recommend?
* The download connection is done directly on the board supplied, i will have to check on the model of the board.
* The leads are wired in cat5 network cable, how would you suppress the noise, THANK YOU FOR YOUR ASSISTANCE
If you are driving any load via a relay, then your are driving an inductive load: the relay! Have you included a capacitor or diode across the relay coil to quench the back-EMF generated by the relay coil when it is deactivated?

You need to mount a 0.1uF capacitor as close as possible to the PICAXE's power pins (preferably within 10mm). This will calm electrical noise from impacing the PIC, particularly noise generated by the PIC. Also, add an electrolytic capacitor withing 40mm of the PIC - I suggest a value between 10 and 100uF.

If powering your circuit from a 12v source, have you included the recommended capacitors on the input and output pins of the regulator?

The download circuit is the 10k and 22k resistors wired as specified in Manual 1.
 

Goeytex

Senior Member
If using a car battery then you must be getting 5 Volts from somewhere. Where ? Shall we assume a regulator of sorts ?

If it in a car, then the car's alternator also comes in to play. Alternators can generate rather large noise spikes.
Cat 5 cable is unshielded.

So is it located in an automobile ?
 

ausiey

New Member
Can you post your circuit and perhaps a photo?



One thing that this means is that a separately powered input pin can power the PICAXE, even if the PICAXE is not powered. For instance, a serial input from a powered device can power the PICAXE.
If you are driving any load via a relay, then your are driving an inductive load: the relay! Have you included a capacitor or diode across the relay coil to quench the back-EMF generated by the relay coil when it is deactivated?

You need to mount a 0.1uF capacitor as close as possible to the PICAXE's power pins (preferably within 10mm). This will calm electrical noise from impacing the PIC, particularly noise generated by the PIC. Also, add an electrolytic capacitor withing 40mm of the PIC - I suggest a value between 10 and 100uF.

If powering your circuit from a 12v source, have you included the recommended capacitors on the input and output pins of the regulator?

The download circuit is the 10k and 22k resistors wired as specified in Manual 1.
Hi, Thank you for your reply I will try and see if it solves the problem and let you know of the outcome.
 

ausiey

New Member
If using a car battery then you must be getting 5 Volts from somewhere. Where ? Shall we assume a regulator of sorts ?

If it in a car, then the car's alternator also comes in to play. Alternators can generate rather large noise spikes.
Cat 5 cable is unshielded.

So is it located in an automobile ?
Hi
No it is not located in a car, It is stationery project, I am going to try a few ideas that have been suggested and i will let you know how it works out, thanks
 

ausiey

New Member
Hi,

What do you mean by "starts on its own". Is it permanently powered via a regulator from the 12 volt battery? Of course you do have a pull-down resistance on the Programming Input don't you. ;)

If so, is the program normally Sleeping, or running a polling loop, or waiting for for an interrupt? Could the "start" actually be a re-boot (i.e. a reset) caused by a supply dip, or by a pulse on the Serial Input (Programming) pin? Are you using the "Input Only" pin (usually Leg 4) as an input, and if so have you added a "protection" diode from it to the supply rail?

Or is it some type of "push-button and self-latch power on/off" arrangement?

Cheers, Alan.
Hi Allan
Yes it is permanently powered directly from a 12 volt battery with a regulator that supplies the 5 volt rail, this is directly connected to RKP28 PROJECT PCB, wher the PICAXE28*2 chip is mounted, i assume that the PCB has a pull down resistance on the programming socket.

The program is running a polling loop waiting for an interrupt, I do believe that I may have a power dip or spike causing this fault, I am going to add some capacitors to the 12 volt supply rail as was suggested and try to eliminate some electrical noise and see if it corrects the fault, I will let you know how it works out.

Thanks for your reply
John
 

ausiey

New Member
If you are driving any load via a relay, then your are driving an inductive load: the relay! Have you included a capacitor or diode across the relay coil to quench the back-EMF generated by the relay coil when it is deactivated?

You need to mount a 0.1uF capacitor as close as possible to the PICAXE's power pins (preferably within 10mm). This will calm electrical noise from impacing the PIC, particularly noise generated by the PIC. Also, add an electrolytic capacitor withing 40mm of the PIC - I suggest a value between 10 and 100uF.

If powering your circuit from a 12v source, have you included the recommended capacitors on the input and output pins of the regulator?

The download circuit is the 10k and 22k resistors wired as specified in Manual 1.
Hi
I am using A RKP28PROJECT PCB that has a download socket, I assume it has the resistors installed.
I will try your suggestions and let you know how it works out. I do believe that the triggering is been done by some electrical interference .
FYI, As another clue to the fault.
When the project starts on its own, (starts a electrical motor) it ignores the stop limit switch and the motor keeps on operating. Even though the limit switch sends a signal back to stop the operation.
I will let you know the result of installing the capacitors

Thanks for reply
 

ausiey

New Member
Can you post your circuit and perhaps a photo?



One thing that this means is that a separately powered input pin can power the PICAXE, even if the PICAXE is not powered. For instance, a serial input from a powered device can power the PICAXE.
Hi
I will organise a photo of the cct and the control board ASAP.
Thanks for your reply
 

John West

Senior Member
With little essential circuit info to go on I will make an educated guess that you didn't provide bulk and noise (large and small) input capacitors on the 5 Volt regulator, nor modest sized filter capacitors on the output of the regulator on the Picaxe circuit board itself. So if that's the case, and agreeing with previous posters I'd suggest you go straight to that as the possible problem for erratic behavior. Too many project folks overlook the necessary filtration capacitors, especially when they run their projects on batteries, so missing capacitors are the problem with far too many intermittent circuits.
 
  • Like
Reactions: rq3

BillBWann

Member
The program is running a polling loop waiting for an interrupt......
Do you have a "nap" instruction in that polling loop? I experienced random resets of a program running on an 08M2 which is described here.

In #15 of that thread Hippy acknowledged that "after investigation it does appear there may be an issue with NAP under some circumstances on an 08M2."

If minimizing power isn't an issue, then simply replacing the "nap" instruction with a "pause" should solve your problem.

In my battery operated case, I never found a solution that prevented random resets so I altered the program to retain critical variables in EEPROM so it could perform its function even when the 08M2 randomly reset from time to time. Of course, if you do adopt this solution, you need to keep in mind the limitations in the number of writes to EEPROM.

Bill
 

ausiey

New Member
Do you have a "nap" instruction in that polling loop? I experienced random resets of a program running on an 08M2 which is described here.

In #15 of that thread Hippy acknowledged that "after investigation it does appear there may be an issue with NAP under some circumstances on an 08M2."

If minimizing power isn't an issue, then simply replacing the "nap" instruction with a "pause" should solve your problem.

In my battery operated case, I never found a solution that prevented random resets so I altered the program to retain critical variables in EEPROM so it could perform its function even when the 08M2 randomly reset from time to time. Of course, if you do adopt this solution, you need to keep in mind the limitations in the number of writes to EEPROM.

Bill
Thanks Bill, I will take your suggestion on board.

John
 

ausiey

New Member
Without protection, both inputs and outputs can cause a PIC or PICAXE to restart.
  • Does the PICAXE drive an inductive load?
  • Have you included capacitors close to the PICAXE chip's power pins?
  • Is the download resistor pair permanently wired to the PICAXE?
  • In some situations, 3 metres of cable can provide enough of an invitation for noise to restart a PIC or PICAXE. How are the long leads wired to the PICAXE?
Thank you for your assistance, I included capacitors close to the chip power pins and it seemed to have overcome the fault, thanks again
 

ausiey

New Member
Hi,

What do you mean by "starts on its own". Is it permanently powered via a regulator from the 12 volt battery? Of course you do have a pull-down resistance on the Programming Input don't you. ;)

If so, is the program normally Sleeping, or running a polling loop, or waiting for for an interrupt? Could the "start" actually be a re-boot (i.e. a reset) caused by a supply dip, or by a pulse on the Serial Input (Programming) pin? Are you using the "Input Only" pin (usually Leg 4) as an input, and if so have you added a "protection" diode from it to the supply rail?

Or is it some type of "push-button and self-latch power on/off" arrangement?

Cheers, Alan.
Thank you for your assistance, I included capacitors close to the chip power pins and it seemed to have overcome the fault, thanks again
 

ausiey

New Member
With little essential circuit info to go on I will make an educated guess that you didn't provide bulk and noise (large and small) input capacitors on the 5 Volt regulator, nor modest sized filter capacitors on the output of the regulator on the Picaxe circuit board itself. So if that's the case, and agreeing with previous posters I'd suggest you go straight to that as the possible problem for erratic behavior. Too many project folks overlook the necessary filtration capacitors, especially when they run their projects on batteries, so missing capacitors are the problem with far too many intermittent circuits.
Thank you for your assistance, I included capacitors close to the chip power pins and it seemed to have overcome the fault, thanks again
 

ausiey

New Member
If using a car battery then you must be getting 5 Volts from somewhere. Where ? Shall we assume a regulator of sorts ?

If it in a car, then the car's alternator also comes in to play. Alternators can generate rather large noise spikes.
Cat 5 cable is unshielded.

So is it located in an automobile ?
Thanks for your assistance
 

ausiey

New Member
If you are driving any load via a relay, then your are driving an inductive load: the relay! Have you included a capacitor or diode across the relay coil to quench the back-EMF generated by the relay coil when it is deactivated?

You need to mount a 0.1uF capacitor as close as possible to the PICAXE's power pins (preferably within 10mm). This will calm electrical noise from impacing the PIC, particularly noise generated by the PIC. Also, add an electrolytic capacitor withing 40mm of the PIC - I suggest a value between 10 and 100uF.

If powering your circuit from a 12v source, have you included the recommended capacitors on the input and output pins of the regulator?

The download circuit is the 10k and 22k resistors wired as specified in Manual 1.
Thanks for your assistance a few caps, were installed near the power regulator and it has settled
 
Top