Reed relay to reed switch Answered

Can someone help me. I have a reed relay and want to use it as a reed switch. Can someone tell me hyow to hook it up so it acts as a reed switch?

Question by Adum24   |  last reply


Refills for Reed Diffusers

My girlfriend buys reed diffusers from a company called West Elm for about twenty bucks apiece. When the scented oil eventually evaporates, she buys a complete new diffuser because the company does not sell refills. It would be great (and economical!) to be able to make our own scented oils to refill the bottles. I have seen cooking recipes on Instructables so maybe someone out there has a recipe for making scented oils. Thanks!

Topic by DanDiego 


Fun uses for Reed Switches?

Reed switches are electro-mechanical devices that opens or closes a circuit when a megnetic field is present. They come in normally open and normally closed designs and range from the size of a grain of rice all the way up to several inches long. A relay, another electro-mechanical device, is comprised of a reed switch and an electromagnet trigger built into one housing. Common uses for reed switches (not counting relays which are used in virtually all electronic devices) include the 'pick ups' on bicycle computers and the sensors on window and door alarms. I just ordered a bunch of reed switches and I need your help in coming up with ideas for what to do with them. Post up your ideas for some things that could be made or modified to be triggered by a magnet coming in close proximity to a reed switch. Remember- the magnet does not have to touch the switch, just get close enough that the magnetic force trips the switch. The stranger and sillier your ideas are the better. Note: this is not a contest and there are no prizes. by posting an idea you are giving your consent for anyone who reads it to use your idea. Posts about integrating reed switches into knex firearms will be ignored (no offence, it's just not my cup of tea).

Topic by Handsome-Ryan   |  last reply


how to make a reed switch for sensing a magnet from 4 to 5inch distance? or a substitute with RF Answered

Experts, pls guide, that i want to know the way to make a reed (in DC) have to sense a magnet from a distance of 4 to 5inches. did small reed will act so ?? if a yes, then which specification have to look?? or did there any circuit or something for making it much more powerful??

Question by shinojmahe   |  last reply


Need some ideas

Ok...at my other "home" www.geekstogo.com someone came up with a question about methods of making a "sherlock Holmes type chess board" where you could place one (or multiple) chess pieces in a specific location and have it open up a secret compartmentlinkage....and it got me really interested in attempting to build such a nifty contraption...we through out a bunch of ideas on how to get the chess board made and wired up....had some good ideas for using reed switches and either a push solenoid or even a linear actuator (to open and close a drawer depending on switch positioning)...i think i could work the wiring and stuff up...but what i need is some ideas for what to do instead of a chess board (i'm wanting to make this for my brother and his wife and i already got him a shot glass chess set...so he doesn't need another one of those)i though maybe i could make a water fountain where it would have a removable piece (or pieces) that when you put it in one location it will turn the fountain on and off...and if you put it somewhere else it would open up a drawer or something...i've got these faces from CPR dummies (don't ask) that i was going to use to make the fountain (like the water dripping from the open mouth) and either make some of my metal hands or buy some of those wooden art model hands or something...and make it that way...but i'm not sure if that's what i want to do (also not sure if the reed switches i'm planning on using are capable of switching 110v AC for long periods of time so suggestions on materials would be nice)another idea would be a big wall art piece like the Magnetic Multi Panel Mural...but i'm not sure how to integrate a drawer setup in something like that without getting inside of his wall at his house (would be fun though....wire it up in the wall...and have like a drawer open across the house when you move a panel or something like that)also...i guess it doesn't have to open up anything...it could do anything when the switch is on or off or whatever....any ideas are welcome

Topic by crapflinger   |  last reply


Does any one know how to make the reed scented liquid?

I like those reed scented air fresheners but I don't want to spend big buck buying a new one every time I run out of liquid.  I figure that someone in the community must know how to make the scented liquid since there are perfumes on the site.

Question by HollyHarken   |  last reply


Could you design a pvc woodwind instrument in tune with keys using a membrane reed? Answered

Pvc membrane pipe, tuned with in the key of either C or Bb

Question by bwells2   |  last reply


what good oboe reed?

I've looked around for good oboe reeds, and while i have found www.wwbw.com/Marlin-Lesher-Oboe-Reed-473063-i1413185.wwbw reeds to be generally good quality, but they too started making reeds not to my preference (they now have a very soft tip, and a stiffer back- just asking to break when i'm turinging around or something). i have found other hand made beauties, but they all have some quality like "intermediate" or something i don't understand, and don't want to risk. i have been playing for 4 years, and now i want something better. prefer a softish tip and a medium strong back, at medium or medium soft level.  is there any maker or seller or brand that is similar or colse to my preferances out there and beneath 15 dollars? note: you can see i barely know any of the reed terms- just the oboe and what i could elarn from my teachers

Question by DELETED_15zhangfra   |  last reply


Reed switch wind speedmeter? Answered

Hello, I need some help with counting the pulses  on digital pin with reed switch and arduino for speed meter and also calculation for the speed in km/h.

Question by Konstantin Dimitrov   |  last reply


Inrush current limiting resistor size?

I am building an application where LED strip lights will be powered off a 12V DC battery and switched on and off using a magnetic reed switch. I've been finding that the reed switch often fails to turn off when the magnet is removed. Searching on the net suggests this is because the contacts are getting fused by a large inrush current and the suggested fix is to wire a resistor in series to prevent this - so far so good but I cannot find anywhere guidance on the rating of the resistor I should use - at least guidance I can understand - as far as I can tell a resistor as low as 1 ohm may be required but not sure if I have got this correct - anyone know? Thanks

Question by SeaF1   |  last reply


Connect multiple Reed Switches to one Raspberry pi

Hi, I was wondering if its possible to connect multiple reed switches to 1 Raspberry Pi so i can get notified whenever 1 or more switches gets triggerd. thank you.

Topic by archi0112   |  last reply


Does an inductor start with a magnetic field, or does it only retain one as long as it is powered?

I am trying to figure out how to keep a reed switch on by proximity to a magnet. I read that an inductor stores the current as a magnetic force, so I was planning on just having the reed switch close to the inductor, and just use a small magnet to close the circuit initially. i was hoping the field from the powered inductor would keep the switch closed. Am I on the right track?

Question by redbaron1234   |  last reply



Airsoft Knife? PLZ REED KTHX

When you have an airsoft war, do you use knives? I don't mean real knives, of course, I mean something that you could use to simulate a silent melee attack.'Cause I have an idea. What if you made a thingy, that when you push it against an object (an enemy, in this case) it would let loose an airsoft BB, "killing" the target, like a knife? Huh, huh? Good idea, right?Also, check out my new slideshow.Airsoft Gun SilencerAlso also, when/if you play airsoft, what exactly counts as a kill? One shot, anywhere? And do you know you've died when you get hit (when you feel the sting)? Do you use the honor system?

Topic by Aeshir   |  last reply


Does anybody play bagpipes?

If anyone plays the Great Highland Bagpipes, i was wondering if you could possibly measure your drone reeds and post the measurements, because I've been searching and searching and cannot figure out the lengths or diameters of the bass and tenor drone reeds. So, Bass Reed length Tenor Reed Length And the length of the tongues on each of those as well. If anybody could do that i would be really thankful! Thanks! Luc

Question by FunkNattidelic   |  last reply


Does any one know how to rig a reed switch to a bluetooth device to notify you if someone has opened a door or not?

Im looking to see if anyone knows a way to rig a bluetooth usb drive or something to a reed switch to automatically connect to your cellphone when the reed switch is activated?

Question by JoshRidlon   |  last reply


LED control via a reed switch and SCR

N00b question: I've got an RGB LED that has a forward voltage of 3.7v and a 3.7v battery pack. I want to trigger the LED to light via a magnet and reed switch. If I wire the reed switch to the gate of the SCR and have the SCR power the LED, will I be able to turn the LED on and off via the magnet by bringing the magnet near the reed switch?

Topic by d0ugparker   |  last reply


How to create reed switch that activates wireless alarm?

I've been reading alot about reed switches after learning about a security feature for cars, a reed kill switch. I wanted to know how to or if someone could create some kind of setup where if the reed switch closes the circuit, it will activate a wireless remote or something like an alarm within a reasonable distance from the actual switch. I've seen those window/door entry alarms. Would those work? For a car, would it be possible to have the reed switch activate a small alarm in a key fob type of thing?

Question by booooyet   |  last reply



Easyest way for a arduno interrupt to call a funtion? Answered

Hi, I am trying to build a arduino speedometer for my go kart. I need a function that is called everytime a pin goes from low to high using a reed switch. The curcumfrence of the wheel is about 1m. The absoltue maximum this kart will be able to go is about 100km/h (28m/s). So the arduino pin will need to be able to be read 28 times every second. What is th best way to make the arduino call a function on a pin that needs to be read at least 28 times per second?

Question by David97   |  last reply


Create door opening wireless notifier? Reed switches? Answered

Hi, I have a Vellerman K8055 USB experimental board that I have hooked up to one of my machines. Yesterday, I took our wireless doorbell apart and with a multimeter found the signal that sparks the 'ding-dong' sound when the remote bell is pressed. I wired that into the K8055 and then to cut a long story short, when the bell is pressed, it pops up on my TV and tells me that someone has pressed the bell (using MythTVOSD multicast if anyone is interested). A link to the card: http://www.velleman.eu/products/view/?country=be⟨=en&id;=351346 What I'd like to do is to extend this mechanism to my doors. When a door is opened in the house, then I need a signal to be sent to a receiver device also wired into the K8055 so that I can capture that event in my program. I have thought about using magnetic reed switches on each door with hacked wireless doorbells (around 3-5 GBP on ebay from China). One problem I have is that I can only find 'normally open' reed switches, meaning that when the door is closed so will the reed switch contacts - this in turn means that I will be constantly notified (should I be able to make this work) that the door is closed. If I could find 'normally closed' reed switches, I could have one of each on each door, What is the cheapest/most elegant solution to this problem? Is using hacked wireless doorbells the way to go, or is there a better way. I'm a relative novice with electronics - I'm a dot net developer by day with experience of data capture cards, and have toyed with the Arduino, Lm386s, 555s, 4017s etc... some with instructions from this site, so whilst not a complete beginner, I am what I would call, "an enthusiastic amateur'.

Question by dchurch24   |  last reply


i want to use a real foot pedal on my rock band to make it work i can use any reed switch normally open or no?

I want to create a rock band pedal so ineed exactly the same reed switch as they show on the instructions or i can use another models

Question by coqu1   |  last reply


With an electromagnet, if there's a open reed switch betwen 1 end of the coil's wire & powersource, will e-mag get hot?

I'm building an electromagnet. The core is soft iron: 0.5" diameter and 1" long.  AWG 12 wire OR enameled copper magnet wire 32 gauge So the wire is wrapped around the core. One wire end leads to a reed switch which connects to one of the two wires of the 9 volt snap-on battery clip. The other wire end connects straight to the 9 volt snap-on battery clip with nothing in between. Will the wire end that connects directly to the 9 volt snap-on battery clip: A.) use powers and drain the battery B.) heat up the electromagnet (wire & core) If the electromagnet heats up, then how hot does it get? Just warm or really warm? Could it reach hot or HOT levels - hot enough to burn skin, damage any part of the electromagnet, or ignite/melt the carpet (if it was on it)?   P.S.  The final device would have no exposed wires. Thanks.

Question by gatorgirl7563   |  last reply


My history project needs papyrus. Any help? Answered

I'm working on a project for my history class about Ancient Egypt.  I'm going to be making a Nile River scene and I need to know how to make miniature papyrus plants and reeds.  When I say miniature, i mean like Lego people sized.  I need this project in soon, so answer away!

Question by eulaliaaaa!   |  last reply


How can I float a small ring magnet? Answered

I am creating a fluid level indicator for my automated drink mixer and need either an alternate solution or an item that can float a small ring magnet. Currently, my idea is to sink a reed switch into a straw, with a ring magnet around the straw.  Once the magnet floats down to the reed switch, it lights up the indicator that the alcohol is (almost) gone. Unfortunately, I cannot find a durable non-toxic way to make the magnet float.  I've done several searches and the closest matches I've found are fishing tackle, which I'm not sure would work all that well.  I've found manufactured devices, but $30 per bottle is a bit much to spend.  I'd like to keep it to under $5 per bottle.

Question by kidmosey   |  last reply



How do you make a clarinet mouthpiece?

The image will help give an idea of what it looks like. Be sure it works by inserting a reed in the mouthpiece and blowing in it. Thanks for listening!

Question by NJ94   |  last reply


Correct crossslot for NAS and MS screws?

Do anybody now the correct crossslot standart for NAS (National Aerospace Standard) and MS (Military Standart) screws? is it Phillips? Frearson/Reed/Prince? JIS/JISC? or any standart else?

Topic by 1Bln65 


i live in latin america and idont know the name of the reed switch in spanish so i can buy it

I wanna know the name in spanish of a model i can use in the rock band custom pedal

Question by coqu1   |  last reply


DIY Driveway Alert System Problem

I tried to make a driveway alert system, but it has a problem. I connected a walkie-talkie to a Radio Shack PIR Sensor using this reed relay. Essentially, when the PIR sensor detects motion, it outputs 5 V which triggers the reed relay and closes the contacts, which connects the two contacts on the walkie-talkie button, which sends a beep to the other walkie-talkie. Problem: It works as planned, except that after the motion stops and the reed relay disconnects the walkie-talkie button, it will inexplicably re-connect the walkie-talkie button after about a second, and will repeat this cycle of beeping every couple seconds indefinitely. The strange thing is that sometimes it will work just as it is supposed to, but other times it wont. Other details: The PIR sensor is powered by a 9 volt fed through a 5 V regulator so it gets steady voltage, while the walkie talkie is powered by the regular AAA batteries. I am a novice with electronics, so don't rule out that I may have made a simple mistake.

Topic by doo0202 


do I need to isolate a negative ion generator?

I am looking to build a negative ion generator based spark gap... I need to limit dielectric loss, and need to use 8" of small gauge wire to and from the switch to turn it on. do I need to isolate the switch electronically from the rest of the circuit? if so, would a reed relay do the trick? if I use a reed relay, could I run it from the same power source, in parallel, or do I need to isolate power sources as well? my setup will be slightly similar to the Electrifried shoe diagram below. (no, that's not the project)

Topic by gschoppe   |  last reply


Seat belt fastened circuit

I have designed a circuit the intent of which is to control the seat belt fastened light on the dash.  There are two switches.  1. A pressure switch that closes when someone is in the seat.  2. A Reed switch that closes when the seat belt latch is latched.   Each works correctly separately.  I am using a standard 12V automotive relay to control the light, as below.  Let's just look at one side. 1. When the ignition on the 12V wire connects to the two leads, i.e., the pressure switch and the reed switch. 2. When someone sits in the seat the pressure switch closes and the dash light, which is connected to the relay at 30 and 87A comes on (relay not activated).  3. When the seat belt is latched, the reed switch closes, the relay switches and the current between 30 and 87A turns off. Diodes are introduced in the circuit as shown in the diagram.  The problem is that is does not work correctly.  Sit in the seat and the light comes on.  Buckle the latch but the light does not go off. There is still 12V between 87A and 30, but I don't know why.  I also tried putting a diode between 85 and 86 (pointing towards 86) but that did not help.  Suggestions please.

Topic by DaleR18 


name for Altoids robot? Answered

I need a name for altoid bot im creating it has to attenas on the front a reed switch and skid steers runs on a picaxe microcontroller motor driver board . iknow this isnt a real question but in some sense it is it need to be cool no altoid robot or somthing lame like that

Question by mman1506   |  last reply


computer trouble

I have an older macintosh and it keeps shutting down on me in the middle of things. I have cleaned it out many times, it usually helps for a week. am i drawing too much power from one outlet? does anyone know how to fix this?

Topic by reeding   |  last reply


What is sending out the signals ? Answered

Hi, I opened up the remote controls of my old alarm system ( those reed switch ones) hoping to find some IR LEDs. But I got this instead, no IR LEDs. Can anyone tell me which component is sending out the signals ? Thanks in advance.

Question by fujiapple   |  last reply


3 Float/Reed Switches Controlling a 16 Pixel RGB LED Ring via UNO

Good evening, My latest project is for a level indicator on my chicken coops water supply.  I am using an Arduino UNO, 3 reed float switches and a 16 pixel RGB LED Ring (adafruit Neopixel).  I have the switches at 3 different positions in the water tank. I am wanting to light the RGB LED ring a different colour depending on which switch is closed.  The bottom one red, the middle orange and when at the top, green. I have the LED ring working.  I also can have the switch working on its own.  But not controlling the LED. I have no idea what to do next.  I am thinking that i need to get the switch turning the LEDs on.  Then I can start thinking about using all three at once. I am hoping someone can help?  It seems a simple task for the arduino to do but I am very new at this so I'm struggling a little bit. Thank you all in advance.

Topic by NuclearGreyhound   |  last reply


Instrument Topics of All Kinds

Hi all! I'm new here...nice to meet ya'll! I think I get how this site works, and it seems really awesome! Who needs the DIY network when you have a whole online community :D Anyway, this forum seems to be for sharing personal endeavors, correct? Well there's this blog. It's not completely mine....it's a company blog. It has SO MANY how-to posts about mainly reed instruments, reed-making, and all sorts of things. That makes it relevant to a niche community, which may or may not be here on instructables? I just hope there's some oboist or bassoonist out there that I'm helping by posting this :] It's called the Midwest Musical Imports Blog. Yes, there are a couple self-promoty type posts on it (it's a company blog, afterall). But a majority of it is how-tos and instructions and such. Am I right to post this here? Please tell me if I'm in the wrong! Thanks everyone! - J. Doorn

Topic by jdoornink 


I need to make a 7-12 second delay timer, how?!?

For my delay timer, i will need to be able to turn the POWER on/off and activate the timer with a button press. i only dont wanna have to turn the power on/off to reset it. So, i'd have a power switch, and a timer activate/reactivate button. It will activate a reed relay. THANKS!!!!!!!!!!!

Question by sci4me   |  last reply


Can anyone write me code for arduino wheather station with 433mhz TX and RX? Answered

I need code for arduino wheater station, which uses sensors: LM35, BMP180, Reed switch ( wind speedmeter) and a potentiometer for wind direction. I use 433mhz TX and RX I will need and code for the RX but to use serial to read the data.  P.S. with Manchester. h Thank you !!! 

Question by Konstantin Dimitrov   |  last reply


Using an electric shock to trigger an arduino. (doorknob variety)

I was thinking a transistor, how does one make ~20000v at 5mA useful. Do I use a capacitor or a coil of some type? Do I NEED an amp? Will it be jittery? I was even looking at those alfoil leaf static detectors and imagining some sort of field detecting reed switch.. ? Think frankenstiens lab: lightning=reaction :)

Question by oliverkellow   |  last reply


Should I pick up this old metal lathe? Answered

There's an older metal lathe that's going to the scrap yard, a reed-prentice co., looks to be from the 40's, and I could probably get it for scrap price. Would it be worth fixing up and using? I don't need to hit super-tight tolearances with it, just turning parts as a hobbyist / beginner. What questions should I ask about it? What should be there for it to be complete?

Question by Nate Cougill   |  last reply


my 1984 honda spree shuts off when it warms up!

It has a new cylinder, piston and rings, installed properly. autobystarter works fine, reed valve is clean, has all new gaskets. I am mixing the fuel instead of putting it in separatly, to avoid burnign up the engine if the oil injector wears out. What do i do? i am monetarily invested up to its value!

Question by MechEngineerMike   |  last reply


RF JAMMER

HI I HAVE REED ALMOST EVRYTHING ON YOUR WEBSITE BUT IM STILL CONFIUSDE!!!IM INTERESTED IN BUYING THAT JAMMER BUTI GOT QUESTIONS 1-IS THIS RF J. THE SAME AS THIS propeller???-can i order that asembley board or i need 2 do it my self???-can i use that  (sd) 2 build a jammer??doz it jamm low freqency like less then 2mhz??? can u sell me that board complete????my e-mail is koza1982@gsi.pl   thx

Question by hyper2020   |  last reply


I need to scavenge some solid state relays. 5v 120vac. What types of things have these in them?

I am trying to power some Christmas lights with my computer speakers and need some solid state relays to switch them. I tried the reed type from radio shack but they keep sticking. I have lots of random electronics laying around to scavenge from, any suggestions would be greatly appreciated

Question by Deathstick   |  last reply


What do I have2do2a wire2let me power a9v thing from a outlet? Can a9v battery clip only carry 9v? Screw terminal uses?

I'm trying to invent something. I'm realistic enough to know it probably won't work as planned and definitely won't make me rich, but I'll always regret it if I don't try. I need to power 6 electromagnets and I want to use one cord to power them. The electromagnets are wire wrapped around a soft iron core. They don’t need to be strong, just strong enough to activate a reed switch. (The pictures are labelled with #s to show which question they are for.) 1. How do I connect them all into an electrical extension cord? Do I have to use a screw terminal? 2. Can a 9 volt battery clip carry more than 9 volts, or will it fry? If I properly joined a power cord and 9 volt battery clip and plugged it in, what would happen? Would there have to be resistors? What kind? 3. Would this configuration with two screw terminals work? Did I misunderstand the function of the screw terminal? Is there something better I could use? (From bottom to top) ~The electrical cord powers the whole thing. It distributes the current to all the wires. ~The reed switches prevent the all wires from sending all the currents to the light bulb. ~If I put a magnet over the AQUA wire reed switch, the circuit would be completed and current would reach the light bulb and cause it to light. I tried to figure out how to do it on my own but when you don't know any electric components, terms, phrases, and definitions - like me - it's next to impossible to look things up.  

Question by gatorgirl7563   |  last reply


illuminated ball - remote switching and charging

I'm working on making an illuminated ball for playing bike polo with at night time. A couple of high output red LEDs are sufficient for light to get through a normal street-hockey ball. The problems I'm currently facing are switching the lights on or off, and charging the batteries. Ideally both of these could be done remotely - i.e. without having to open the ball up. For switching I was thinking of using a magnetic reed switch - when a magnet is attached, the lights switch off. The only problem is that reed switches seem to be (a) made of glass (not ideal when the ball gets hit really hard), and (b) in a normally-open configuration - I'd need a normally closed one for this. As for charging, I have two ideas - one is to have two small metal pads on the surface of the ball to connect to the charger. This could be problematic due to forces on the ball during gameplay. The other more fun idea would be inductive charging. Like what you get in those fancy electric toothbrushes. One coil inside the ball, one outside. How practical is this? can it supply the necessary voltage and current to charge either a pair of NiMH batteries or a Li-ion cell? vik

Topic by askvictor   |  last reply


ok;do you know how to make a useable and working round boat,like the ones you see old trappers use????? Answered

I need a working round boat like the old trappers and some indians and europeans used and still in use today.like the reed boat or one covered in hides[but can use more modern materials]i need this in the easiest way to build-diy-.something in the survial ares where you don't have much in the way of materials or time.can anyone help? thankyou

Question by johnblackhorse   |  last reply


Wanted: Senior Project Mentor/Advisor

Hello, my name is Jason Reed and I am a senior at Soddy-Daisy High School. Circuitry has caught my interest and I have decided to do my senior project on it. However I can not accomplish this without a mentor who is at least 21 years of age and proficient in my chosen subject. I just need someone who can give me advice, some direction, and maybe some information sources. Thank you in advance to anyone how posts any form of help.

Topic by jason the red 


anyone know if this curcuit will work?

Basically I am building a robot and I have reworked some servos on a rc control to switch current from + to - and back to - and + depending on which way the joystick is. so at the top of the pic is my + - in that can switch to - + I need a curcuit that will run to different relays depending on the direction of current. Will the one I made work. I'm wondering if the power will feedback throught the other relay. by the way the black arrows are diodes Also does anyone know the difference between a reed relay and a regular relay. I looked it up but it doesent make much sense.

Topic by kendallickes   |  last reply


Can someone help with my anti auto theft arduino device? I am trying to use a reed switch and a relay.

     I am trying to build a device for my engineering project which is a anti theft device for cargo trucks in third world countries. Since cargo stealing is very common truckers already use satellite tracking. The device works in the following way, in an attempt to steal the truck a thieve tries to breach into the truck"s electrics to disable the satellite tracking, but the reed switch detects the breach and the arduino stops feeding power to a relay which is connected truck's electronic fuel injection system, thus making the truck's engine to stop and consequently immobilizing the cargo.      The system uses a 4x4 matrix keypad, one relay(I might add more) and one reed switch but I am planning to use two. When the sensor is breached the arduino is supposed to cut power to the relay. If the correct password in entered in the keypad the system turns the relays on until the sensor is breached again, if the wrong password is entered it remains locked.      I managed to find a password code a guy shared which worked with the keypad and the relays, but when I try to add a if statement to lock when the sensor is breached it simply does not work. Thanks in advance for the help. #include int Relay1 = 13; int Relay2 = 12; int greenPin = 11; int Sensor1 = A1; int Sensor1Valor = analogRead(Sensor1); int position = 0; const char * password = "123"; const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = {   {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = { 8, 7, 6, 9 }; byte colPins[COLS] = { 5, 4, 3, 2 }; Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup() { Serial.begin(9600); pinMode(Sensor1, INPUT); pinMode(Relay1, OUTPUT); pinMode(Relay2, OUTPUT); pinMode(greenPin, OUTPUT); digitalWrite(Relay1, HIGH); digitalWrite(Relay2, HIGH); setLocked(false); } void loop()  { char key = keypad.getKey(); Serial.println(analogRead(A1)); if (key == '*' || key == '#') { position = 0; setLocked(true); } if (key == password[position]) { position ++; } if (position == 3) { setLocked(false); } if (analogRead(A1) > 300); { setLocked(true); } } void setLocked(int locked) { if (locked) { digitalWrite(greenPin, LOW); digitalWrite(Relay1, LOW); digitalWrite(Relay2, LOW); } else { digitalWrite(greenPin, HIGH); digitalWrite(Relay1, HIGH); digitalWrite(Relay2, HIGH); } }

Question by LuccaL1   |  last reply