Battery-less PICAXE idea...

vttom

Senior Member
I did a quick search of the forum and did not find this mentioned, so my apologies if this is old hat...

I've been successful in using my PICAXE-based projects battery-less by powering them from the DTR (Data Terminal Ready) pin of the serial port of a PC.

Basically, the circuit looks like this:

Code:
DTR >--+
       |
       /
       \ 1k
       /
       |
       +------------+-----> VDD
       |            |
     __+__/       --+--
    / / \ 5.1V    --+-- 220uF
      -+- Zener     |
       |            |
       +------------+
       |
     -----
      ---
       -
 

hippy

Ex-Staff (retired)
You can also use 5V LDO ( Low Drop-Out ) regulators to the same effect ( but not so cheap ). If you need more current than just DTR can supply ( ~10mA ? ) it's also possible to diode-mix DTR and RTS.

You can go a step further and diode mix in a 4V5 / 6V battery and when connected to a PC ( DTR or RTS above battery voltage ) the current can come from the PC but it will run on batteries when disconnected.

Keep those useful tips coming !
 

fernando_g

Senior Member
You can go a step further and diode mix in a 4V5 / 6V battery and when connected to a PC ( DTR or RTS above battery voltage ) the current can come from the PC but it will run on batteries when disconnected.

Keep those useful tips coming !
I actually did exactly that, some time ago, with an additional refinement..once that it is running on battery power, the PICAXE changes to a lower power mode...which meant using a lot of DOZE 7 to lower the average consumption. Of course not all projects will allow that.


Let me see if I can find the schematic...must be somewhere.

Also, your included 220uF cap is an excellent, almost mandatory, idea whenever batteries are used. It is simply amazing how smoothing out the current-draw pulses can significantly increase a small battery's useable life.
 
Last edited:

vttom

Senior Member
Also, your included 220uF cap is an excellent, almost mandatory, idea whenever batteries are used. It is simply amazing how smoothing out the current-draw pulses can significantly increase a small battery's useable life.
The 220uF was somewhat arbitrary. It's what I had lying around (I knew I wanted a pretty big value).
 

hippy

Ex-Staff (retired)
Also, your included 220uF cap is an excellent, almost mandatory, idea whenever batteries are used. It is simply amazing how smoothing out the current-draw pulses can significantly increase a small battery's useable life.
Now that's something I never knew, nor something I'd ever thought about. Thanks.
 

Tom2000

Senior Member
I've been successful in using my PICAXE-based projects battery-less by powering them from the DTR (Data Terminal Ready) pin of the serial port of a PC.
Massive head slap!

If there was ever a "now why didn't I think of that" idea, this one has to be it. Well done!

Tom
 

leftyretro

New Member
Keep in mind that this develops positive +5vdc voltage only if DTR is asserted on (positive rs-232 voltage), if the host turns off DTR (a negative RS-232 voltage) then there will be no power for the picaxe. Also the amount of current available from the DTR pin is pretty low, and one would have to see if it is enough for the specific Picaxe circuit being powered. Can't see enough to be lighting any LEDs.

Lefty
 

manuka

Senior Member
Even though serial (& even USB) powering may appeal, the merits of using $$$ PCs to power the likes of $ PICAXE circuitry are questionable- & even more so given the increasing elusiveness of D9 ports. 3 x AAs win hands down IMHO-cheap alkaline AAs last virtually shelf life in simple setups, with the greatest concern being eventual leakage.

Aside from the 1F "statement cap." used by today's $$$$ in car audio fanatics, that electrolytic cap. in parallel trick was popular with the first power hogging transistor radios 50 years back- I'm really feeling ancient now. It improved battery life & eased annoying "motor boating" when the volume was turned up. (Quote=> In an audio-frequency amplifier,pulsations of the current in the output circuit, if passed through the coil windings of a loud speaker, cause the latter to emit familiar "put-put-put" sounds which are somewhat analogous to the sound of the exhaust of a distant motorboat )
 

hippy

Ex-Staff (retired)
Manuka : the merits of using $$$ PCs to power the likes of $ PICAXE circuitry are questionable

Absolutely, but the idea ( unless I am mistaken ) is really to save batteries while using the PC during development.

Lefty : Can't see enough to be lighting any LEDs.

Assuming there's 10mA ( the figure I've always worked on ), that can easily handle five or so LED's providing one doesn't want to run them as bright as lasers. Programming during download requires some current but I've never encountered any problems.

Losing DTR/RTS power does kill the power, hence the diode-mixed battery backup is handy and somewhere I have a utility which simply turns DTR and RTS on if I need it.
 

Mike Hawkins

New Member
USB Power

The specifications for USB is 5V +/- .25V and a minimum of 100mA and some units up to 500mA. Is there any reason I could not modify my USB cable to provide this power?

I have just finished school, but have introduced PICAXE to my electronics teacher. I'm thinking it would be much easier to have the computer supply the power for programming than every student (15) needing a battery pack whilst working at the computer.
 

Ralpht

New Member
The specifications for USB is 5V +/- .25V and a minimum of 100mA and some units up to 500mA. Is there any reason I could not modify my USB cable to provide this power?
Perfectly feasible Mike.
A lot of commercial devices do exactly the same thing.

I would suggest using a USB hub in between the PC's USB port and your own projects. Usually the Hub will provide the full 500mA as opposed to the PC's USB port, which will only provide the current the attached device requires. Each USB port can provide a max of 500mA depending on what is connected. Most devices actually "tell" the PC's USB port what their current requirements are and the PC adjusts the port to suit.

Using a hub also prevents damage to the PC's motherboard should an accident occur. Killing a sacrifical hub is better than potentially destroying a motherboard.
 

LizzieB

Senior Member
Even though serial (& even USB) powering may appeal, the merits of using $$$ PCs to power the likes of $ PICAXE circuitry are questionable
I'm with you on this one manuka. It's a neat trick for the experienced user but 3 x AA's are cheap insurance for anyone else.
 

manuka

Senior Member
Mike - I'm a huge USB fan & it's totally feasible , BUT as most schools level PICAXE circuitry will be portable ( LEDs, piezo, dataloggers,timers, small motors, wireless etc) it'll create classroom bottle necks if PC powering is needed. A lot of hardware tinkering happens away from the editor PC anyway.

Picaxes do NOT need a stable 5V, as they run on anything between ~3V & 5½ V, & with typical loaded current drains of ~10mA-20mA, cheap AAs last months in schools use. I've still some fitted back in 2005 that are still working well in a HopeRF setup.

Check the 2 or 3 x AA switched battery box shown below (not mine- developed by fellow Kiwi Andrew "BrightSpark" for NZ schools use), which is dirt cheap, & even if AA alkaline filled will be all up probably cheaper than a USB cable anyway. Kids can take such setups home with them to show off when like this too. You may laugh about such "take homes", but such Marketing 101 style word of mouth PR is outstandingly good promotion for the school & electronics programs!
 

Attachments

Mike Hawkins

New Member
I wasn't thinking of completely replacing the battery, just having the computer supply the power when programming. Perhaps hook a diode up between +ve battery and picaxe so that when the PC power is there it is used, but if there is no battery, or it is too flat to program, it still programs from computer power. I've had one running at just over 2V but this is no where near enough to program.

I don't think that our school computers have D9 connectors (they were specially done for the Department of Education and only have what they need) so it will have to be USB anyway, and it would be useful to get the most of it.

I know what you mean about 'take homes'. In year 9 we make all the Dick Smith Funway 1 projects, then in year 10 we make an adjustable power supply and an intercom. All of these are kept by us and the power supply is used alot to rebuild the Funway 1 kits at home.

About six months ago my electronics teacher asked if I was still playing with electronics (Electronics is years 8-10 only, I just finished year 12 a month ago) the next day I showed him a PICAXE playing the James Bond theme. Yesterday his arrived, and he called me up for help, after 15 minutes trying to work out what was wrong we dicovered that what we thought was the top of the stereo connector was the bottom and swapped the wires for a succesful download. I think the school will be starting a new subject next year using PICAXE, and it won't just be the students learning. :D
 

manuka

Senior Member
MikeW: You'd better shoot me his contact details (via my email at end of => www.picaxe.orcon.net.nz ) as I may be able to point him to budget saving NSW contacts - the least of which could be Aussie's own "Silicon Chip" of course. Stan
 

moxhamj

New Member
"The specifications for USB is 5V +/- .25V and a minimum of 100mA and some units up to 500mA. Is there any reason I could not modify my USB cable to provide this power?"

Well if it is just for programming there is no reason why not.

A song has just popped into my head: "Going to the Casino. What could possibly go wrong?.."

In this case, one of the worst things would be that the -9V from the inverter inside the USB to serial converter could end up being fed back up one of the USB lines.

I think if you build a small board, and had a socket for programming the picaxe, and made the board in a "robust" way (ie no stray wires on the back to break off), maybe potted it with some hot melt glue etc, then it would be unlikely to zap the USB.

But if you had a board that was also an active proto board with stray wires all over the place then the probability of zapping the USB goes up.

It depends a bit on how neat you build your circuits.
 

boriz

Senior Member
Might be worth pointing out that 100mA is the absolute max UNLESS the external device requests 500mA using a specific protocol. I wouldn’t risk it unless I had bombproof current limiting on the external circuit.
 

MFB

Senior Member
The technique of powering microcontrollers from the serial RS232 port is now so well established that some applications, like StampPlot Pro from Selmaware, even allow you to toggle the RTS output line on/off from their com’s set-up window.

However, its worth remembering that the output from many USB –to- RS232 adaptors can only swing over +/- 5volts, but this is still usable if a low-drop 3.3 volt regulator is employed to drive the PICAXE. A series Schottky diode is also required to block negative voltages from the RS-232 port.
 

Brietech

Senior Member
I actually just drilled holes in my case, and installed 2 of those banana-plug posts on the outside of it connected to the 5V rail from my PSU (as much current as you could ever use on a picaxe!).
 
Top