Skip to main content
Visitor II
October 30, 2020
Question

STM32 Keypad Interfacing Issue.

  • October 30, 2020
  • 3 replies
  • 2894 views

Hi everyone,

I developed a custom board out of STM32F070CBT6 MCU. The board is supposed to handle a simple logic of a 5x4 matrix (similar to a 5x4 keypad).

The algorithm I've developed also involves the same logic used in a keypad that is,

  • The rows are inputs and columns are push-pull outputs
  • keep the rows pulled up
  • Send GND (Low Logic) over columns periodically
  • Scan the rows and light up an LED whenever the row reads GND.

The problem I'm facing is that this board works completely fine and the logic works perfectly over a test bench setup. However, I've to actually install this in a field where the input from 5x4 matrix comes from wires that are 1000ft away from my actual board. Now here, the board goes crazy and does not read the inputs properly.

Can anyone please help me out if it's an algorithm issue or a hardware issue?

Any help is highly appreciated. Thanks

    This topic has been closed for replies.

    3 replies

    Super User
    October 30, 2020

    > Can anyone please help me out if it's an algorithm issue or a hardware issue?

    It's an issue of misunderstanding the requirements, which resulted in wrong implementation.

    Or, if you prefer, issue of changed requirements, which leads to redesign.

    -- pa

    AKetcAuthor
    Visitor II
    October 30, 2020

    Hey there, thank you for the reply. I am more after, what could be the possible cause of error? Could you explain that if you understand the scenario?

    Super User
    October 30, 2020

    1000 ft is apparently too long. Inducted noise, voltage drop... and just too many wires to haul over 1000 ft.

    -- pa

    Super User
    October 30, 2020

    300m of wire presents significant capacitance mutually between wires and at higher frequencies transmission lines effects.

    So start with measuring/estimating at least the capacitances and connect such capacitances to your bench model.

    There's also risk of induced noise, especially in industrial environment.

    The normal way of how this is solved is that keyboard is decoded by a local mcu in one location, and information is conveyed through robust transmission (think RS485 through twisted pair, for example) to the mcu at remote location.

    JW

    AKetcAuthor
    Visitor II
    October 30, 2020

    @Community member​ That seems to be the case and I agree with you. Apparently, there's no other way except for a redesign to get the board working, Am I correct in assuming this?

    Super User
    October 30, 2020

    If you're asking whether it is possible to make it work by only adapting the software - may be it is.

    There's typically more than one way. But not all ways are equal.

    -- pa

    AKetcAuthor
    Visitor II
    October 30, 2020

    Yes, because a redesign at this point would cost too much time and money. If you can please suggest me some better ways, that'd be really helpful.