5v/12vdc inputs and only one of those as outputs using PIC18fxxxx - Page 1
Forum section: electronics / projects

author: Stealthrt
author_rank: Regular Contributor
timestamp: October 27, 2016, 06:44:46 pm
content: Hey all I am trying to find an IC that can accommodate having 2 inputs but only one output depending on what I send via a PIC18fxxxx micro controller. This sounds like it would be a DPST but I can't really find anything like that I can control from a PIC to choose what output needs to be on.The 5vdc and 12vdc will be to power a PC FAN. The 5 and 12vdc will be coming from the PC PSU.A 12vdc fan is around 0.25A ~4WA 5vdc fan is around 0.18A ~2WSo something like so:Code:|------|---5vdc-in----->| IC |---12vdc-in---->| ? |-----5 or 12vdc-out-->---PIC pin-in-->| ||------|Or better visually is this:The PIC pin would control the IC to let it know which voltage to output.Does anyone know if this type of IC exists? I'll need to be able to do 10 outputs all together.

author: danadak
author_rank: Super Contributor
timestamp: October 27, 2016, 07:01:59 pm
content: Google "dual high side switch".Some examples -http://www.st.com/en/automotive-analog-power-ics/high-side-switches.html?querycriteria=productId=SC1037Regards, Dana.

author: mariush
author_rank: Super Contributor
timestamp: October 27, 2016, 07:27:02 pm
content: You could just use 4 logic level mosfets , or a couple of dual n channel mosfets.. something like FDS9926A comes to mind :http://uk.farnell.com/fairchild-semiconductor/fds9926a/mosfet-dual-n-ch-20v-6-5a-soic/dp/2323203or FDC6305http://uk.farnell.com/fairchild-semiconductor/fdc6305n/mosfet-dual-nn-supersot-6-full/dp/2438424Since you're using a microcontroller it would be fairly easy to add some logic to turn off a mosfet, wait a millisecond or so to make sure the mosfet is fully off and turn on the other one.

author: Kalvin
author_rank: Super Contributor
timestamp: October 27, 2016, 07:42:48 pm
content: Place a schottky diodes in series with the 5V and wire it to motor's positive voltage. Place a P-MOSFET in series with the 12V. Take another schottky diode and wire the diode so that it is between the MOSFET's drain and motor's positive voltage. Now you just need to switch the MOSFET on and off in order to select fast and slow fan speed.

author: Stealthrt
author_rank: Regular Contributor
timestamp: October 27, 2016, 07:44:18 pm
content: Quote from: mariush on October 27, 2016, 07:27:02 pmHow would that hook up in my scenario?

author: JS
author_rank: Frequent Contributor
timestamp: October 27, 2016, 08:48:46 pm
content: The 5V should be directly connected with a diode, then you just switch the 12V in and out.For doing so you could use a mosfet, to do the high side switching here is a scheme, note that you can't use 2 to switch the 5V in and out as the parasitic diode inside the mosfet at the 5V rail would be directly biased when 12V are selected. If you also want to turn it off completely you could just use a mosfet on the low side driven directly from the µC. Connect D1 to 5V instead of ground.To do the job you need two P-channel mosfet, two diodes, two transistors and a few resistors. Here are some mosfet. Then look for schottky diodes, and 3904 or whatever transistor you have nearby.http://uk.farnell.com/international-rectifier/irf7304trpbf/dual-p-channel-mosfet-20v-4-7a/dp/9765662JS

author: Stealthrt
author_rank: Regular Contributor
timestamp: October 27, 2016, 11:36:02 pm
content: hum... is there no IF that has 2 inputs and one output from those 2 inputs?

author: JS
author_rank: Frequent Contributor
timestamp: October 28, 2016, 04:33:10 am
content: I don't know if there is an specific IC, but even if there were you still need to manage some power, logic ICs ain't gonna carry the 250mA you need, you still going to need some power device, and as you do you don't need much more than that to get it to work. It won't get much simpler than a mosfet, you could work around the bjt in there but I guess it doesn't worth it. If you need to switch 10 things always at the same time a beefier switch (mosfet) would do the job, just rate it for the current you need.The option would be independent mosfets and a single BJT driving them all (all gates in parallel) or, of course, you could use independent circuits for each one and do whatever at the logic side (marked as TTL in)There is no specific reason the BJT has to be a BJT, could be an N-channel Mosfet, I just keep calling BJT as is easier to identify in the schematic.JS

author: Andreas
author_rank: Super Contributor
timestamp: October 28, 2016, 06:38:30 pm
content: Quote from: Stealthrt on October 27, 2016, 11:36:02 pmHello,you could use a LM317 according to figure 35 in data sheet.http://www.ti.com/lit/ds/symlink/lm117.pdfLM317 + 3 resistors + a transistor (with base resistor).With best regardsAndreas