I want to know how can i wire this toggle switch to obtain 3 positions :
- Position 1 : Turn Off System
- Position 2 : Turn On System
- Position 3 : Write "High" On a microcontroller (ATtiny84)
This is the slide switch i am willing to use : Link
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
i don't know which pin of the switch is common pin, i think it might be pin no.1 or no.2
if pin no.2 was common, do this wiring :
if pin no.1 was common, do this one :
the diode is preventing Write HIGH on your ATtiny's digital input when you just want to turn it ON and not to do that in same time (Position 2) if you tell me which pin is common pin, i'll give you the exact answer
It would be better to use a DP3T switch. If you can stand the voltage drop of a Schottky diode, you can use @Hamid's scheme wired as so: (pin 1 has the gap to the next pin)
The divider loads against leakage in D1 up to 70°C at least, for very high temperatures you might have to reduce the values. A divider is used to prevent applying more than Vdd to the input pin.
The lower schematic shows a circuit that does not suffer the leakage or voltage drop of the Schottky diode but has one extra component- eg. PEMH9,115 dual digital transistor (in dashed box). R8 prevents transient current through the MCU input while M1 turns on.