SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
User avatar
By roach
#9959
Hi all. I'm fairly new to the hooby electronics thing, with no electrical experience or engineering. Some would say it's a steep hill to climb, but I love a challenge. Case in point:

I'm trying to develop a mobile robotics platform. Nothing to fancy, just a CPU (atmega162), driving a couple of motors with PWM. In the past, I've used a two-battery design, one for the CPU, one for the motors, to prevent any power spikes or sinks from the motors starting up from frying, or resetting the AVR. (similar to the H-Bridge concept, but brutally simplified). I guess my question is: is there a better solution?

Details: I'm using a nokia 3.7Volt cell-phone battery to power each circuit. This provides more than enough power for my needs, when the drive circuit is seperated from the logic circuit, but is there a way to eliminate this second battery, say with a filter cap, inductor, or whatever? Ideally, I want to merge these two seperate power sources into a single one, even if it means changing up to a more powerful battery...

thanks!
User avatar
By roach
#9960
On a related note. I'm charging the batteries with the MAX1811 LiIon charger (from the Maxim application notes). Right now I have a working design to charge a single battery at a time. Is there a way I could charge two batteries simultaneously (by hooking them up in parallel)?
By NleahciM
#9961
roach wrote:Hi all. I'm fairly new to the hooby electronics thing, with no electrical experience or engineering. Some would say it's a steep hill to climb, but I love a challenge. Case in point:

I'm trying to develop a mobile robotics platform. Nothing to fancy, just a CPU (atmega162), driving a couple of motors with PWM. In the past, I've used a two-battery design, one for the CPU, one for the motors, to prevent any power spikes or sinks from the motors starting up from frying, or resetting the AVR. (similar to the H-Bridge concept, but brutally simplified). I guess my question is: is there a better solution?

Details: I'm using a nokia 3.7Volt cell-phone battery to power each circuit. This provides more than enough power for my needs, when the drive circuit is seperated from the logic circuit, but is there a way to eliminate this second battery, say with a filter cap, inductor, or whatever? Ideally, I want to merge these two seperate power sources into a single one, even if it means changing up to a more powerful battery...

thanks!
A large, low esr capacitor from vcc to gnd would help a whole lot (along with the standard low esr ceramics on each vcc). You could also put a low resistance inductor between the power source and the power pins of the avr. (ideally keeping the above mentioned caps)

Another possibility would be to use a low drop out linear regulator and put lots of smoothing on the output (as it would be isolated from the power line)

The ideal solution really depends on space and budget constraints. On a recent board, when in a similar predicament, I used a super low resistance 1mh inductor inline with the motor supply line, and then two low esr caps, a 10uf tantalum and a .1uf ceramic, across the power pins of the device.
By SOI_Sentinel
#9978
Here's another suggestion that may work: the Microchip MCP1252-33x50

http://www.microchip.com/stellent/idcpl ... e=en010593

It'll regulate/boost your voltage to either 3.3V or 5V and provide up to 120mA of current. It's rated to work from 2 to 5.5V, easily accomodating your electronics and power supply. You still might need additional line filtering before it (as above), but this will keep everything else ticking along quite nicely.
By Philba
#9986
I've dealt with this issue before. The biggest problem is not back EMF but voltage drop out when the motors draw a lot of current. My mini sumos would work fine until I did a hard reverse and the uC would reset. I was using a 6V battery pack and I could see it drop to around 3V on my scope. I prototyped a solution that worked ok but didn't end up using it because I already had my boards made.

Basically, I had the uC power fed through a decent sized schottky diode (for low drop V 1N5817, iirc) with a fairly beefy capacitor to gnd to buffer the transients. This was then connected to the powersupply of the controller board (basically an LDO Vreg). Seemed to work ok. The diode prevented the motors from pulling down the cap. I think I could have used a much smaller cap if I had used a higher voltage battery pack. I probably would have used an ultra LDO vreg as well to give a bit more headroom.

With a little more sophistication, I'm pretty sure I could use a PMOSFET and a comparator instead of the diode with almost no voltage drop.

Many ways to skin that cat.

Phil
User avatar
By roach
#10005
hoo boy. where to begin...

First, thanks to all of you for your advice. As Philba says, there seem to be many, many ways to solve this issue (as usual). And, as usual, I've run up against the brick wall of my lack of understanding about electronics and electrical engineering.

I guess I need to go back and try to find a primer, or something, to understand the lingo. Can anyone recommend a decent electronics primer/reference? Something that will cover the basics first (like, what the hell is an inductor?)
By Kuroi Kenjin
#10008
Well, I maybe good for this (as I look at my wall of textbooks from my college days which ended only a few months ago). If you're looking for a textbook to read through, try:

Electric Circuits (6th Ed.) by Jame W. Nilsson and Susan A. Riedel.

Power Electronics: Converters, Applications, and Design (3rd Ed) by Mohan, Undeland and Robbins.

You may also want to Google for good powerpoint presentations and so forth. It's much cheaper, but rather time consuming. Then there is always the forum. I know there has got to be other Electrical/Electronics Engineers/Engineering Technicians....etc. who know this stuff.

What sort of experience do you have so far?

And to start out with the "what the hell is an inductor?"...
An inductor is just a coil of wire (usually with a ferrite and/or ceramic core). This device stores energy in the form of a magnetic field. What that does is (through a chunk of Faraday's equations, and the lack of a math font) that it tends to keep current through it constant. If you put a constant voltage across one (don't actually try this), it will ramp up in current at the rate of it's value, until it becomes a dead-short. If you then open the circuit, the inductor will try to keep that current flowing at all costs. It will expend all it's energy, and in doing so, create as much voltage to ionize the air and arc around.

In this case, if you put it in series with the motor, it'll keep the motor from drawing spikes of current (dropping the voltage and reseting the micro). The adverse effect is that the motor will not respond to sudden torque changes as the inductor will try to keep a constant current. (current ~ torque).
User avatar
By roach
#10011
Wow, thanks, Kuroi! (I didn't really expect a response).
Kuroi Kenjin wrote:Then there is always the forum. I know there has got to be other Electrical/Electronics Engineers/Engineering Technicians....etc. who know this stuff.
Oh, I have no doubt that there are a lot of geniuses and engineers hanging around here, but I don't want to pester everyone with my n00b questions. I'm very sensitive to flames...:-)
Kuroi Kenjin wrote:What sort of experience do you have so far?
I come from a computer programming background (java, C, C++, etc), so I'm comfortable with some aspects of these AVR projects (like the programming), but not with others (like BASIC electronics, Ohm's Law, Faraday's equations, etc). Basically, I need to find a way to fill these gaps in my knowledge. I will definitely check out both of the books you mentioned, and if anyone else has any suggested reading or reference material, feel free to give suggestions!
By Philba
#10038
I am a Math/CS guy with a minor in digital EE so a lot of the analog and power stuff is a semi foriegn language to me. I rely a lot on The Art of Electronics - Horowitz and Hill. It starts out very basic and leaves out the esoteric theory while still giving you enough "practical theory" to get you by. I think it's the best electronics book I have seen.

With AoE, I've gotten pretty comfortable with a lot of the basic stuff though there are still gaps I'm filling in.

Frankly, just reading online forums and reading answers has been very instructive to me.
By Kuroi Kenjin
#10040
Well since everyone else is giving out a little background...

I just graduated in December (2005) with a Computer Science Engineering and an Electrical Engineering degrees from The University of Toledo. So I've just been crammed all the theory and stuff. I'm now trying to figure out what some if it means in the real world. Although I've always been pretty hands-on. Most of my studies are right around where software and hardware meet.
User avatar
By roach
#10077
There have been a couple of good suggestions of books for learning basic electronics. What about online resources, such as an electronics Wiki?
By chromatech
#10079
in my EE first year studies I used "Electric Circuits" by Nilson Riedel. Because of a bad prof, I learned nothing from class so this book was what saved me.

I read a few of these 'intro books/first year EE' but this one seems to be the simplest in explainations of components (caps, inductors, resistor, power sources...) and very good at learning how to analyze electric circuits (ohm's law, superposition blah blah blah)

besides that google any term you encounter and you'll find a billion explanations for it
By wheeler
#10133
The Art of Electronics is definitely a useful reference. I would recommend at least checking it out from your local library, and once the late fees get to you, buying it.

As far as online stuff goes - howstuffworks.com can be reasonably helpful. Google is powerful if you use it properly - searches such as "(insert component name here) basics" (without the quotes) can turn up gobs of info.

See inductor basics:
http://www.google.com/search?q=inductor ... S:official