Author Topic: Transistor as a swtich practical doubts  (Read 1288 times)

0 Members and 1 Guest are viewing this topic.

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Transistor as a swtich practical doubts
« on: March 06, 2018, 07:55:03 pm »
Hi All,

I am trying to power an ATmega328P via a USB when it is not powered by the 5v rail on the PCB. The Atmel will only be used to upload sketch when connected via the USB and nothing else. Would any one please advise if the schematic attached (VoltageSwitch)would work ?

Another one that i had in mind based on the circuit of the Arduino R3 Schematic is also attached (ComparatorDesign)

Thanks in advance.
 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1184
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: Transistor as a swtich practical doubts
« Reply #1 on: March 06, 2018, 08:59:32 pm »
The first schematic does nothing as the transistor is always switched off.
The second is some complicated affair doing something that can probably be acheived by a diode, from your description of powering the Atmega from USB when some other supply is not working a simple diode,anode to usb+ & cathode to Atmega 5V should work, of course I may have misunderstood your explanation ?
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: Transistor as a swtich practical doubts
« Reply #2 on: March 06, 2018, 09:05:54 pm »
To keep it simple, my idea is to power the avr via the 5v rail when the usbVcc is not available and power it with usbVcc when 5v rail is not available and also cut-off usbVcc when both usb is connected and 5v rail is available.


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3481
  • Country: us
Re: Transistor as a swtich practical doubts
« Reply #3 on: March 07, 2018, 01:44:02 am »
Use a SPDT 5 V relay with the coil connected to the 5 V rail.

Relay down, power from rail
Relay up, power from USB

The way to solve such problems is to build a truth table.
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: Transistor as a swtich practical doubts
« Reply #4 on: March 07, 2018, 04:44:42 am »
The truth table is like this,
V+ > V- = Vcc
V+ < V- = vee

I've been looking that the schematic of the Arduino R3 and modified it but am a little lost as how to supply the initial voltage to the divider and the opamp. The opamp wouldn't be any of any use when powering from the pcb +5v rail as there is no USB+ so the opamp should be powered by the USB+.
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: Transistor as a swtich practical doubts
« Reply #5 on: March 07, 2018, 01:54:40 pm »
I guess initially i wasn't thinking. The resistor wouldn't be necessary or would it ?
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3481
  • Country: us
Re: Transistor as a swtich practical doubts
« Reply #6 on: March 07, 2018, 02:11:14 pm »
All you need is the relay connected to the 5 V supply at one side, the USB 5 V at the other and your device in the center.  The relay is energized if you have 5 V and the circuit  uses that,  otherwise it's not energized and the project uses the USB 5 V.  One part for a buck or two.
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: Transistor as a swtich practical doubts
« Reply #7 on: March 07, 2018, 02:33:31 pm »
I had a couple of these opamp laying around and moreover I thought this would be good time to learn to use a comparator.

The first design I thought was a really but I’d appreciate if somebody could guide me on the comparator design.


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf