Shop OBEX P1 Docs P2 Docs Learn Events
BS2 vs BS2p strange behaviour — Parallax Forums

BS2 vs BS2p strange behaviour

ratsplinterratsplinter Posts: 2
edited 2012-06-27 10:53 in BASIC Stamp
Started playing around with the stamps, and i have the following problem.
Basicly I have 12v + and - connected to the stamp, with a 5v reed relay connected to PIN 1.
The reed relay acts as a switch for a bigger 12v relay, grounding the 12v relay when I send the High command to pin 1.
Now this works perfect with the BS2 but with the BS2P, the instant I give the LOW command, the program just stops, sometimes restarting.
My first thought was that the relay causes a power surge, but since its when I send the LOW command, i am confused.
Any thoughts ?

Comments

  • ercoerco Posts: 20,256
    edited 2012-06-27 02:01
    Do you have a flyback/freewheeling/snubber diode across your relay coil? If not, that spike can reset or fry your controller. You can use a regular silicon diode like a 1N4001 or equivalent.

    http://en.wikipedia.org/wiki/Flyback_diode

    http://www.azatrax.com/relay-contacts.html
  • ratsplinterratsplinter Posts: 2
    edited 2012-06-27 09:31
    No I dont have a flyback diode on the coil, will give that a bash aswell.
    But I still find it strange that it behaves differently between the BS2 and BS2P....sure the same thing should happen on both if it was due to a spike.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-06-27 10:53
    The BS2 and BS2p operate at different frequencies, use different chips for their interpreters and have different layouts (the BS2p has many more I/O pins to pick up stray noise and EMI) so it stands to reason that sometimes noise issues like this will affect one and not the other. Even the reed relay can generate noise when its internal leaf contacts come together. I would consider driving the 12V relay directly with a transistor and be sure to use the aformentioned diode.

    An example of how to accomplish this can be found in the documentation of our Dual Relay Board Kit (#27114). I hope this helps.
Sign In or Register to comment.