Skip to main content
Arduino

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Dealing with a Signal Source

The following circuit is a simplified version of a more complex system. For testing purposes, the 555 Timer was added to serve as a test signal source with frequencies set by the resistors in series. Each arbitrary signal is indicated by a push button and the Arduino needs to be able to distinguish what button has been pushed. Unfortunately, there can only be 3 buttons and more cannot be added. This is where the problem occurs. How can you reliably indicate which push button has been pressed without interfering with the arbitrary waveform?

At first, my original thought was to have the Arduino sample the signal based on that sample the Arduino would be able to tell which button is pressed.

When button 1 in the pink is pushed the Arduino receives a takes the following sample of the signal.

enter image description here

843
848
849
849
849
849
 // Time 0 when button is pushed 
532
414
500
373
463
346
425
370
386
476
346
442
642
788

Moving the input enter image description here

 // At t = 0 the Serial Monitor reads zero 
 998
 998
 998
 998
 998
 0
 0
 0
 0
 0
 998
 0
 0
 0
 0
 0
 0
 0
 0
 0
 998
 0
 0
 0
 0
 998
 0
 0
 0
 998
 998
 998
 0
 998
 0
 0
 0
 998
 0
 0
 0
 0

Moving the analog input does not make it any easier to distinguish which button was being pushed. Which is why I decided to ask the community on how to deal with this. I have tried using a relay and simply hard coding all of the cases but the result is a system is not very robust and is vulnerable to easily break over time.

Answer*

Draft saved
Draft discarded
Cancel
6
  • R1 ... R5 can have different values, which might spread the ranges per button more evenly Commented Oct 7, 2020 at 12:37
  • 2
    Re "1M": Note that, on the Uno, the ADC is specified for a source output impedance no larger than 10 kΩ. Commented Oct 7, 2020 at 12:46
  • 2
    @EdgarBonet The 1M is just a float-prevention pulldown. By having it so high it prevents the input floating with no buttons pressed and at the same time has little effect on the readings. Worst case the output impedance with Button 1 pressed would be 799.36Ω. With nothing pressed there's no output to have an impedance. Just ground through a resistor. Yes, it may slow down the transition from a valid reading to nothing, but that's not a problem. Commented Oct 7, 2020 at 15:09
  • 1
    @Majenko: "nothing" is a valid reading. Commented Oct 7, 2020 at 15:14
  • Yes, but it's not an actively valid reading that is being driven by the rest of the circuit - just a "stop it floating" nothingness. Commented Oct 7, 2020 at 15:27

AltStyle によって変換されたページ (->オリジナル) /