Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
en:examples:digi:switch [2015/11/13 09:47] – heikopikner | en:examples:digi:switch [2020/07/20 09:00] (current) – external edit 127.0.0.1 |
---|
| |
| |
^ Push button switch ^ Toggle switch ^ Rocker switch ^ Micro switch ^ DIL switch ^ | ^ Push button switch ^ Toggle switch ^ Rocker switch ^ |
|{{:examples:digi:switch:switch_pushbutton.jpg?100|}} | {{:examples:digi:switch:switch_tumbler.jpg?100|}} | {{:examples:digi:switch:switch_rocker.jpg?100|}} | {{:examples:digi:switch:switch_micro.jpg?100|}} | {{:examples:digi:switch:switch_dil.jpg?100|}} | | |{{:examples:digi:switch:switch_pushbutton.jpg?100|}} | {{:examples:digi:switch:switch_tumbler.jpg?100|}} | {{:examples:digi:switch:switch_rocker.jpg?100|}} | |
| {{:examples:digi:switch:switch_sch_dpst.png?100|}} | {{:examples:digi:switch:switch_sch_spdt.png?100|}} | {{:examples:digi:switch:switch_sch_spdt.png?100|}} | {{:examples:digi:switch:switch_sch_spdt.png?100|}} | {{:examples:digi:switch:switch_sch_2_spst.png?100|}} | | | {{:examples:digi:switch:switch_sch_dpst.png?100|}} | {{:examples:digi:switch:switch_sch_spdt.png?100|}} | {{:examples:digi:switch:switch_sch_spdt.png?100|}} | |
| |
| |
| ^ Micro switch ^ DIL switch ^ |
| |{{:examples:digi:switch:switch_micro.jpg?100|}} | {{:examples:digi:switch:switch_dil.jpg?100|}} | |
| | {{:examples:digi:switch:switch_sch_spdt.png?100|}} | {{:examples:digi:switch:switch_sch_2_spst.png?100|}} | |
| |
In order to use a switch as a sensor connected to a microcontroller, one contact of the switch is connected to the microcontrollers pin and is set as input in the program. If contact is connected to the ground or input potential, the bus’s bit rate of microcontroller’s pin is changed. It would sound logical to use toggle switch, which allows connecting one contact with desired contact (in this case ground or input). For our purpose it is not as simple, since on the moment of shifting of the connections the contacts are not connected. The moment itself is very short (milliseconds), but during this moment microcontrollers input pin is connected to nowhere and therefore has indefinite value. Due to electromagnetic interference (which exists everywhere) input pin that is connected to nowhere can have a value of 0 or 1 at random moments in time. | In order to use a switch as a sensor connected to a microcontroller, one contact of the switch is connected to the microcontrollers pin and is set as input in the program. If contact is connected to the ground or input potential, the bus’s bit rate of microcontroller’s pin is changed. It would sound logical to use toggle switch, which allows connecting one contact with desired contact (in this case ground or input). For our purpose it is not as simple, since on the moment of shifting of the connections the contacts are not connected. The moment itself is very short (milliseconds), but during this moment microcontrollers input pin is connected to nowhere and therefore has indefinite value. Due to electromagnetic interference (which exists everywhere) input pin that is connected to nowhere can have a value of 0 or 1 at random moments in time. |