Batteries, etc

Discussion in 'The Projects Forum' started by KansaiRobot, Apr 12, 2015.

  1. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    I have just read that I can power my circuit with the PICKIT3 and probably that is what I will do but I would like to ask a rather naive, or noob question.

    Before, when I prototyped circuits in a breadboard, whenever I needed 5 v or 12 v what I did was buy a lot of 1.5v batteries, put it in series and connect it. Not the most elegant I know...

    I know there are some converter circuits and complicated stuff to get DC voltage from a AC power...

    anyway, my question is, How can I (other than my lot of batteries idea) obtain 5v or 12 v or whatever DC voltage I need for my circuits to connect to my breadboard???

    Thanks a lot
     
  2. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,699
    907
    The PK3 will supply a weak 5V's. I believe it is limited to around 20 to 30 mA. It cannot supply 12V for power. The Vpp voltage may be that high, but you cannot use it to power your target device. Rather than use the PK3 connected to a USB port, why not use the USB port directly? There are several designs for doing that.

    As for wall wart supplies, I have used one for years. It was made by Motorola and supplies +5V, +12V, and -12V . It uses a transformer and is regulated. Unfortunately, it is no longer available. Jameco and others are good sources for such devices. I suspect you have similar suppliers in Japan. I would advise against getting an inexpensive, wall wart switching supply. They can have a lot of electrical noise and may not be well regulated.

    John
     
  3. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Hi,

    If you just want 5V and 12V, get a 15V/1A+ wall wart, and two voltage regulators (7812 and 7805) and the caps they need to work - or go all the way and get/make a variable supply.
     
  4. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    Thanks for your answers
    I have been given a LCA10S-5 https://www.cosel.co.jp/jp/products/pdf/SFJ_LCA.pdf
    which provides 5V from AC

    Now I don't want to fry my ICs and components so what precautions should I take?

    The data sheet says the output is 5V and 2A . 2A is Huge I think for a circuit so what do I do to lower this to safe levels? A current divider? I am lost.

    Other things I have to take into account?

    Thanks a lot
     
  5. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    As long as your circuit is for 5V supply, you could use a 100A supply. Your circuit won't draw more current just because it's available.

    You could build a variable current limit for situations where you don't know if 5V is a bit too much, like an LED. With a variable current limit set to eg. 20mA, you could feed the supply to an LED without a resistor, as the voltage will be reduced to the voltage drop of the LED at 20mA.
    But for a 5V circuit, you have nothing to fear :)

    Edit: you could use a boost converter to get 12V from the 5V supply btw.
     
    KansaiRobot likes this.
  6. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    Thank you for all the answers.

    I have been revising a book on PICs and robots and I found they use 3V DC motors. Now I always though motors needed more voltage so I was surprised but my question is Since here Vcc seems to be 3V, do PICs also work not with 5V but with 3V???

    The schematics show a PIC16F84A-20/P. Can this (or the 18F2550) work with only 3V??

    ------
    reading a little more it seems that in fact they use 4 batteries so near 6V, and still they use that for the motors! (double the voltage!). How can they do that!? (in some other place I saw a test that says that for that voltage the motors got broken in an hour... )
     
    Last edited: Apr 15, 2015
  7. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,322
    890
    Different PICs have different minimum/maximum power supply voltage requirements. You have to read the datasheet.
     
  8. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Some DC-motors need less than 1V.
    The same motor can be made for different supply voltages, by different armature windings - many turns of a fine wire gives a motor that takes a high (relatively) voltage and a low current, while a few turns of a heavy wire result in a low voltage but a proportionally higher current - the power (V*A) will be roughly equal.
    Some motors are made to work on a single photo voltaic cell (solar cells), i.e. less than ~0.45V.


    most PIC-controllers can run from 2V to 5.5V and so can the 16F84A, but I wouldn't use it today, unless I had them, since they're old and outdated, with their newer siblings having more of everything (program space, stack, periferals etc.) at a lower price.

    The 16F628A is like a 16F84, but with twice the amount of program storage, RAM (stack) and EEPROM - at about half the price.
    It's not exactly new either, but it's in current production (which the F84 isn't) and lots of projects online use this chip - if you go for the absolutely newest, few(er) application examples, projects and so on will be available.
    The F628 doesn't have A/D-C however, but neither does the F84.

    When you don't need that many I/O pins, PIC12F683 would be a good start - same size as a 555 (8 pins) and with roughly the same parameters as the 16F628 plus 4 channels of A/D-C and more.


    DC motors have a nominal voltage decided by the manufacturer, based on numerous specs and what parameters it is made for.
    The isolation lacquer on the magnet wire used, can be changed to accept higher temperatures and so can the magnets (although their strength is inverse proportional with the max. temperature), allowing the motor to run a bit hotter.
    A motor made for constant running will tolerate less power than one made for eg. 5% duty cycle.
    And there's a lot of other things that makes a given motor into what it is, but that would take forever to go through :)

    A manufacturer may take a motor with a max. voltage of say 12V and spec it for eg. 4V to 12V, there's no rules on that, as long as the motor can move at the lower voltage and not die screaming on the higher voltage, everything's good.
    A 6Vmotor will usually run on 3V, although slower and with much less torque.
    Even if the motor is 3V max. and your supply is 6V there's the diode drops on an H-bridge (if used) of say 1.5V or in that neighborhood at least - then you're down to 4.5V
    Batteries will go down a bit with large currents, so that slices off a bit as well and running it on PWM at less than 100% takes care of the rest.

    Mounting a temperature sensor on the motor, you can use a higher voltage in short periods, letting the temperature control the max. speed at any given time.

    You mention a schematic. If you post it, you can get advice on the specifics of that schematic, rather than the more generic babble I just unleashed upon you :)
     
  9. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    KansaiRobot, you MUST read the datasheet for the PICs you're using. They will tell you the voltage required to make them run. Don't just assume it can or can't run at a certain voltage. The PIC18F2550 for example CAN NOT run on only 2 or 3 volts.

    I recommend looking for a secondhand (used) benchtop power supply, or build one using a large wall wart (that converts mains voltage to, say, 15VDC) and the voltage regulators, as suggested before.
     
  10. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    I beg to differ!
    DerStrom8, you MUST read the datasheet ;)

    Seconded - how can anyone live without it. I'd recommend a variable current limit as well, as it's almost as important as the PSU itself.
     
  11. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    From the datasheet:
    I don't recall the OP mentioning anything about having a PIC18LF2550, only a PIC18F2550, which can only operate from 4.2-5.5V.
     
  12. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    I do use cheap mobile phone chargers, of course they work.

    Also 2x AA which gives 2.5 volts or so, for standalone.

    The voltage boosters arent expensive and not hard to use, again, you can use one for mobile charging, or some IC.

    YX8018 is cheap but not regulated, its not a problem with limited current.
    Then MCP1624 or MCP1640 can provide exact voltage you need from 1 or 2 batterie.

    Most circuits can run from 3 volts, but some PICs cant be programmed at low voltages.

    Why use a large power supply for small microcontroller circuits?

    Sure there are electronic transformers, ranging from cheap ones to professional and expensive modules.
    Nowadays you can find small wall adapters in common electronic or household goods shops, even 100 yen shops do have some mobile chargers.

    The PICKIT3 can power most small circuits but of course there is some limit. It cant run motors for instance, or a relay.

    You can even power a PIC with a joule thief, the excess voltage will just disscharge, but from single cell, you normally get less than 5 volts in the first place.

    Its simple and cheap to make: Ferrrite core, wire, transistor, possibly a LED too
    These can be built very small tough not very efficient. Why not try YX8018? For a few mA, its cheaper than a mobile charger.
     
    Treeman likes this.
  13. Treeman

    Member

    May 22, 2014
    158
    15
    For your delectation the yx8018 datasheet. Funniest I've read yet.
     
    DerStrom8 likes this.
  14. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Yes, you're right - they buried that info well in the non-LF datasheet, but starts it off by:

    And on their 18F2250 page (non-LF) http://www.microchip.com/wwwproducts/Devices.aspx?product=PIC18F2550:
    With no mention of LF devices at all.

    While I like PICs, Ive always hated their badly structured datasheets, making some programming projects into page flipping frustration.

    Sorry :)
     
  15. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Yep, that's just a site issue. The PIC18F2550 and PIC18LF2550 are combined in that one datasheet (Not sure, the LF may have a separate datasheet elsewhere as well), but that's why the main site shows 2V. The PIC18F2550 needs at least 4.2V to operate though. :)
     
  16. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    even the old 16f54 happily runs off a 3v button cell it just cant be programmed at 3v.

    There are few PICs which dont work at low voltages its rather an exception.

    Arduino and PIC sources, as for me, are fully interchangeable, except odd hardware dependent exploits such as software USB, ok we got small crystal less 16F USB PICs.

    How about the many USB uncertainities? I dont exactly love the fact Windows7 tries to install the label printer each time i plug it in, it already works by the software, but Windows clickers for some minutes, searches its update for quite a while, then tells me it wasnt installed.
     
  17. frpr666

    Active Member

    Feb 2, 2010
    37
    6
    I'm happy with the wall adapter and 78L05. It has 100mA limit which is safe for breadboarding. I don't recommend the batteries while programing because some adapters read the target (MCU) voltage and adjust its own I/O signals voltage level. If the battery is week, the voltage might drop and the unmatched adapter I/O can fry the I/O of the target.
     
    Last edited: Apr 15, 2015
  18. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    I implemented a motor controlling circuit and program it with PWM.
    It doesnt work that well (somehow I am making some mistake in the reverse direction- do all DC motors run in both directions??-) but it is running somehow.
    I powered it with 4 batteries..
    then disconnected it

    thing is that later I found the 4 batteries have become very hot!! :eek: (just by standing there, they were disconnected from the circuit)

    So I took them off.

    I powered the circuit with the PICKIT3 and it works -half work well....
     
  19. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    The motors likely draw a lot of current which will cause your batteries to heat up significantly. Do not try to power the entire robot with your PICkit3! It will likely fry the components inside due to excessive current draw!
     
  20. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    yes, the PICKIT warned me that too much current is being draw and refused to connect it to my system, so I am going to review the circuitry today. :(

    Also somehow even though I put two pins for output, (B4 and B5) only B4 works well, the other only going from 0 to 0.x V... umm strange....
    Hope my PIC is still ok :oops:
     
Loading...