Questions tagged [switch]

In electrical engineering, a switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another

In electrical engineering, a switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another

149 questions
6
votes
2 answers

Do you actually NEED external resistors for switch connecting IO pin to ground?

Years ago, I encountered a fairly long debate at AVRfreaks.net about whether or not it's OK to directly connect AVR pins that are configured as inputs with internal pullup enabled directly to ground through a button or switch. From what I recall,…
Bitbang3r
  • 561
  • 1
  • 3
  • 14
5
votes
2 answers

Why digital pin not reading ON from push button switches connected to 5V and pull-down 10K resistor?

Here's my circuit: And the code: //pins const int control1 = 2; const int control2 = 3; const int enable = 9; const int pinDirection = 4; const int pinOnOff = 5; const int pot = A0; //states int stateOnOff = 0; int stateOnOffPrev = 0; int…
Roman
  • 211
  • 1
  • 2
  • 8
4
votes
2 answers

Arduino resets or stuck during run, only when DC motors are connected

I'm using an arduino connected to 2 DC motors through L298N. the arduino is powered by a 9V battery, and the L298N is powered by 4 AA batteries. there's also a switch that starts the movement. I've added print statements to debug, one in the setup,…
young marx
  • 151
  • 3
4
votes
2 answers

How to switch 12V with esp32?

Hello i want to switch electric door lock (12V, 170mA) with esp32(3.3V). If is it possible I want use tranzistor. I tried to use IRF520, but it only worked with 5V. My sugestion is use 2 tranzistors one would switch 5V to IRF520 which would switch…
Noobie
  • 43
  • 1
  • 4
4
votes
1 answer

Turning off a LED

I am trying to make 2 alarms for 2 different times using 2 LED's which should turn on when the time corresponds to the set time and then if a pushbutton is pressed, the LED should turn off. For the first alarm, the first LED can be turn off with the…
Biancaaa
  • 61
  • 1
  • 5
4
votes
1 answer

Can I use an AC signal to make an LED light up with arduino?

I want to use a 220VAC load as a signal and act as a switch to my arduino so Labview could interpret it as an LED ON state. I used a 4n33 octocoupler but it seems that the LED Simulation on labview keeps fluctuating. I think it's because of the…
3
votes
1 answer

Input Oscillating Wildly

I'm trying to read an input from a switch but instead of getting 0 and 1 for closed/open, I'm getting 0 and a rapid series of 1s and 0s. Originally I tried (and failed) to simply read a rotary encoder but when I swap it for a standard rocker switch…
WillM
  • 39
  • 1
3
votes
1 answer

Water level switches / reed switches and Arduino Uno

How could I estimate the max number of switches that I could connect to an Arduino Uno? I am questioning if Arduino has enough power to simultaneously operate an X number of switches with no issues. I am using an external power adapter of 12 volt/2…
Investigator
  • 159
  • 6
3
votes
3 answers

How to wire a three-pin on-off-on switch for reading input?

I would like to read the output of an on-off-on switch with my Leonardo board, but I have very little knowledge of electronics and don't know how to wire it up. This is the switch in question: E-Switch 200MSP4T1B1M1QE The switch has three pins.…
Boonswaddle
  • 33
  • 1
  • 3
3
votes
3 answers

How to use this 3-pin slide-switch?

I purchased these slide switches recently because I want to use them in my project: But I don't know what to connect up the three pins to and I can't find any information about them online. Nor can I find sample code. Can someone show me how to…
Saqib Ali
  • 93
  • 1
  • 2
  • 10
3
votes
1 answer

Is this a good way to filter noise due to vibration in limit switch?

I have a circuit connected as follows my limit switches which are attached to my structure sometimes gets falsely triggered, so I wrote this code to address it. My motor is supposed to go down skip the up limit switch at first hit the down one…
hamad
  • 31
  • 2
3
votes
3 answers

Controlling 10+x 5m led strips with 10+ individual analog floor switches

I am looking to control around 10 (exact number TBD) non-addressable 5m led strips with an Arduino. Each led strip will be activated when a corresponding DIY analog floor switch. The idea is to have a hallway with a number of these led strips…
3
votes
3 answers

Button and switch to turn on and off LED and changing after time

I have system connected to an Arduino Uno where I want to read whether the switch is open or closed. Based on if the switch is open/closed, I want an LED light to turn on/off. When the switch is open, the LED turns on and pushing the button turns…
kumquat
  • 61
  • 1
  • 2
  • 6
3
votes
1 answer

Choosing the right mosfet to switch on-off a neopixel strip

I,m trying to find the right mosfet or transistor to switch on-off a neopixel strip to safe battery power on a Lipo 3.7v using a pro mini 3.3v. My Animation-Setup and Power Comsumption with 35 Neopixels is : Sparkel : 20mA Knight Rider :…
3
votes
1 answer

Switching Many Switches with one Input

I have a situation where I need to select between two signals, lets say 1A or 2B and route it to output 3C. I need to do this six times (2A or 2B to output 2C, 3A or 3B to output 3C, etc.). These all need to switch based on one output from my…
jay8ee
  • 31
  • 1
1
2 3
9 10