Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

AND-OR Gate


  • Please log in to reply
26 replies to this topic

#21 pjnowak

pjnowak

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 03 July 2012 - 07:52 PM

You should not have to invert the inputs. The three Nand gates give the same logic as the And-Or circuit.

Paul


Ok thanks, How would this work then with a dpdt switch?

When I quickly tried it this morning I was having difficulties getting it to work. I am probably doing something wrong, or not understanding something.

Here is my desired output:

Netduino | P1 | P2 | Output
-----------------------------
1 | 0 | 0 | 0
1 | 1 | 0 | 1
0 | 1 | 0 | 0
0 | 0 | 1 | 1
0 | 0 | 0 | 0

#22 Geancarlo2

Geancarlo2

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts

Posted 03 July 2012 - 08:14 PM

Hi, you are missing a few states there so one can derive a proper circuit...

#23 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 03 July 2012 - 09:06 PM

I think I see where you are going with this.

P1 and P2 are your DPDT switch.
  • When P1 is high and P2 is low, the output is controlled by the Netduino.
  • When P2 is high and P1 is low, the output is forced on.
  • When P1 and P2 are low, the output is forced off.

I think what you need is actually three position toggle switch.
Maplin (in the UK) has a range of toggle switches following the link, type B or C is probably what you want.

The switch has three terminals the centre is the common, the other two are normally open contacts.
  • With the type B the switch latches in either direction. When it is the centre position neither contact is made. "ON-OFF-ON Locking both, ways, centre off"
  • With the type C the switch will not latch in one of the directions. "ON-OFF-(ON) Locking one way, non-locking one way, centre off" You might want the non-locking feature so that you have to hold it to keep it forced on, but you don't have to hold it to keep it forced off or set for Netduino control.

Wiring it up would be simple, connect the centre terminal to 5V.
Connect each of the outer terminals to an input (P1 and P2 in your post above - B and C in my table).
Also connect each terminal to a resistor that connects to ground. (About 4K7 "4700ohms").
When the switch is in the middle position neither switch terminal is live, and so both P1 and P2 inputs are pulled low by their resistors.
When the switch moves in either direction, P1 or P2 will be pulled high by the switch.

Hope I got that right.

#24 pjnowak

pjnowak

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 04 July 2012 - 03:16 AM

I got it to work with a switch, thank for all of your help.

#25 pjnowak

pjnowak

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 04 July 2012 - 04:23 AM

Here is what I came up with. Thanks again for the help.

Attached Files



#26 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 04 July 2012 - 06:51 AM

Well done. Just one thing, in the diagram the resistor in the bottom left corner is connected to pin 3, it should be pin 4. Now you will have to etch a PCB to put it all on! Paul

#27 pjnowak

pjnowak

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 05 July 2012 - 01:46 PM

I plan on making a board out of this, once I am all finished, the next step for me it get the shift registers working so that I can control up to 16 valves and pumps. Then I plan on getting the board from BatchPCB.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.