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

Filter by
Sorted by
Tagged with
5
votes
2answers
413 views

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 ...
4
votes
1answer
141 views

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 ...
4
votes
1answer
169 views

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 ...
3
votes
2answers
301 views

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 ...
3
votes
3answers
772 views

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-...
3
votes
1answer
176 views

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 ...
3
votes
3answers
245 views

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 ...
3
votes
1answer
62 views

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 ...
3
votes
1answer
817 views

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 ...
3
votes
3answers
2k views

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 ...
3
votes
1answer
941 views

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 ...
2
votes
3answers
7k views

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 ...
2
votes
2answers
137 views

SPST switch - powered from pin output, or voltage regulator

I have a SPST switch and I just want to sense whether it's on or not. I will then turn on/off a relay depending on the state of this switch. The two options I'm considering are: create a digital out ...
2
votes
3answers
720 views

Is there a cheap relay that can control voltage from stuff like bulb lights with a 5 V control output?

I need to power a light bulb or something like 110 V or 220 V at normal amperage for TV or something at that range like a fan... My micro-controller is an Arduino with 5 V out and 12 V max out trough ...
2
votes
2answers
86 views

Stuck In While Loop

So I'm a beginner at Arduino and I have to light up an LED grid to show digits from 0-9. I wrote a bit of code (with the help of some people) and it's like 90% done but there's this ONE problem. I ...
2
votes
2answers
3k views

State machine sketch to drive a DC motor with limit switches [closed]

I have a DC motor that will need to use two limit switches to detect end of travel in two directions. I've read that coding a state machine to do this task is the best method, however I have no idea ...
2
votes
1answer
10k views

Button with switch timer and reset time function + LED feedback. What am I doing wrong?

Beginner here. I´ve been trying to implement a button function timer working with millis() instead of delay as I want the button to be responsive while the timer is running. So far I´ve managed to ...
2
votes
3answers
723 views

Photoresistor and another switch

I am using the circuit diagram below to turn ON/OFF the lights using Photo-resistor. How can I use the Arduino to bypass the Photoresistor effect? Let say I want to turn ON the lights even though ...
2
votes
1answer
35 views

Connecting LEDs and push buttons 12 feet away from Arduino UNO

I have a PCB (let's call it remote PCB) on which I have 4 LEDs and 4 buttons mounted. The remote PCB is far away from my desk (about 12 feet away). The LEDs are used to indicate the status and the ...
2
votes
1answer
52 views

Arduino changing output based on wire voltage

I’m new to arduino and I want to build myself smart switch that can be turned of both manualy and via wifi, is there any way to change position of relay based on if another wire is live or not? Im ...
2
votes
1answer
70 views

status whether the switch is connected to arduino or not?

I made a small circuit in which a push-button is connected to Arduino via a pulldown resistor. So, whenever it is pressed it connects to 5V otherwise pulled down to the ground. this is working fine ...
2
votes
2answers
1k views

Calculate sensor unique address with a 8 position DIP Switch

I have a large amount of sensor boards that I need to be able to configure setting unique addresses. Each sensor is attached to it's own arduino, I'm using a 8 position DIP switch for setting the ...
2
votes
2answers
552 views

ATtiny85 soft-latching, and sensor-waking: Are multiple switches differentiable by pin change interrupt?

I am using a vibration switch with a pin change interrupt on an ATTiny85 to wake the processor and run some code when the vibration switch grounds an input pin. The circuit is battery-powered, so ...
2
votes
2answers
1k views

Problem using an array inside a switch statement

I am having a problem when using a switch statement to check for something inside an array. I am using an int as my switch, then I compare the character arrays using strstr. So it reads like this: ...
2
votes
0answers
55 views

Single LED controlled by two pushbuttons - one of which acts like a toggle switch

Trying to control this LED with those 2 pushbuttons - one button that starts a short flashing sequence, another pushbutton acts like a toggle switch, one press bulb is on, another press bulb is off. ...
2
votes
0answers
82 views

Turning on controller with button and turning off with a timeout

I am making a device controlled by an ESP 8266 and am wanting to save power by having it power down when not in use. The desired behavior is for a momentary button press or vibration sensor activation ...
2
votes
0answers
102 views

How can I get the count of pulses of two encoders on the serial monitor?

I have two encoders; I connected them to pin 2 and 3 and I want to count the pulses of them to make two DC motors to work until it reaches a specified number of pulses, than stop working. I have ...
2
votes
2answers
166 views

Digital Input using a button doesn't work properly when using it to control a relay

I'm trying to control a relay both via Bluetooth and using a switch. The problem is that, when the LED is off, I can turn it on with the switch but then if I turn off the switch the relay will stay on....
2
votes
1answer
206 views

How can I make a power button for my project powered by a USB powerbank? [closed]

I've solved the battery power supply issue for my Arduino project by simply connecting a USB powerbank. However, I just realised that I can't come up with a good way to add an on/off button! There ...
2
votes
2answers
273 views

Write a condition to execute 2 switch-case functions?

I'm new to programming and using Arduino products, and was wondering if someone wouldn't mind assisting me with a project I'm trying to tackle? If you review my code below, I have 3 conditions within ...
2
votes
0answers
930 views

Switch on/off LED 24V using a MOSFET

I try to switch on/off IKEA Ledberg LEDs which are powered with 24 V using the setup from this tutorial video: https://www.youtube.com/watch?v=sVyi7yWuXxs I use a IRLB8721PBF MOSFET. When I switch ...
2
votes
0answers
610 views

Difficulty connecting arduino ethernet with PC using a switch

Facing difficulty connecting arduino ethernet(w5100) with PC using a switch (Dlink). When both are connected directly(p2p) using ethernet cable, arduino device can be pinged. However, when connected ...
2
votes
0answers
367 views

How to recreate this basic ALPS switch board in Arduino?

I want to recreate this existing ALPS switch board (the board on the left) in Arduino, so I can control the switches (and 3 memory + 1 menu buttons) from my laptop. The ALPS switch board connects to a ...
2
votes
0answers
278 views

Adding a kill switch for servos with states - blink without delay code

I have many LEDs and two servos connected to one Arduino Uno, and the servos are programmed to move randomly indefinitely. However, I would like to install a kill switch for the servos by reading a ...
1
vote
4answers
506 views

How to boil down analog input to just three cases?

I am investigating the use of a 3-position-switch for one of my projects to switch between different settings using just one analog input pin. For the three positions I am using ground/0V, ~2.5V (via ...
1
vote
3answers
708 views

using a switch case with a 5-position switch and serial output

I'm trying to get started on developing a menu system for my LCD1602. I have a Parallax 5-position switch (up,down,left,right,center) and I would like to interface the two. I've been trying to get ...
1
vote
2answers
2k views

Can i use a range in a switchcase like in pascal?

in pascal's case statement i can use this: Var i : integer; ... Case i of 1..5 : DoSomething; end; i was wondering if there is a way in can do this with c/c++ in the arduino compiler using:...
1
vote
4answers
2k views

Pulldown resistors and multiple switches

Maybe this is a question for Electronics SE but I’m not a member there yet so hopefully someone will have an answer here. I did an experiment with having some push-to-make buttons connected to my Uno....
1
vote
1answer
151 views

Small Baseball Scoreboard using 2 to 3 breadboards

I'm helping my son start an Arduino small baseball scoreboard (roughly 2 or 3 breadboards in size). Im thinking to use qty 2, 2 digit 7 segment LED's (score of each team), an LCD 1602 module (inning ...
1
vote
2answers
238 views

Door sensors on every cabinet in the kitchen

At this point, I have yet to actually touch an Arduino. I'm toying with the RPi3 along with Home Assistant, but I'm always thinking of ways to do useless things that are fun. Let's say I had a ...
1
vote
2answers
2k views

Need Help in circuit diagram of 8*8 reed switch matrix

I am designing 8*8 reed switch matrix which will be connected to Arduino. I am using Arduino Duemilanove. I have completed the matrix portion but don't know how to connect and where to connect the ...
1
vote
1answer
47 views

LED and Switch Compolation Error Arduino 101

I'm getting an error on line 9 for some reason, (digitalWrite(Sender, HIGH);), and I just cant figure out why. My goal is to have two sets of flashing patterns, one for each switch state. I don't know ...
1
vote
1answer
43 views

Is it possible to use a slide switch without a resistor?

I understand how pullup and pulldown resistors work with push buttons and I also understand that an analogous idea can be applied to slide switches. Furthermore, I know that some versions of Arduino ...
1
vote
1answer
115 views

My Code turns on my LED even when my switch is not pressed

I am trying to create a circuit that will turn my motor when I clap. When the first limit switch is low, and there is only one clap, a solenoid pin is supposed to be engaged (currently an LED), but ...
1
vote
2answers
2k views

Crosses Initialization in switch case with different size of array per case

void setup() { Serial.begin(9600); } void loop() { time_Text(2); } void time_Text(int PastTo_val) { switch (PastTo_val) { case 1: { int tPTT_y[] = {11, 11, 11, 11}; int tPTT_x[] = ...
1
vote
2answers
2k views

Why is my switch not working?

I'm trying to have a common light switch turn a LED on and off. When I connect the light switch directly to a LED, it works like it should - the LED turns on and off with the switch. When I connect ...
1
vote
1answer
53 views

Arduino UNO With On / Off Module Switch + Battery Advice

So I have the following connected and the programming works fine when connect by USB The Parts 1 Arduino UNO 1 Laser Module (KEYS) 1 Rocker Switch Module (Standard 3 PIN) 2 Variation Motors (KEYS) 1 ...
1
vote
2answers
201 views

How to toggle LED and motor on button press?

we want to have a LED turn on with the press of a button, and become brigther and brighter as times go by (whithin a defined time frame), and when it reaches maximum brightness to turn off for a ...
1
vote
2answers
369 views

LCD screen won't stop printing the same characters twice

I'm hoping that someone might be able to help me figure out how to prevent my LCD from giving me double digits (i.e. 55, 66, 77 - instead of 5,6,7); I have 2 functions that are printing, so I'm ...
1
vote
1answer
278 views

Understanding how a tilt switch works [duplicate]

I am learning Arduino and pardon me if this is nooby. I am trying to make an LED glow when the tilt switch is tilted. The LED should not glow if the tilt is in normal position. The circuit and the ...