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
2
votes
0answers
36 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
1answer
42 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 ...
1
vote
0answers
20 views

how to control switch (proteus) using bluetooth card (HC-05) and arduino?

This is the first time I use the Internet with the Arduino in the proteus , What are the stages that I must follow in order to be able to control the switch via Bluetooth? If it was possible to ...
0
votes
2answers
33 views

Switching time of a multiple input switch

I basically have two switches Both switches will be pressed simultaneously in different order I want to know which switch was pressed first
0
votes
1answer
36 views

Recommend an Arduino Uno shield to monitor the state of 5 DPDT electrical switches

I have a project where I need to monitor the state of 5 DPDT electrical switches with Arduino Uno. Also, the Arduino board will be measuring the output from 3 thermocouples on 3 of the analogue pins ...
0
votes
0answers
40 views

Controlling LED from Aux Switch on RC Controller thru Arduino Uno

I am trying to control an LED to go on and off using the Aux Switch (SwA) of an RC controller (FS-iA6B). I have gotten the serial read to work but am stuck trying to implement basic Arduino LED code ...
1
vote
0answers
33 views

Will this be possible to do before I even get started. I want to automate my house window [closed]

I will have 2 buttons. Using Adafruit DC Motor Driver https://www.adafruit.com/product/3190 Top button is a function, bottom button is mode. The top button functions. Window 1: Single press will turn ...
0
votes
1answer
33 views

Switch loops with SPDT switch

I have made a drone/car quadruped robot thing and I need help with the code. I have found two codes to use to control each aspect of it but I need help to connect them. I have made a radio controller ...
2
votes
1answer
63 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
258 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-...
1
vote
3answers
477 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 ...
0
votes
1answer
65 views

Trying to switch a 5v fan with a LiPo and can't figure our what's wrong at full duty cycle

I have a simple project where I want to turn a 5v fan on/off and both the MCU and fan will powered by a LiPo battery. I'm powering the ESP and fan directly from the battery in the attached circuit. ...
0
votes
0answers
37 views

Slider switch not working as expected [duplicate]

I have a task to make an intelligent traffic light with automatic and manual mode. A slider switch sets which mode is active, but it doen't work for the manual mode. When I slide it to automatic, the ...
1
vote
0answers
56 views

multiple button switch case how to add counter [duplicate]

I want to add counter in multiple-buttons-to-control-relays: int relay1 = 23; int relay2 = 25; int relay3 = 27; int relay4 = 29; int relay5 = 31; int relay6 = 33; int relay7 = 35; int relay8 = 37; ///...
1
vote
3answers
3k 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 ...
0
votes
1answer
49 views

How to use this Toggle Switch?

I purchased this toggle switch recently because I want to use it in my project: But I don't know what to connect up the three pins to and I can't find any information about it online. Nor can I find ...
0
votes
1answer
25 views

Correct position for buttonState in my FSM

I wrote a FSM with the help of some tutorials through out the world wide web and so far it does what I want to do with it. But one thing that is not the way I want to be, is to exit the state ...
0
votes
1answer
95 views

How to code an arduino to execute a particular code using a slide switch

I’m pretty new to arduino. I need help concerning a project I’m making. I’m using a SPDT slide switch to switch between what code(method) should be executed.i.e when I shift the switch to the left, ...
-1
votes
1answer
51 views

How can I make my Arduino Esplora program start on the press of a button and then continue to run without me having to hold the button down? [closed]

I am trying to create a program where the main code starts on the press of a button. I am using an Arduino Esplora, and I want to have the built-in LED be blue when I plug in the power until I press ...
1
vote
0answers
63 views

What is the best way to replace the buttons inside a car remote chip so that it can be controlled via Arduino?

I have a car remote that looks like the following I would like to replace the buttons with some sort of switch or relay that can be programmatically controlled via an arduino unit. Would a simple ...
0
votes
1answer
71 views

Running in loop or once according to a slide switch position

I have a question. I made a system which includes a servo, a stepper and a wiper motor :) All these parts has one job to do and I can code it. But, I want to make 2 modes in this system Single ...
1
vote
0answers
41 views

default in switch doesn't appear to execute

I have a situation where the default case in my switch statement doesn't appear to execute as expected. I wonder if there is some subtlety I'm missing here? Given the following enum: enum ...
1
vote
2answers
165 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
0answers
27 views

ESP8266 connected to a HIGH pin and DPDT only works sometimes. Works everytime if connected to 3V3 pin

I have a Wemos D1 Mini hooked up to a DS2Y-S-DC3V DPDT switch. When I have the coil ends are hooked up to a pin (D2) and ground, it will click when I set the pin HIGH. It should click again when it ...
-1
votes
1answer
43 views

Control 4 digital outputs with one switch

I want to control 4 digital outputs (d0, d1, d2, d3) with one switch. When the Arduino starts, they should all be in state LOW. Now, after pressing the button once, d0 should get HIGH. Another push ...
1
vote
0answers
134 views

Made a light controller for the holidays

I am a new the world of Arduino. I found on YouTube, how to build a light controller (https://www.youtube.com/watch?v=WvG9c84ApFA&t=39s). I follow every step but it doesn't work. Here are some ...
1
vote
2answers
289 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 ...
0
votes
2answers
59 views

Cycling through switch states

I'm making a desk lamp out of 2x WS2811 strips (attached to the triple ports at top right of board below). The brightness of the strips is controlled by a potentiometer, and the colour by a switch. ...
2
votes
0answers
76 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 ...
-1
votes
1answer
1k views

Using an NPN transistor as a switch to turn on/off a DC Motor

I am trying to control a 3V DC motor (FA-130) with my Arduino Uno, and am trying to do that using an NPN transistor (2N3904) as a switch, as shown in this diagram. I used the Blink example and ...
0
votes
1answer
83 views

New to arduino, help wiring relay

I am new to arduino and need some help. I just baught light bars for my jeep and wiring harnesses with them, the harnesses come with buttons and I wanted to replace the button and have them controlled ...
4
votes
1answer
149 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 ...
0
votes
2answers
27 views

Encoder coupled with motor shaft.Encoder is giving larger redings than expected

I am a rookie and i dont have much experience on arduino. please help me. I intend to build a robot that will drive on a straight path even on nonuniform surfaces like the ones we see in agricultural ...
1
vote
1answer
77 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 ...
0
votes
2answers
772 views

LED on same Pin as Toggle Switch, not illuminating

I am trying to do something I think should be relatively simple. I would like to read an input from a toggle switch, and have a red 5mm LED indicate the state of the switch. Rather, however, than have ...
0
votes
1answer
248 views

Switch Statement stuck in loop

I am writing a code for a user to enter a 4 digit pin, then use this pin later to unlock a box. The loop is stuck between the "ready to unlock box" and "enter pin" it just keeps flipping between ...
1
vote
0answers
67 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 ...
0
votes
1answer
290 views

Replace 6 pin on/off switch on Power Bank with 3pin or 2pin?

I'm looking to finish up my project in a box and i'm using a battery bank to power the Leonardo micro pro and other components. The bank has a little on/off which on it which has 6 pins underneath. ...
3
votes
1answer
664 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 ...
0
votes
1answer
250 views

Replace mechanical switch with electrical switch or relay

I have a remote controller for a portable heater, and working on a small project to be able to control the fan on/off from an arduino with Bluetooh HM-10 module. I thought a solenoid might work by ...
0
votes
0answers
1k views

Nested “switch” statements menu

I know that menus were discussed perhaps a thousand times here and everywhere. But using a ready solution is not something that I'm looking for because I know I won't learn the concept if I use them. ...
0
votes
2answers
859 views

Using a toggle switch to run part of a sketch

First, I am a beginner for this. I just ordered my first book on coding Arduino and I'm working through some simple applications using a DS3231 (that has a temperature reading), LCD, MicroSD card ...
2
votes
1answer
136 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....
-1
votes
1answer
84 views

Sketch starts and keeps counting on external power supply but not usb

Thank you for the add, total newbie here (electronics and arduino) on his first project. Trying to make a counter for a hay baler with two HAL effect sensors, (pin 5 & 6) and outputting to an I2C ...
0
votes
3answers
984 views

Defining array in switch case

I’m completely new to arduino, so be polite. I’m trying to program my esp32 to drive neopixels as seven segment display. So I take a digit and pass it to switch case and in switch case I mention which ...
-1
votes
1answer
88 views

Adding a switch to control log interval [closed]

HI this is a code for a set of logging scales. What I want to do is to add a switch that changes the logging from the set time of 1000 mills to either 5000 mills or 10000 mils depending on the switch ...
1
vote
4answers
490 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
votes
2answers
484 views

Is there a key switch for Arduino? [closed]

I am trying to make a launch controller, which will turn on with a key. Like the one in this photo below:
0
votes
1answer
2k views

Arduino DC motor with 2 buttons

I have a problem with my Arduino project and I tried everything to fix it but nothing helps. I am trying to rotate my DC motor with two buttons: one button is to stop/start rotating on left side, ...
0
votes
1answer
1k views

TinkerCAD switch seems to be not working (always closed)

I am using TinkerCAD to simulate the functionality of a slide switch. Please comment if you think this question is off-topic. /* LiquidCrystal Library - Hello World Demonstrates the use a 16x2 ...