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
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
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
  • 83
  • 1
  • 1
  • 10
2
votes
2 answers

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 address. I have tried diferent approaches. When I…
Marc
  • 131
  • 6
2
votes
2 answers

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 on a pin going to one side of the switch, and read…
Owen
  • 143
  • 5
1
vote
0 answers

multiple button switch case how to add counter

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; ////////////int mode = 41; // select mode…
1
vote
1 answer

Understanding how a tilt switch works

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 code are in the attached image. Based on my…
1
vote
2 answers

Loop one specific case inside of a switch

I want to loop one specific case inside of my switch, until the button gets pressed a second time. How can i make this work? Code: const int ledrood = 9; const int ledgroen = 10; const int ledblauw = 11; const int buttonPreset = 2; const int…
Dave
  • 23
  • 2
1
vote
2 answers

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 kitchen with 32 cabinet doors and drawers and I wanted…
0
votes
1 answer

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 sample code. Can someone show me how to wire it…
Saqib Ali
  • 83
  • 1
  • 1
  • 10
0
votes
2 answers

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 module, etc. My board is a Uno R3. Currently, I…
RED
  • 1
  • 2
0
votes
1 answer

Switch to drive Arduino and optocoupler

At the moment I have a switch that connects to a digital pin on an Arduino as per the schematic below. (Obviously there is an pull-up resistor on the pin). simulate this circuit – Schematic created using CircuitLab I now want this switch to also…
0
votes
1 answer

Problem with executing a function in the middle of a 'nested for loop'

New to Arduino here. I was wondering if there was anything wrong about my utilization of the nested 'for loop'. What i wanted is the execution of the 'looper4' and 'looper6' function if any of my Togglestates condition are met during the looping…
0
votes
2 answers

switch pump on with transistor, mosfet, or relay

I would like to control a pump. The pump rating is 12 volt 60watts. The pump mfg says to use a 12 volt power supply of 5 - 12 amps but AT LEAST 5 amps. This pump has a pressure turn off at 116 psi and the mfg states that the pump will not make…
-1
votes
2 answers

Using Arduino or ESP8266 as a switch to turn on a 12V DC Fan

I am new to the community and this is my first question. Hope it turns out to be a nice question :) Me and my friend are preparing a senior design project on home automation. I have several things in my mind such as controlling drapes, lights, fans…