Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Doing a PIC's Job


  • Please log in to reply
18 replies to this topic

#1 PodexPerfectusSum

PodexPerfectusSum

    New Member

  • Members
  • Pip
  • 9 posts

Posted 02 January 2011 - 09:06 PM

I've been looking for a way to build a NiCd/NiMH charger for a while and I found a guy that did just that. The thing is he's using a PIC16C711 and he wants people to buy his pre-programmed PIC and that's fine and all, but I'm wondering if I could do the same thing with a NetDuino Mini, it's got PWM and analog inputs, as far as I can tell, it does everything that PIC does. I did some looking around on the internet because I'm not sure if the Netduino is a drop-in replacement and as far as I can tell, it's not as simple as I think.

So, if you'd be so kind, have a look at the schematic and tell me if it's possible or if there's a better way.

My ultimate goal here is to be able to use my car's 12V outlet to charge a 1-10 cell NiMH battery pack.

#2 Charles

Charles

    Advanced Member

  • Members
  • PipPipPip
  • 192 posts

Posted 03 January 2011 - 05:21 AM

The problem is the code that processor contains... It's functionality would have to be copied. I am familiar with this project, and I too would like to have an open-source microcontroller for it or something similar. Given that the Netduino is much more powerful than the PIC, I have actually been thinking of creating a class to implement this functionality. Haven't gotten around to it yet as it requires some research into the physical charging process.

#3 Charles

Charles

    Advanced Member

  • Members
  • PipPipPip
  • 192 posts

Posted 03 January 2011 - 05:38 AM

There is some good news though... The circuit appears to use a feedback mechanism to charge the battery. Also, the first thing the power does is pass through a rectifier upon entering the circuit, so the design is not dependent on AC input in and of itself.

You could probably create a DC-DC converter to provide the necessary power. Something like the Meanwell SD-25A-24 should work great -

Meanwell Datasheet

You could connect it to the circuit as-is or, if you haven't built it yet, leave the KBL407 Bridge Rectifier out.

I'm not an electronics professional though... I yield to the rest of the community for other suggestions/confirmation.

#4 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 03 January 2011 - 08:14 AM

So, if you'd be so kind, have a look at the schematic and tell me if it's possible or if there's a better way.

In general, it is possible with Netduino. The left part of the circuit (relative to PIC) is 5V regulated power supply, you can replace it with car 12V (Netduino [Mini] can handle up to 20V, LM317 ~40V). On the right part you'd probably need to adjust 3K3 (R1) and 1K (R2) resistors so Vsense is 3.3V max - it is a simple resistive voltage divider, Vsense = Vbat*R2/(R1 + R2); and you'd also need to provide right current (1R0 and 1K resistors) for your battery pack.

I would strongly recommend checking the manufacturer's datasheet to verify battery charging specifications, to avoid any damage. Additionally, would you consider a specialized charging IC or charger (with adjustable number of cells, charging rate, fast/linear/trickle mode, protection etc.)? Should not be hard to get one for the price of Netduino [Mini]...

#5 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 03 January 2011 - 01:27 PM

One thing to consider is the 20 cell aspect; 20 x 1.2v = 24v, so you'd have to boost your 12v to *at least* 24 volts, probably significantly more. This charger costs $17 and charges up to 15 MiMH cells: http://www.hobbyking...idProduct=11668 This one does up to 27 cells and costs $37: http://www.hobbyking...idProduct=12104 The $17 one is so cheap you could buy it and scavenge things like the display and voltage booster from it and come out ahead of the game.

#6 PodexPerfectusSum

PodexPerfectusSum

    New Member

  • Members
  • Pip
  • 9 posts

Posted 03 January 2011 - 07:28 PM

One thing to consider is the 20 cell aspect; 20 x 1.2v = 24v, so you'd have to boost your 12v to *at least* 24 volts, probably significantly more.

Sorry, that's a typo, I meant 1-10 cells.

#7 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 03 January 2011 - 08:25 PM

Sorry, that's a typo, I meant 1-10 cells.

LOL, well, that does make a difference. Even with 10 cells, though, they might peak as high as 1.5v/cell (or more depending on what you're dealing with), so that's still 15v.

#8 PodexPerfectusSum

PodexPerfectusSum

    New Member

  • Members
  • Pip
  • 9 posts

Posted 07 January 2011 - 03:29 AM

Well, I guess I'm going to give this a try in a couple of days. I'm still trying to think through what he says on his site, and I'm a bit confused, in that nifty flowchart of his that explains when the microcontroller does what, he talks about percentages of C, which he earlier identified as the current capacity of the battery. However, his circuit obviously controls the voltage of the LM317. Very confusing.

#9 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 07 January 2011 - 08:32 AM

However, his circuit obviously controls the voltage of the LM317. Very confusing.

Please have a look at "Operating Principle" chapter in the original article - the microcontroller uses PWM to switch the LM317 on and off (via transistor), so for example 20% duty cycle PWM means LM317 is working only 20% of the time, hence it produces 20% of the current.

#10 PodexPerfectusSum

PodexPerfectusSum

    New Member

  • Members
  • Pip
  • 9 posts

Posted 07 January 2011 - 01:35 PM

ok, I think I get it now. I'll probably read through it a couple more times before I try this, since the first two didn't quite sink in apparently.

#11 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 07 January 2011 - 02:13 PM

Batteries are often rated on their discharge/charge capabilities as multiples of "C". So, for instance, a 2000mah battery might have a discharge rating of 20C and a charge rating of .5C, which means you can discharge it at 40 amps (2000ma * 20) and charge it at 1 amp. Generally higher C batteries are higher quality and more expensive. If you don't mind me asking, what are you doing with this and why no LiPo?

#12 PodexPerfectusSum

PodexPerfectusSum

    New Member

  • Members
  • Pip
  • 9 posts

Posted 07 January 2011 - 08:11 PM

I would strongly recommend checking the manufacturer's datasheet to verify battery charging specifications, to avoid any damage. Additionally, would you consider a specialized charging IC or charger (with adjustable number of cells, charging rate, fast/linear/trickle mode, protection etc.)? Should not be hard to get one for the price of Netduino [Mini]...

I've contacted the battery MFR to find out what their ideal charge process looks like, hopefully I'll hear back soon. I've been looking at charge controller ICs and found the LT1513 on Digi-Key for $9. So far, it sounds like the way to go, I can turn it on/off easily from the netduino and use the netduino's PWM to adjust the current output if I decide I need to, otherwise, it looks like the chip does all that by itself.


If you don't mind me asking, what are you doing with this and why no LiPo?

Well, it's kind of a complicated (and long) answer to a simple question, but since you asked...

I have a shiny new Chevy car that has a stereo system which I can connect an iPod, Zune, USB thumbdrive, or some other MP3 players to and the stereo will read and play those songs. I only own thumb drives so that's what I've been using and I happened to remark to my roommate that it'd be cool to have a storage device that could sync wirelessly to my music library on my PC, as it turns out the Microsoft Zune can sync wirelessly while it's connected to "AC power". The trick then, is how do I switch the Zune between recieving power from the car's USB port and say, the cigarette lighter after I've parked and turned off the car?

The plan I came up with was to use an analog input on a microcontroller to monitor for the stereo being turned off, then switch the Zune to a "dumb" power source so it can sync over wifi. I was going to use a pair of AAs and my MintyBoost to power the Zune while the car's off, but I wanted to use a netduino mini since I have a fair understanding of C# and I'm pretty sure that doesn't run on 3V. I figured I'd just build another boost converter that could get 7V or more for the netduino, but then it occured to me that the car has 12V in it and I wouldn't have to change batteries if I utilized that.

However, Chevy seems to think that it's less annoying to have all the 12V outlets in the car turn off after you open the door, than it is to have a dead battery. I could have the mechanic hack up the wiring harness and make the 12V outlet in the glovebox always hot, but that'd be quite expensive and I don't really want to spend more than $100 on this (my roommate knew I'd been thinking about this since october so he gave me his old Zune after he got a new one for christmas). I started poking around the adafruit store and saw that they sold lipo batteries and charge controllers and started thinking about using that. Of course, in order to power a netduino, I'd need two (unless I used two boost converters), and at that point, I'd have two of everything and it'd cost about $70 just to buy the battery packs and charge controllers from adafruit. I could find a higher voltage pack and companion charger somewhere else, but I also just don't like LiPos.

So I kind of shelved the idea until I was trying to find some AAs that had enough charge to keep my camera running for more than 10 minutes. A year or so ago, I bought 36 NiMH AAs just to prevent this exact situation from happening and that's when it occured to me to use 10 of these guys and that would give me 12V that I could run the netduino and a buck converter from and be pretty happy with that. I wouldn't notice that I'd dedicated 10 batteries to something else because they were losing their charges from lack of use anyway. I'd just need a way to charge them while in the car so I did a google search and found the site in my OP and once I saw the block schematic it dawned on me that I could control his charger with a netduino, but I'm not that good with electronics and decided to find a place where I could ask about using the netduino and found out that companies like Linear Technologies sell single-IC battery charge controllers that basically do everything themselves (but I can still turn them on/off and program their output using the netduino).

I'm sure there's easier ways to do this, but I've got AAs to spare and I can learn how to program a netduino in the process.

#13 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 07 January 2011 - 08:22 PM

Thank you for the explanation!

but I wanted to use a netduino mini since I have a fair understanding of C# and I'm pretty sure that doesn't run on 3V

I think you could get away with 3v on the mini, on the 3.3v pin.

Also, this site I think has a lot of "in car" stuff, like this:
http://www.mini-box....8&category=1264

...which you might think about using with a small lead-acid battery. Just throwing stuff out there.

Good luck with this!

#14 PodexPerfectusSum

PodexPerfectusSum

    New Member

  • Members
  • Pip
  • 9 posts

Posted 07 January 2011 - 08:53 PM

Thank you for the explanation!


I think you could get away with 3v on the mini, on the 3.3v pin.

Also, this site I think has a lot of "in car" stuff, like this:
http://www.mini-box....8&category=1264

...which you might think about using with a small lead-acid battery. Just throwing stuff out there.

Good luck with this!

I used to build wifi hotspots with parts bought from mini-box, it didn't even occur to me to look there. I guess they've increased their product offering since I was last there.

I don't see a 3.3 pin on the mini, I think that's just on the bigger one, and I think that's just a reference for the analog input pins.

#15 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 07 January 2011 - 09:01 PM

ah, sorry, I thought since you could use a 3.3v FTDI cable, you could power it with that. Apparently not!! My mini arrives today, i have 1 hard lesson out of the way!

#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 08 January 2011 - 07:39 AM

ah, sorry, I thought since you could use a 3.3v FTDI cable, you could power it with that. Apparently not!! My mini arrives today, i have 1 hard lesson out of the way!


Many of the 3.3V FTDI cables use 3.3V for communication, but supply 5V power :)

Chris

#17 PodexPerfectusSum

PodexPerfectusSum

    New Member

  • Members
  • Pip
  • 9 posts

Posted 20 January 2011 - 05:44 PM

So, I've been looking over battery charger ICs and I found one that I really like, the trouble is that it's a "thermally-enhanced TSSOP" package which has a pad that needs to get soldered to the circuit board. It also looks very surface-mount and I don't have anything to deal with that. Is there any way to utilize this IC or should I look for something that's easier to use?

#18 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 20 January 2011 - 07:00 PM

So, I've been looking over battery charger ICs and I found one that I really like, the trouble is that it's a "thermally-enhanced TSSOP" package which has a pad that needs to get soldered to the circuit board. It also looks very surface-mount and I don't have anything to deal with that. Is there any way to utilize this IC or should I look for something that's easier to use?

other than the thermal pad, you could hand solder this, i think.

Or use this: http://www.proto-adv...ucts_id=2210234

It has videos and everything!

#19 PodexPerfectusSum

PodexPerfectusSum

    New Member

  • Members
  • Pip
  • 9 posts

Posted 20 January 2011 - 07:38 PM

oh man, I was wondering if I there was a service that does that somewhere. Lucky me, I can just do it myself.




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.