Jump to content

Ok guys need some help here before I attempt this


G+_Dominick Valentic
 Share

Recommended Posts

Switch252BWiring.jpg

Ok guys...need some help here before I attempt this. I really don't want to see the magic blue smoke ;) It's for the tracker I've been putting together and I wanted to use a toggle switch (SPDT On-Off-On) to control which direction and how fast the motor was going. Basically if the toggle was flipped one way it goes the tracking rate and CW direction and if you flip it the other way it goes as fast as it can and CCW so I can reset quickly.

So my code is set up so if voltage is detected at PIN 2 and not at PIN 12 start tracking and if it's the opposite the go the other way.

Question is whether the diagram below is correct or did I miss something? Do I need to go to ground somehow or is it really this simple? It almost looks to simple, but what do I know lol. Like I said, looking to avoid the release of the magic smoke. Thanks.

Link to comment
Share on other sites

I think that should work fine. I'm pretty sure the pins are 5v logic so you won't burn anything out. Some pins have pull up or pull down (I don't remember which is which) resistors connected on the board, so that would allow you to connect to ground instead of 5v. Either way should work.

?

Edit: for clarification, I'm not actually using that pin for analog input. This is connected to my refrigerator to sound an alarm if the door is left open ?

6388%20-%20IMAG3787.jpg

Link to comment
Share on other sites

Ben Reese I'm leaning towards that this is correct as well. It just seemed a little too easy and I always seem to think something must be wrong lol....As for your alarm, I could use one of those for my fridge. Ever since it was moved last year it's never sat quite level so if you're not careful the door doesn't always close tightly..PITA lol

Link to comment
Share on other sites

I'm not 100% sure this will work since there isn't a ground. Let's simplify this and look at Arduino's tutorial on using digital input with a button.

 

https://www.arduino.cc/en/Tutorial/Button

 

If you look at the schematic the 5v feeds into a button and when the button is pressed it goes to both ground AND the digital pin. I believe the ground is used as a bleed and the diagram uses electron flow diagrams instead of conventional flow (Which is a whole other pain in the ass subject).

 

At the same time I'm just programmer who fiddles with with Arduinos so take everything with a grain of salt.

 

In the end I don't think your diagram will hurt anything, and if it doesn't work add a ground!

arduino.cc - Arduino - Button

Link to comment
Share on other sites

 Share

×
×
  • Create New...