Shop OBEX P1 Docs P2 Docs Learn Events
I want to supply 3V to MP3 player - best way to turn on and off with the prop? — Parallax Forums

I want to supply 3V to MP3 player - best way to turn on and off with the prop?

GeeksGoneBadGeeksGoneBad Posts: 100
edited 2012-10-24 07:51 in Propeller 1
I have a small MP3 player that runs on 3V - whats the best way to control power to the device using the prop? I asking for the best way to wire it and also how to code it

Thanks!
Jamie

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2012-10-23 06:38
    The propeller chip can drive a relay or power transistor just like any other microcontroller. I've used a tip120 to power stepper motors, so it should work fine for what you want. I used a schematic similar to this one:

    tip120_circuit.png

    The diode in that circuit protects against the flyback current that happens with an inductor. It might not be needed for your application. Another thing to consider is the voltage drop across the transistor. Your input voltage (e.g. the 9 volts in the above schematic) needs to be higher than the desired output to compensate.

    A relay has an advantage that there's no voltage drop, but to drive a relay you need to consider the current its coil draws. What I've done is use a small signal diode instead of a TIP120 in a schematic identical to the above. It turns on the relay which in turn turns on the device without any voltage drop issues. I bought everything from Radio Shack too.
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-10-23 06:53
    Hmmm ... I'd say that a simple FET should do the job! And are you sure that having control over power-supply is enough? What about the push-button for power on/off?
    What about the other push-buttons like previous/next title, stop, volume up/down?

    Recently I tweaked a device where I simply used a 4066 in parallel to the buttons. This way the buttons still work and the propeller can take over control ;o)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-23 06:55
    I have 4 wire 3.3volt regulators and the 4th lead is an on/off. This would be a nice clean way of doing it.

    http://www.datasheetcatalog.org/datasheet2/e/0l55x3pr5j0k4x8s96kswhjo903y.pdf

    Something like the above, but mine are 1.5 amps. There may be some that are adjustable, but just about any regulator can have its reference voltage lead tweaked to get another voltage.

    That TIP120 solution has a 4 volt drop at 2amps saturation and a 2 volt drop at 1 amp saturation. A simple 2n2222 transistor will provide 700ma and have about a 1 volt drop at saturation. What this means is that a TIP120 might require 7volts to provide 3, while a 2n2222 would require 4 volts to provide 3.

    You need to determine how many amps (or watts at 3 volts) you require to determine a good fit for a transistor.

    Of course, using a voltage regulator also requires providing a higher voltage, but a smooth output is assured. Though you can use the Low Drop Out region, that tends to consume power faster, so think about 5-6 volts for a 3volt device.

    MOSfets will have the least power wasted in a voltage drop. I presume you need a constant 3 volts and want the lowest voltage power source you can get - maybe something like 4.5V from AA cells or even 3.6 from NiMH AA cells.

    HOWTO code the Propeller.... If you want to control the MP3 Player via your computer or a wireless serial link, just load PropForth.

    The examples below are for Pin 1, not Pin 0

    In PropForth,
    : PlayerON 1 Pinout 1 Pinhi ;
    : PlayerOFF 1 Pinout 1 Pinlo ;

    Then you just say PlayerON or PlayerOFF from a serial terminal.
  • GeeksGoneBadGeeksGoneBad Posts: 100
    edited 2012-10-23 06:56
    I have already worked out the button pushes :) although my buttons will no longer work as I destroyed them to solder wires to the pads - but the way this MP3 players works is when there's power applied it starts playing and there's no stop button only play and pause - so I was thinking it's be easier to kill power to start it over
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-23 08:51
    A little bit of knowledge is a dangerous thing, so maybe you can provide some more details.

    I would help to know if you intend to power this from a wall wart or batteries.

    Do you want the 3 volts provided to replace two AA alkaline batteries? If so, I think you will find that fresh alkaline are actually above 1.5 volts each, maybe even 1.65 volts. That would mean that your mp3 player could tolerate 3.3 volts, but it might be safest to just provide a steady 3 volts.

    The other thing is that the actual voltage is never enough for solid-state switching designs.

    One needs to know how many milliamps or amps you need in order to select an appropriate device. The TIP120 is rated to deliver up to 5 amps but darlington pairs have twice the voltage drop of regular transistors. Personally, I don't think you need anywhere near that much. And you might need less that 500 ma. If you do need a lot of power, a newer high-beta transistor is better than a darlington pair.

    If it requires only 500 ma power (you do have to measure with an amp meter to find out), the 2N2222 transistor is the simplest. Yes you can use a MOSfet, but they can be tricky to turn on at 3.3 volts - you have to know how to select and buy the right one.

    If the MP3 player will operated over a wide range (say down to 2 volts) you can just use two AA cells and a 2n2222. But if it needs all of 3 volts to work properly, you will need at least 3.6 volts to power it with a 2n2222 AND if you do go too far to a higher voltage (lets guess anything over 3.8 V) you might risk damage to it by high voltage.

    So I suggested the 3.3 voltage regulator with an enable. The voltage is steady regardless of the power supply and the hook up is simple. If you want to bring the 3.3 volt output down to 3.0, a 1 amp Schottky diode has a .3 volt drop - just put it in series.

    Google "3.3V regulator with enable" to find a good one.

    If you cannot find what you want, just use a transistor and have an adjustible voltage regulator provide the plus voltage to unit and the 2n2222 switching the low side in such a way that results in the MP3 player always seeing 3.0volts. For that you will need to provide about 6-7 volts into the regulator.
  • GeeksGoneBadGeeksGoneBad Posts: 100
    edited 2012-10-23 09:03
    I think that the battery that was with the MP3 player was only 3V, it was built in - rechargeable... I yanked it out and applied the 3.3V from my breadboard I have my Propeller set up on - worked just fine :) I may be pushing it, but it seems to work just fine... Now I just want to turn it on and off

    How this project will be powered is interesting :) I will be powering a Prop Proto board from the 3.3V output of a Spark FUN Easy Driver (maybe it's 5V output, I can't recall right now) and the Easy Driver will be powered from a wall wart
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-23 10:57
    Well, here is a 1 amp adjustible voltage regulator with enable - for those that never knew these things existed. Of course ordering them is a whole different issue. And then there is getting the device in the right package.

    Yanking out and just going for it is rather hazardous to one's projects and pocketbook. In could have been a 3V Lithium cell that requires something higher to actually take a charge (try Wikipedia for the details). NiCd and NiMh would have been 3.6V and the other Lithiums are 3.2 or 3.3 and 3.6 or 3.7

    I guess you are thinking of using the +5 or +3.3 from the Propeller board to power the MP3 Player. I'd try running the +3.3 with a 2n2222 to see if the MP3 Player would run on a reduced voltage and at 700ma or less. It would probably work.

    I just found there is an SC1565 that handles 1.5 amps, adjustible, and with enable that in an easier package to solder. Ask for samples... of course.
    http://www.semtech.com/power-management/linear-regulators/sc1565/
  • GeeksGoneBadGeeksGoneBad Posts: 100
    edited 2012-10-23 11:02
    Good thing it's only a $3 MP3 player ;) I don't see me doing that with my IPOD or anything hehe

    thanks for the link to the voltage regulator with enable - I will have to get some of those - do you know if they have them in through hole packages? (I will look regardless) :)
  • Mark_TMark_T Posts: 1,981
    edited 2012-10-23 16:25
    A simple PNP switching transistor (for high-side switching) would do - if the load isn't too high a TO92 one would probably suffice. And bipolar transistors provide rudimentary current-
    limiting so the inrush to the MP3 player's decoupling capacitors doesn't crow-bar local supply rail.
  • GeeksGoneBadGeeksGoneBad Posts: 100
    edited 2012-10-24 07:06
    thanks - I got it to work with a 2n222 transistor NPN I think, right? I never know when to use a PNP or NPN transistor, but I figure the PNP is on until I turn it off and I want off until I turn it on so that's NPN, right?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-24 07:45
    Good thing it's only a $3 MP3 player ;) I don't see me doing that with my IPOD or anything hehe

    thanks for the link to the voltage regulator with enable - I will have to get some of those - do you know if they have them in through hole packages? (I will look regardless) :)

    The reality is that less and less is being produced in through hole packages, these seem to be only in surface mount. The PDF has a listing of available packages - just select the one that is the largest and simplest to work with.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-24 07:51
    thanks - I got it to work with a 2n222 transistor NPN I think, right? I never know when to use a PNP or NPN transistor, but I figure the PNP is on until I turn it off and I want off until I turn it on so that's NPN, right?

    The 2n2222 is NPN and is used ordinarily for a low side switch. The 2n2907 is its PNP mate and used generally in a high side switch for digital purposes. You need a pair of each to create an H-bridge.

    PNP does conduct when pulled low, so it would seem to be an on until turned off.

    NPN conducts when pulled high. I suppose that in enough to know for basic switching, but there is quite a bit more if you want to drive significantly higher volts or more watts.
Sign In or Register to comment.