Maker Pro
Maker Pro

5v/12vdc inputs and only one of those as outputs using PIC18fxxxx

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 ~4W
A 5vdc fan is around 0.18A ~2W

So something like so:
Code:
                    |------|
    ---5vdc-in----->|  IC  |
    ---12vdc-in---->|  ?   |-----5 or 12vdc-out-->
    ---PIC pin-in-->|      |
                    |------|
Or better visually is this:
i9oGV.jpg


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.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Use a p channel mosfet to switch the 12V then use schottky diodes to OR this and the 5V together.

Your mosfet will require a resistor from gate to source and be switched by an open collector output unless your IC is powered from 12v or more.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
There's plenty of things, but in your case it can be done in a way which doesn't risk the device being depowered or the rails being shorted during switching.

The first of these problems may not be an issue in your case, but the second can be an issue using semiconductors as switching elements because they may take a different amount of time to turn on and off, and they don't snap from one to the other.

My solution would still feed 5v to the device if you requested 12v, but the 12v rail was off and the 5v radio was still on.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Here is the circuit:

upload_2016-10-29_8-29-47.png

D2 is optional. If the 12V supply will always be available when the 5V supply is available, D2 can be omitted.

Q2 is any small general purpose NPN transistor.

Q1 is a P Channel mosfet with Vgs(max) > 12V (20V is common, so this is not a huge issue).

D1 and D2 are schottky diodes rated for at least 20V.

The control input needs to swing from near ground to probably at least 1.5V, but anything up to (or exceeding) 12V would probably also be fine)

This might look a little more complex than a relay, but if you're driving a relay from a microcontroller you'll need 3 of these parts, and the current drain will be waaaay higher.

If you want to make it really small, you can use surface mount components. There are so-called "digital transistors" which incorporate Q2 and R2 in a single package (SOT-23 is probably as small as you'd want to go unless you're really experienced and want two of them on say an SOT-363). Q1 could be in an SOT-23 package as it's not dissipating much power. R1 could be 0603 or smaller if you can manage it. You may be able to get D1 and D2 in a single SOT-23 package.

Here are some examples. Chosen for cheap $US prices unless noted (YMMV)

Q2 - MMBT2222AL (or DRC2114T0L for pre-biased including R2)
Q1 - BSS316N
D1/D2 - CUS10S30,H3F (single diode chosen for size and Vf)
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
The 4066 will work fine IF you can change your current requirement from 250mA down to 2.5mA.
 
Top