Shop OBEX P1 Docs P2 Docs Learn Events
12 VDC Automotive world — Parallax Forums

12 VDC Automotive world

blakrapterblakrapter Posts: 38
edited 2006-04-15 15:52 in General Discussion
Hello everyone,

I am looking for a microcontroller for an automotive project I am working on and need suggestions.· I have used a bs2 before, so I would like to stick with it if possible, but I need 12 VDC capabilities.· Here is what I am trying to do:

I have several·actuators that need power supplied to them through relays.· The controller will read simple on/off signals for various limit switches and input buttons to determine which relays to fire, thus turning the actuator(s) on or off.· Its very simple, basically just a·bunch of "if" statements.· The problem I am seeing right now is voltage and current.· Everything is 12 VDC and I will need to trigger relays.· Now, the relays·aren't that current hungry, but I may need to fire several at a time, say a max of 1.5 amps or so total draw at 12 VDC.· How can I step the voltages and currents up/down in order to use a BS2?· I am still working on total number in I/O, but it should be around 20-25.

Thanks

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-04-09 15:11
    You could use a BasicStamp and connect it to a UNL2308 Darlington for moving up to 12volt output to drive small relays.

    One the input side, you can drive opto-isolators with appropriate resistors to keep the LEDs in them from burning out.

    Parallax actually has an industrial setup that has all this isolation and allows you to plug in a BasicStamp. If you are creating a permanent application it may be more worth your while to buy it rather than try to develop everything yourself.

    Go here and take a look at the Stamp PLC [noparse][[/noparse]which requires 18 volts min] and the Stamp Controller Board [noparse][[/noparse]uses 12volts].

    http://www.parallax.com/html_pages/products/industrial/industrial.asp

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 4/9/2006 3:14:51 PM GMT
  • blakrapterblakrapter Posts: 38
    edited 2006-04-10 01:56
    Thanks for the info. It looks like the industial board may be too limiting on I/Os. I did find the prop-1 controller which looks pretty cool. I'd need 2 or three of them, which I don't like, but it does have the necessary conversions. Maybe building something similar on my own, but with a bs2p40? I'd need quite a bit of guidance, but its possible i guess. What do you think?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-10 16:24
    There are many ways of expanding I/O on the BASIC Stamps.· Some are listed in our StampWorks guide.· You can also expand outputs using the DC-16.

    http://www.parallax.com/detail.asp?product_id=31216


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • blakrapterblakrapter Posts: 38
    edited 2006-04-11 00:27
    Chris,

    Thanks for the input. I found the dc-16 while bumping around on the site at work today. It looks interesting. It will handle the higher current loads, correct? I still have to deal with the inputs though, they are going to have to be 12v and stepped down to 5 before they reach the stamp. How difficult is it to setup the opto-isolators Kramer mentioned? What are my other options for stepping the voltage down to a safe 5vdc?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-11 00:37
    Well, for stepping down voltage you can always use a resistor divider or even small voltage regulators to get a safe voltage into the BASIC Stamp.· I recall a buddy of mine using 78L05 regulators for input to a 6502-based automotive controller once.· Dividers are okay except that voltage fluctuates, so I would recommend using a 100K trimmer pot into each input and prior to connecting the inputs adjust them so that during normal operating voltage the output from the tap is at ~2V.· Oh, before I forget, you can also use a transistor as an input, although inherently you're inverting the input.· Of course, the BASIC Stamp makes it easy to see the input non-inverted.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • blakrapterblakrapter Posts: 38
    edited 2006-04-11 01:29
    Chis,

    Thank you again for your reply. Pardon my ignorance in this matter, but it has been quite a while since I took EE classes (I am a mechanical engineer by trade). The voltage regulator seems like the fool proof way to do it, but let me guess, its also more expensive? Where might I find these small regulators?

    As for the pot, I believe I understand you to say I should put a resistor and pot in series and adjust the pot until the output voltage is acceptible? This would probably work since voltage should never drop below 11 volts or so and will not ever exceed 14.4 volts. Why not just a single resistor though? I can see using a pot to figure out the required resistance, but is it necessary for all inputs since they are theoretically all the same?

    The transistor is where I really feel dumb. Can you refresh my memory on them so that I can figure out how a transistor can reduce voltage?

    Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-11 14:59
    Ok,

    ·· With the voltage regulator I mentioned (78L05) that is a TO-92 package.· In other words it's the same size as a 2N2222/2N3904 transistor.· It only needs two small capacitors to function properly and provide a fixed 5V output.· The input voltage can be as high as 35V as long as you're not drawing much from them.· Here's a datasheet from jameco with the Jameco part # as the filename.

    http://www.jameco.com/wcsstore/Jameco/Products/ProdDS/51182.PDF

    ·· When it comes to using a trimmer pot please see Figure 1.· This creates a voltage divider whereas a single resistor does not.· In any event, you need to adjust for just above the threshold voltage to around 4V to allow for some overhead.

    ·· As for the transistor...See Figure two.· When the transistor is not biased (no input signal) the output (collector) will be pulled HIGH by the 10K resistor.· So the BASIC Stamp will see a HIGH on its input.· When the transistor is biased the collector will be pulled LOW and the BASIC Stamp will see a LOW, although you can invert this by doing something like, status = ~IN0.

    ·· Now, the resistor (R1) and the Zener Diode should be chosen based on the transistor you use.· In some rare cases the Zener isn't needed.· I listed it in case you use a 2N3904/2N2222 or similar small signal transistor.· I hope this helps you understand how to bring these higher voltage signals in at a safe level.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 4/11/2006 6:27:14 PM GMT
  • blakrapterblakrapter Posts: 38
    edited 2006-04-12 00:47
    Chris,

    Again, thank you for your patience. I am getting there, but still have a couple of questions. First, I am now trying to decide between the regulator and transistor. Is there any advantage of one over the other?

    After I choose one, I will have to select capacitors, resistors, and/or Zener diodes. How might I size these? I looked at the documentation for both components and did not see anything that would help me choose the extra components. The regulator did have an example circuit for a 5V output at 500 mA that confused me. First, it sounds as if I need to insure i get 500 ma to get 5v out, that may or may not be a problem, but with my luck, it will be. Second, the example had a lot more than just 2 capacitors which confused my simple mind even more... Man I don't see how you EE's and CompE's do it!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-12 01:09
    You might want to read up on Google on some sites that cover basic electronics and the theory behind how the basic components, such as transistors work.· The very first thing that got me started was the Engineer's Notebook from Forest M. Mims III.· Radio Shack also had a 150-in-1 kit (now like 350-in-1) that not only started from basics, but showed a full schematic for each circuit and a complete theory of operation.· I found that to be one of the best things that ever happened to me.· That was 26 years ago!

    The resistor and the Zener (optional) really depend on the base current and VEB (emitter-base voltage) of the transistor.· You don't need to "get" 500mA from the device.· You're driving an input (high-impedence input) to a micrcocontroller.· This will take virtually no current at all.· The Zener would only be there if the transistor has a low VBE and you wanted to clamp it from going above that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • blakrapterblakrapter Posts: 38
    edited 2006-04-12 23:18
    Chris,

    Thanks for the suggesitons for reading material. I will check them out and learn a little more, then come back for some more questions. Thanks for your help!
  • Jim RicheyJim Richey Posts: 82
    edited 2006-04-15 15:52
    When Chris mentioned the Radio Shack" Engineer's Notebook",written by Forest Mimms III,he recommended a most interesting book that will give anyone a great education, in understandable terms.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks, Parallax!
Sign In or Register to comment.