Electrical Issue: PIC input false triggering, Signal Noise suspected.


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    I'm not sure about the current required for the "run/stop, direction and turnout relays" but I notice you are sourcing the current instead of sinking it thru the PIC. That's bad design to me as most mosfet's even in the case of internal fet's in the PIC can sink more current than source. I would ideally use a NPN transistor for the relay drive circuits and feed them as a separate supply connection to the board where the power enters. I would also place a 10uF cap at the PIC pin's 19 & 20 along with the 100nF cap you already have. I also notice you have NO cap's for the display power circuits. I agree with Henrick that the ideal interface method is for optoIsolators on the inputs from the reed switches. If the wiring is run along side the track and the engine is running there is quite a bit of coupled energy into the inputs of the PIC as the engine is probably driven by a DC Brushed motor as well as the wheels making and breaking the circuit.
    Dave Purola,
    N8NTA
    EN82fn

  2. #2
    Join Date
    Jun 2015
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    Dave,

    As a novice I don't get exposure to best practices so this advice is very welcome. I will copy the info down and study it carefully. It will certainly be implemented in future designs that I explore. In my previous version of this control board I used relay driver IC's with single coil latching relays. They shared the same +5 and gnd traces with the PIC however. As far as sourcing current at the pin, since these relays are dual coil latching I only pulse them and no two relays are pulsed at the same time so I felt safe that I was not exceeding any pin source capability.

    I appreciate your suggestion that I should have caps for the display power. I will do further research on how to accomplish this.

    I think your last remark is on the money. As I mentioned in another reply, I run the trolleys off the overhead wire at times (I can switch between rail only & rail with overhead wire.) When running off the overhead, the trolley caenary arcs plenty. Talk about a "dirty" operating environment!

    I appreciate your comments.

  3. #3
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    abecker,

    I think your getting some excellent advice here. As I have said before there are world class programmers here (and also those knowledgeable in electronics design) and all are willing to help.

    For all this good advice I think you might owe us some pictures of your train setup and all that
    Having a train that actually has an catenary that actually works sounds pretty awesome!
    What a fun world to live in, down at the miniature level.
    And merging micro controllers and PIC BASIC... what could be better.

    You might consider wiring up a length of 6 conductor ribbon cable to the ICSP header then solder it up to a 6 pos header to plug your pickit into.
    that way you can easily impliment code changes without having to tear things apart.

    Nothing better than to be able to make code changes and test ideas out and see almost instant results.

    great stuff!!

    now if you have a few minutes check out this...
    http://hackaday.com/2016/01/17/the-s...ur-wunderland/
    It is awesome to go to google earth and get down in minature and roam around this model setup.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  4. #4
    Join Date
    Jun 2015
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    Heckler,

    I first discovered this thread by looking at a print ready version of the tree.

    My trolley system is at the beginning stages but all the track and overhead is assembled and in good working order when run manually.

    I am not at home now but I will send some photos of the table and the controller.

    I agree the advice has been very generous and I received more feedback than I expected. I would hope this thread is of use to others in the future with similar designs.

  5. #5
    Join Date
    Jun 2015
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    Voila! Photos as promised.

    I have yet to provide the scenery work but first things first- get it operating. Manual operation works as designed.

    The power (0-17vDC) from the speed control can be routed for overhead supply or to the tracks only by a manual switch. The yard turnout can be operated manually or via the PIC logic.

    Controller has an LCD and three buttons to program number of trips, seconds at east and west (future) stations or yard termination. Prompts for setting automation are displayed on LCD.

    I made the enclosure out of acrylic sheet so I could custom size it and intended to paint it gray but since it looks pretty cool as a transparent case I think I'll leave it that way.
    Attached Images Attached Images       

  6. #6
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    No offense, but I hope you are forced back here regularly as this build progresses. I would love to feel (in some small FREE way) that I had helped to make it come together. I've seen many genius level projects here, but my favorites are always those where knowledge is applied to passion.

  7. #7
    Join Date
    Jun 2015
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    No offense taken.

    Nobody has ever accused ME of being a genius but my tenacity has lead me to many learning opportunities.

    I will try several of the strategies offered by the contributors and hopefully if the problem gets resolved soon, I will report back.

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    I discovered this curious method of debounce/noise filtering on the arduino forum this week . the idea translated to pbp easily and makes my worst cheap and nasty tactile switches perform as smooth as silk.
    here is a little demo (might add there is no cap used at all on the switch )

    Code:
    '****************************************************************
    '*  Name    : debounce.BAS                                      *
    '*  Author  : richard                   *
    '*  Date    : 2/17/2016                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :  pic16f1825                                       *
    '*          :   switch debounce                                 *
    '****************************************************************
    #CONFIG
                 __config        _CONFIG1,    _FOSC_INTOSC & _CP_OFF & _WDTE_ON  &  _PWRTE_ON  &  _MCLRE_OFF  & _CLKOUTEN_OFF
                  __config      _CONFIG2, _PLLEN_ON & _LVP_OFF            
    #ENDCONFIG
     
    OSCCON=$70 
    DEFINE OSC 32
    ANSELA=0
    ANSELC=0
    TRISA = %011010
    TRISC = 0 
     
     
    led1 var lata.5    ;  lit when  sw operated
    led2 var lata.2    ; toggle when sw   operated
    sw var porta.3     ;  the switch (active low ie has pull up resistor)
    old_sw_state var bit
    sw_state var bit
    sw_buff  var byte
    clear
    
    main :
        gosub ck_sw
        if  sw_state != old_sw_state then   ; the sw has changed either on or off
            led2 = !led2
            if !sw_state then led1 = !led1      ; if state is changed to on
            old_sw_state=sw_state            ;remember state
        endif
    goto main
    
    ck_sw:
        sw_buff= (sw_buff<<1) | sw
        if (sw_buff=$7f ) and sw then
           sw_state=1
        elseif  (sw_buff=$80 )and !sw  then
                sw_state=0
        endif
    return
    Last edited by richard; - 17th February 2016 at 02:33. Reason: no capacitor used

Similar Threads

  1. Intermittent reset of 16C6440 - possible noise issue
    By Christopher4187 in forum General
    Replies: 4
    Last Post: - 16th May 2012, 12:43
  2. Noise on input signal
    By fanman in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 28th February 2012, 02:55
  3. Electrical noise problem with PIC 16f84
    By Snap in forum General
    Replies: 11
    Last Post: - 26th September 2007, 09:36
  4. Input Noise
    By PJALM in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 28th February 2006, 19:26
  5. False Triggering I/O
    By pdegior in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th July 2005, 09:02

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts