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
2answers
81 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 ...
3
votes
1answer
56 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 ...
2
votes
1answer
33 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 ...
0
votes
2answers
69 views

2 way switch with Arduino?

Hey I'm working on a home automation system where I can replace one of my 2 way switches to an Arduino Or node MCU controlled one but I want to avoid normal relays because as of what I know they can ...
4
votes
1answer
136 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 ...
0
votes
1answer
28 views

Switching 4.2V circuit with 3.3V Arduino GPIO

I am trying to learn about MOSFETs and see this p channel MOSFET and this tutorial. I am trying to use a 3.3V arduino GPIO pin to control a load that is powered from a 4.2V battery in much the same ...
1
vote
1answer
47 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 ...
0
votes
1answer
58 views

Float switch is not detected

Good day everyone, forgive me for the shabby drawing I am just panicking, why my float switches are suddenly undetected by my Arduino mega. I've tested all the float switches one by one to confirm if ...
2
votes
0answers
51 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
49 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
25 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
35 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
42 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
48 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
34 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
67 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
441 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
594 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
71 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
77 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; ///...
2
votes
3answers
5k 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
52 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
114 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
64 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
76 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
42 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
180 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
28 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
331 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
61 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
80 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
84 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
156 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
105 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
859 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
274 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 ...
2
votes
0answers
84 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
321 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
764 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
280 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 ...
1
vote
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
914 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 ...