Electronics > Beginners

Button input problem

(1/5) > >>

Raj:
So, I've been banging my head to the wall, thinking of a solution , of solving this problem...
I wanted the button input to my micro-controller to also act as power switch in order to save battery...( I wanna design a TV remote cause the original is way to complicated for old folks at home)


But the thing is, The diode I've used has too much voltage drop, which is messing the whole thing up. refer figure 1. The voltage on the pin being grounded goes to negative in reference to arduino's negative input/gnd, thus making the code run funny, like you press a button and it behaves as if you pressed 2.

This problem goes away when the circuit is connected as in figure 2  but I loose the ability to turn the arduino with the input button

I've also tried figure 3, but it refuses to turn off, since the ground is leaking into the transistor from zena diodes of arduino. The transistor being tip127, hfe min-1000

Atleast that's all what I think is happening.

Note: i've already made the housing and thus can't replace switches with dpdt kind

sokoloff:
Do you have the inputs configured as INPUT or INPUT_PULLUP?

If you haven’t tried INPUT_PULLUP, that’s worth a shot.

Raj:
It is pulled high, but it won't help, since pressing the button is essentially sending the pin to -0.5v

sokoloff:
The question was just to ensure you were holding the other (non-pressed) buttons in a defined state as you report other button is getting read as closed.

MarkF:
Here is another thread on using a MCU pin to both control power ON/OFF and as an input:

https://www.eevblog.com/forum/beginners/push-button-power-circuit-for-arduino-trying-to-modify-it-for-12v-input/

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod