G+_Dominick Valentic Posted October 22, 2016 Share Posted October 22, 2016 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 More sharing options...
G+_James Hughes Posted October 22, 2016 Share Posted October 22, 2016 Where is your ground? Link to comment Share on other sites More sharing options...
G+_Ben Reese Posted October 22, 2016 Share Posted October 22, 2016 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 ? Link to comment Share on other sites More sharing options...
G+_Dominick Valentic Posted October 23, 2016 Author Share Posted October 23, 2016 James Hughes Physically on the board it's next to the 5v pin the red wire is going to....as for in my wiring diagram as far as I can tell I'm not connected to ground, but by what I've read about on the Arduino pins is that they can output or input up to 5v volts depending on what commands your using Link to comment Share on other sites More sharing options...
G+_Dominick Valentic Posted October 23, 2016 Author Share Posted October 23, 2016 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 More sharing options...
G+_Brandon M Posted October 24, 2016 Share Posted October 24, 2016 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 More sharing options...
G+_Brandon M Posted October 24, 2016 Share Posted October 24, 2016 Possibly something like this but I would sanity check it first Link to comment Share on other sites More sharing options...
G+_James Hughes Posted October 30, 2016 Share Posted October 30, 2016 Dominick Valentic? I understand where the ground is on the arduino (I have quite a few). I don't think you'll see magic blue smoke, but all you showed was an input. Your circuit is incomplete. Link to comment Share on other sites More sharing options...
Recommended Posts