Serial Data Logger - How to power and schematic feedback - Page 1
Forum section: electronics / projects

author: harnon
author_rank: Regular Contributor
timestamp: February 26, 2012, 12:28:38 am
content: Hi guys,I'm working on a project to try and (ahem) understand serial output from a product we use on one of our test vehicles.I've started on the attached schematic (work in progress as you can see from all the notes) using a couple of voltage regulators, a basic PIC and a MAX232. The brief is to take data output on a DB9 serial connector and write it to an SD card in text files which can be parsed later on a PC. Yeah, there are plenty of implementations of this sort of thing around but I'm trying to learn something hereOriginally I thought this would be wired up to our vehicles 12V system, but the more I think about it, a great feature would be if this could be a "plug and play" device which could be used to troubleshoot various parts of our vehicle without rewiring. This means a battery, and I could clear out soom by ditching the LM317 and moving the PIC to a 5V version. For batteries I'm thinking of just a simple 9V D cell - although they're a bit ugly its also very cheap. (Design priorities are cost, size and weight in order of decreasing importance).Have you guys got any suggestions / thoughts re powering the thing or around the schematic in general?Thanks,Will

author: Unknown
author_rank: Unknown
timestamp: February 26, 2012, 12:56:56 am
content: If the power requirements are low, you could consider parasitic power from the RS-232 handshaking lines, something like inthis schematic. The behavior you'd be relying on is not guaranteed by the RS-232 spec, however, so I would be hesitant to use this for a product that should work with random USB-RS-232 converters which typically ignore about half of the RS-232 spec.In the case of battery power, I would consider a switching power supply for better battery life. You might also consider AA/AAA cells with a boost converter. Running the uC at 5 V might cause trouble with the SD card, which typically expects 3.3 V. There are 3.3 V versions of the MAX232 (eg. MAX3232).

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 26, 2012, 02:33:30 am
content: I'd try to make everything 3.3V and then use 4 AA or 4 AAA batteries and a LDO regulator. If plugging into the car for power isn't a feature you need then your regulator can be just a SOT-223 or maybe even a SOT-23 package since it doesn't look like you're going to need much power.If you want to make plugging into the car an option then you'll have to be careful about which regulator you use and how much power it will dissipate. You probably won't be able to use one of the LDO regulators designed for battery applications since they usually have maximum input voltages less than 12V. You might also have to use something like a DPAK to dissipate the extra power.You might consider a buck regulator if you want to power from either batteries or the car's system.You can use something like Linear Technology's LTC4412 PowerPath controller IC to handle switching between the 12V and battery if you decide to support both. The IC basically works like OR-ing diodes so far as switching between two power sources. Of course, OR-ing diodes might be viable too since you have a fair amount of headroom between the two supplies and 3.3V.

author: harnon
author_rank: Regular Contributor
timestamp: February 26, 2012, 08:13:31 am
content: Quote from: alm on February 26, 2012, 12:56:56 amHmmmm interesting but probably wouldn't work given I could be plugging it into literally anything with serial comms...Quote from: alm on February 26, 2012, 12:56:56 ami hadn't really thought of switching supplies to be honest as I don't really know much about them. I read a few tutorials and they look promising. Would you generally make your own booster and use an smps ic, or just find a boost smps ic? I had a bit of a look for switching regulator is and came across theLM2760which looks good, but is obsolete. Do you have any suggestions for common parts? Something that could handle 1.5 to 4.5 in and pump out 3.3 would be ideal.I wasn't aware of the 3v3 max chip, but that's perfect and removes the need for 5v altogether. I was going to use a basic voltage divider to step the voltage from 5v to 3v3 for the sd card but this removes the need and reduces the component count!Quote from: TerminalJack505 on February 26, 2012, 02:33:30 amYeah, with the max3232 I can get rid of 5v. I already has the lm317 and l7805 as dpak in my pcb... They cost about the same so why notQuoteInteresting... I think just a battery will be fine for the most part as it will not be used for extended periods. (we already have an on board CAN data logger and wireless telemetry, this is more for troubleshooting and adding new nodes to or vehicle network).Thanks for the replies guys!

author: harnon
author_rank: Regular Contributor
timestamp: February 26, 2012, 07:17:01 pm
content: Several hours of (confusing) research later.... What do you guys think about using a single AA battery with an AP1603(datasheet) as the switched regulator IC?I've updated the schematic to reflect this and attached.

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 26, 2012, 08:21:11 pm
content: I'd say that part will work fine.So far as your schematic goes, that looks good. The diode confused me a little at first but I finally noticed the note in the datasheet regarding it. Your label has a typo, it's a 1N5819.Also, the reference board for the AP1603 shows the diode wired-up a little differently...http://www.diodes.com/_files/products_appnote_pdfs/power/sw_reg/ANP_AP1603.pdf...but that probably won't matter.

author: harnon
author_rank: Regular Contributor
timestamp: February 26, 2012, 10:58:34 pm
content: Quote from: TerminalJack505 on February 26, 2012, 08:21:11 pmOh yeah - thanks on the typo! I adjusted the diode to attach to the other pin of the inductor ... so it now matches the reference board you found. Better safe than sorry I suppose. (Teach me to take the datasheet literally!)OK - I think I'm pretty happy with Rev B, just need to check some of the pinouts and see if I can get uni to fund some of it

author: Rufus
author_rank: Super Contributor
timestamp: February 27, 2012, 12:18:05 am
content: Quote from: TerminalJack505 on February 26, 2012, 08:21:11 pmLooks to me like it won't be able to power an SD card from a single cell.

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 27, 2012, 12:25:32 am
content: Quote from: Rufus on February 27, 2012, 12:18:05 amYep, that might be marginal.

author: harnon
author_rank: Regular Contributor
timestamp: February 27, 2012, 06:35:37 pm
content: Quote from: Rufus on February 27, 2012, 12:18:05 amHi Rufus,Thanks... are you able to clarify a little bit (I'm still learning!) For instance are you worried about the battery or the APS1603 power regulator? Rechecking the specs on the power regulator it looks to provide enough power for the SD card and micro...I've seen all sorts of stats around battery discharge rates (Peukert), capacities etc but nothing on the "real" peak instantaneous power of a battery. By my calcs even the crappiest ebay AA cell should last 6-8 hours with the power requirements... On the other hand I've been deliberately vague about my battery inputs (its just a two pin terminal at the moment) so I can plug anything in (i.e. would 2 AA batteries in parallel make a significant difference?). Thanks.

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 27, 2012, 07:03:41 pm
content: I think the concern is that the part is specified for a maximum current of approximately 100 mA with a 1.5V input. See the so-called Steady Stage [sic, lol] Output Current vs. Input Voltage graph in the datasheet. Apparently some SD cards might require 100 mA alone which will eat-up all of your power budget.Two 1.5V batteries in series should work according to the graph. Putting them in parallel won't help since you will still just have 1.5V input. Besides, you will want to factor in the batteries' voltage towards end of life and will probably want to be able to use rechargeable NiMH batteries which are nominally 1.2V.

author: harnon
author_rank: Regular Contributor
timestamp: February 27, 2012, 10:15:04 pm
content: Ah... ok, that "Steady Stage" graph (does that mean the actors are sober?) makes a bit more sense - I thought it was a current thing. From that graph it looks like I should aim for around 2.2V or greater. When I get the parts I'll wire it up with 2 * AAs in series and see what happens.Thanks again!

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 28, 2012, 01:00:03 am
content: Quote from: harnon on February 27, 2012, 10:15:04 pmYou're welcome.Let us know how it turns out.