Product Manual
Slide switch plug
Updated on: 27th November 2017
Product Manual:Slide switch Plug
Index
Introduction
2
Specification
2
Variants
2
Supported cables
3
Details
3
How to interface?
4
Example Code
6
Code 1 : Arduino
6
Contributors
7
Elint Labz (www.elintlabz.in)
Page 1 of 8
Product Manual:Slide switch Plug
About Elint Labz Elint Labz (usually abbreviated as EL) is an electronics design & development tools designer & manufacturer with headquarters in Bengaluru, India. We design, develop & manufacture development boards based on micro-controller & microprocessors, breakout boards for various sensors & actuators. Our domain & expertise is in the area of Electronics & Embedded Systems. Elint Labz was founded in 2014 however the actual operations started from 2015 when it became a full time subsidiary of Hogst Innovative Solutions Pvt. Ltd. & is presently a part of Ajaramara Group a conglomerate of various domains of industries, registered in India as Ajaramara Dynamics Pvt. Ltd. under Companies Act of 2013. As in the name company (Elint Labz) – Electronic intelligence (ELINT) is intelligence gathered by the use of electronic sensors, Laboratories (LABZ) are facilities that provides controlled conditions in which scientific or technological research, experiments and measurement may be performed. EL is an enterprise built to develop smart & intelligent electronics & EL is committed to help achieve electronics literacy in India. No matter the vision or skill level, our products and resources are designed to make electronics & programmable development hardware more accessible. Elint Labz as a platform helps developers & young engineers from prototyping to product development. We provide open source hardware solutions and small quantity manufacturing services using a design from manufacturing framework. We are a strong promoter of the maker movement in India, most of the manufacturing happens with support of our various Indian partners & couple of our collaboration partners who have manufacturing & sourcing facilities in Germany, Korea & Shenzhen. To know more visit the about us section on our website: http://elintlabz.in/about-us/ Elint Labz (HQ) 📮 #200 1st main Arekere MICO layout 2nd stage Bengaluru 560076 KA [Marked on Google Maps] ✆ +91 855 377 2525 📧
[email protected]
Elint Labz (www.elintlabz.in)
Page 2 of 8
Product Manual:Slide switch Plug
Introduction
Slide switch is a simple SPDT switch, commonly used as a ON/OFF switch in electronic circuits or just as a general control switch. Elint Labz has built a plug to utilize this unique hardware.This plug can be mounted anywhere using screws. In the below picture you can see Slide switch plug.
Specification ● Operating voltage :5v ● Size : 20mmx15mm
Variants ●
Right Angle slide Switch
Elint Labz (www.elintlabz.in)
Page 3 of 8
Product Manual:Slide switch Plug
Supported cables ●
4-4A
Details
Slide switch has a slider that slides in horizontal direction. Slide switch plug has an interfacing port with four pins named as G, V & D1 and D2. Here G represents Ground ,V represents VCC and D1 represents Data pin1 and D2 represents Data pin2 at which digital input signals from the plug can be obtained. Depending on the switch position one of the Data pins goes HIGH and the other Data pin remains at LOW level. Note: Both the data pins cannot go HIGH/LOW at the same time.
Slider position
Signal at D1 pin
LOW
Signal at D2 pin
HIGH
HIGH
LOW
Elint Labz (www.elintlabz.in)
Page 4 of 8
Product Manual:Slide switch Plug
How to interface?
Use the supported interfacing cable to connect Slide switch plug to the controller board. Here 4-4A cable is used to connect the Slide switch plug to the pluguino board. One end of the cable is connected to the plug and other end of the cable must be connected to the controller board. Always ensure that black wire of the cable is connected to the G pin on both sides. In the below given pictures one can see 4-4A cable is used to connect Slide switch plug with the Pluguino Board. The data pins D1 and D2 of the Slide switch plug is connected to the 10th and 11th GPIO pins respectively on the controller board.
Elint Labz (www.elintlabz.in)
Page 5 of 8
Product Manual:Slide switch Plug
Elint Labz (www.elintlabz.in)
Page 6 of 8
Product Manual:Slide switch Plug
In order to demonstrate the working of the Slide switch plug we make use of the Dual LED plug to represent the state of the switch.
Example Code Code 1 : Arduino Objective: First LED to remain ON as long as, Data pin D1 in Slide switch plug is HIGH and when it is LOW then first LED turns OFF. Similarly, Data pin D2 is mapped to second LED in Dual LED plug. #define first_led 12 //first LED is connected to 12th pin #define second_led 13 //second LED is connected to 13th pin #define first_datapin 10 //D1 of slide switch is connected to 10th pin #define second_datapin 11 //D2 of slide switch is connected to 11th pin boolean datapin1_state=LOW; //initializing data pin-1 state to LOW boolean datapin2_state=LOW; //initializing data pin-2 state to LOW void setup() { pinMode(first_datapin,INPUT); //configure D1 of slide switch as INPUT pinMode(second_datapin,INPUT); //configure D2 of slide switch as INPUT pinMode(first_led,OUTPUT); //configure first LED as OUTPUT pinMode(second_led,OUTPUT); //configure second LED as OUTPUT } void loop() { //read the first data pin and store it datapin1_state =digitalRead(first_datapin); //read the second data pin and store it datapin2_state=digitalRead(second_datapin); //compare whether first slide_state is HIGH or not if(datapin1_state==HIGH) { Elint Labz (www.elintlabz.in)
Page 7 of 8
Product Manual:Slide switch Plug
digitalWrite(first_led,HIGH); } else { digitalWrite(first_led,LOW); }
// turn ON the first LED
//turn off first LED
//compare whether second pin state is HIgh or not if(datapin2_state==HIGH) { digitalWrite(second_led,HIGH); // second LED turns on } else { digitalWrite(second_led,LOW); //second LED turns off } } Output video : https://youtu.be/mEU8dy-eyEk
Contributors List of interns & other contributors who have worked for developing this manual
Pavan Kumar C http://www.elintlabz.in/profile-1804
Elint Labz (www.elintlabz.in)
Page 8 of 8
Product Manual:Slide switch Plug
Pavithra Makineni
http://www.elintlabz.in/profile-1805
Elint Labz (www.elintlabz.in)
Page 9 of 8