Loading...
Pages: [1]   Go Down
Author Topic: Switchable USB charger  (Read 331 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What I want to do is a USB charger using a 7805, a type-A female USB port and powered by a cell phone charger. You see a lot of howtos - for example on Instructables.

I'll need it to charge a keychain spy cam (google image search). But additionally I want to control the charging cycle using an Attiny85. This Attiny85 will set the 5V output to the USB on or off - triggered periodically or by some sensors.
So the 5V output from the 7805 would power the Attiny85 and the USB port.

I don't know how to switch the 5V to the USB on and off. I have some 2N2222 lying around, but is this advisable? According to this datasheet it can handle more than 5V and up to 600mA. I guess the spy cam won't draw more than 500mA...? I also guess it is out of the question using an optocoupler, right?

So what do you think: Is it advisable to use a 2N2222?
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5174
CMiYC
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What do you mean by "charging"?

Are you sure the devices you are attempting to "charge" don't already have a charging circuit?  In which case, you are just controlling when power is turned on or off.
Logged

www.cmiyc.com - A guide to being an Enginerd

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi James

yes, the camera gets charged by plugging its UBS cable to a port.

But the thing is that the camera goes into kind of "charging mode" when plugged into USB. This means that I can't take photos while the camera gets power over the USB cable.

So I want the camera plugged in USB all the time but I have to make sure it doesn't get powered when Arduino triggers a photo. This means I have to interrupt the 5V to USB by Arduino and I'm asking myself if I can do it with a 2N2222 transistor.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5174
CMiYC
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The 2N2222 can be used to switch your load (camera charging circuit) on and off.
Logged

www.cmiyc.com - A guide to being an Enginerd

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

this is my set up and it works like a charm smiley
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5174
CMiYC
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The load should be switched from the "high" side/collector of the 2N2222, not the "low" side.

http://www.kpsec.freeuk.com/trancirc.htm
Logged

www.cmiyc.com - A guide to being an Enginerd

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

James, thanks for the link!
Logged

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, this is my design I finally came up with:



And a description of the full project on my blog.
Logged

Cumming, Ga
Offline Offline
Edison Member
*
Karma: 12
Posts: 1389
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For about $3 you can by a component from Digikey, the Micrel MIC2545 that essentially does what you need without very much complexity.   Added
 bonus:  It's Fully USB compliant...   so no fear of worst case scenario hurting your device.

http://www.digikey.com/product-detail/en/MIC2545A-1YM/576-1086-ND/771555

http://teacher.en.rmutt.ac.th/ktw/Resources/PC%20Interface%20softwares%20&%20Documents/DataSheet/USB/UsbBookNote/Chapter13/Micrel/MIC2545ds.pdf

Logged

Pages: [1]   Go Up
Print
 
Jump to: