Shop OBEX P1 Docs P2 Docs Learn Events
sensing a car high and low 12v signals — Parallax Forums

sensing a car high and low 12v signals

libadmanlibadman Posts: 36
edited 2015-11-04 21:26 in BASIC Stamp
hi everyone, thanks for having me
I am working on the project that requires me to sense 12 volt high and low signals from the vehicle I do not expect the voltage to exceed 12v but there's a possibility it may be up to 15.

I was gonna use a pushbutton and a 5v diode but I read a bunch of Smile about voltage spikes, my car seems to be regulated quite well,

my next idea was to use a 12 volt relay and connected to a 5v power supply and have the relay act as a push button whenever 12 volts was applied to the relay,

and the last idea I thought of is maybe I can use some transistor array to take brake down the signal and send a high/low not thinking this will work workout using excessive parts.

so I guess my final question is how can I safely sense 12v-15v( more on the 12 side than anything, from what I'm getting on my meter the signals are a clean steady 12v) without buying a bunch of parts or having to order stuff online, I have stuff but radioshack is a joke and im in Tampa at the moment so there are no part stores but I have some stuff, I'm looking more for simplicity and safety rather than some big complex circuit. Any ideas? Thanks.

I really would like to reduce the cost of relays I am using in this car, I am pretty much sensing everything I can sense and controlling everything I can control so with that in mind I guess you can imagine how many relays I am already using just to control things, so if I do not have to I rather not use relays for sensing but I will
«1

Comments

  • Maybe a simple voltage divider, possibly 10k and 4.7k resistors.

    signal source-10K-BS2 pin-4.7k-ground

    A 12 volt signal will yield about 3.8 volts to the stamp. At 15 volts the stamp will see 4.8. Both are high enough for the stamp to see a logic one.
    You can also add a diode to the BS2 pin to clamp the voltage to 5v, anode to the pin and cathode to +5 to prevent overvoltage to the pin.
  • Yeah that's my basic concept in option 1 I just did a terrible job at attempting to explain that, the reason I do not want to use the voltage divider is because if the environment ever changes in a negative way or if something goes bad or wrong and the 12v signal becomes less than 12v or more than 15v my application will fail. the likelihood of that happening is about 3% out of 100, but I believe in overkill and over protection.

    For instance the wire I used for this application greatly exceeds the maximum voltage and amperage that would ever be used across the wire

    with that being said I like to say thank you for offering me exactly what I asked for which was a low cost way to do what I need to do,

    how about your insight on this new theory of mine,
    what if the basic step was providing 5 volts via its on board regulator (my version) or otherwise (the Stamp and car has the same originating power source) and I use the negative/low pulses/steady signal that I'm looking for directly to the stamp pin, wouldn't this work for the "low" sensing

    And for obvious reasons this would not work on the high sensing end i.e 12v

    So the car powers the alarm, the alarm sends low signals in various situations, decoding them is not an issue, the stamp should be able to directly sense this using an active low button circuit, and the same should go for other low signals in sensing as long as I provide the power side with 3.5 -5v for the pun to register that low signal.

    hopefully you understood that I know I suck at explaining things. Thanks in advance
  • What I think you are trying to describe is a device (alarm etc.) that provides an open collector output. This is where you provide your own positive voltage through a resistor so that the Basic Stamp can detect the transition from high to low.
    I would shy away from using the BS2 internal regulator for providing the pull-up voltage since it's current capability is rather low. If you have multiple open collector outputs all pulling low at the same time the current draw through the pull-up resistors could become significant.
    To protect the I/O pins make each connection to the Stamp through a 220 or 330 ohm resistor and provide a diode to clamp the inputs to +5 in the event a failure or corrosion places +12 on the circuit.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-05 09:40
    12VDC in an auto is nominal.

    When charging voltages may so up to about 14.2VDC for fast charge and 13.5VDC is reasonable for trickle charge. Your idea of 12-15V range is appropriate. But during the winter, if you are not running the engine, you can expect voltages to swing lower than 12VDC.

    Most of the energy in a voltage spike is at the lower end of voltage, so I use solid-state devices rated at 90VDC and transient suppression for above 30-60 VDC. That means the both the solid-state devices and the transient suppression will survive many more hits.

    If you are looking at voltage regulators, use one's specifically rated for automotive use - Like the LM2940. The LDO, reverse polarity, and other protective features all make your automotive installation easier. A good correct voltage regulator can be central to not having transient problems.

    The clamping transients on an input should be able to survive repeated use. The spikes some from honking the horn, switching to high beams and back to low beams, brake lights, the battery charging, A/C on and off, and so on. Being that these are all on a relatively closed network, automotive can have a lot of spikes -- especially in older cars that did not depend on ECU devices for pollution control.

    You could use CMOS logic that is rated at much higher operating (up to 15VDC) voltages than +5VDC logic. And then to a jump to +5VDC BasicStamp I/O.

    https://en.wikipedia.org/wiki/4000_series.

    Open Collector outputs are very handy for changing to another voltage. Having a +5V relay output to a BS2 may have trouble settling down due to contact bounce.
  • Hal albach

    noted thank you, I think this should work for sensing low signals from the car and alarm, I will look for possible issues with the circuit and see if I can "stress it out" or "make it fail". I did forget about not using the stamp onboard regulator but forgot, as loopy byteloose said the radioshack regulators I have are not sufficient ,stable or reliable enough for using my application, keeping your mind that I want to try to prevent all possible failures as much as I can even though I know I cannot 100% prevent all issues. The output signals can never all be simultaneously low however I appreciate you bringing this to my attention and will adjust my circuit accordingly as if they were all low. As for the circuit 220 ohm or 330 ohm, I'm not being a smart Smile I'm just asking how you got your values and why there's an option for either or, I imagine you estimated a value that I could actually calculate using a certain formula? again I'm not being a smart mouth I just honestly want to know because I don't know. when you speak about clamping and 5 volt diodes, I bought some 5 volt clamping diodes from Radio Shack they are see through with color-code bands on them, could these be the same diode that you may be referring to? Could you provide me with a basic concept circuit? I have already drew up the circuit I believe your suggesting, I'm just interested to see how accurately I was able to interpret your information, and alter it accordingly.


    Loopy byteloose

    1) Thank you for this information I was not aware that under normal conditions the voltage drop below 12 volts( I consider winter to be normal conditions as for it recurs every year and it's something that cannot be avoided)


    2) so you used relays/some other solid state switching device with the load contacts rated at 90vdc? or is that the coil?- If it is the coil I imagine that as a minimum voltage much lower that it reacts to? Am I to assume this is not a device I would find in my autoparts store/radioshack?

    "transient suppression for above 30-60 VDC"= is this a diode? If so is it the same one I would use across the power rails of the solid state device? Are radioshack diodes robust and reliable enough for this application?

    regardless of the questions above I do generally understand the idea of what you are saying about voltage spikes and how it works overall


    3) Noted and apreciated this is a major issue for me finding stable automotive regulators, I did not look up that part but assumed it is a 12v or adjustable regulator, because of the size of the system I am integrating into the car I would feel more comfortable using multiple regulators, I'm looking for a stable 12v and a stable 5v. I will look into your suggestion. I can make this happen without regulators however that's just dirty and I choose not to go such a route

    4)clamping transients on an input= again is this the/a diode that would connect to bs2 to protect the pin? Or is there another component this is referring to? however I do understand that you are saying that this should be sufficient enough to protect the stamp.


    5) I've used logic gates some time ago, so not sure exactly what your referring to, what if I'm not mistaken you're saying use a logic gate that is capable of handling up to 15 volts and can regulate output signals down to 5v signals in to bs2? I have a few logic gates that I got from Radio Shack and other little kits that I may have purchase or came across will these be reliable or I would I need to purchase something more robust


    6) and I agree with you I knew the relay thing will work but I did not feel comfortable about doing it that way I did not know what problems might arise but I figured something might go wrong using a relay as a button long term / permanently. Thank you



    just to clear up what's going on here, I do believe I have a stable enough circuit to sense low signals from the vehicle and alarm now I am looking for a way to sense the hi signals and will investigate the information that I have been given to come up with a more stable solution to the rest my problem, which is to sense the high side 12v

    the power problem that I did not mention however acknowledge I believe is no longer an issue as per the advice of loosely. Use regulator that's more practical in automotive rather than radioshack/run of the mill cheap regulators
  • I apologize I forgot to ask if is it necessary to use a diode across the power rails of a automotive relay? Witout one wouldn't this cause transient issues or at least contribute to them for circuits that are not protected, although all of my devices will be protected and I believe the vehicle has sufficient protection of the devices within the car, I'm using 5v relays to switch power to automotive relays
  • The 220 or 330 ohm resistors are primarily to protect the I/O pins from excessive current draw. Basically it protects the Stamp from inadvertent program errors that might change an input to an output and possibly try and drive +5 from the pin into the ground bus. The resistor value is somewhat arbitrary, not too low so as to not protect, and not too high so as not to interfere with the input level. I imagine that somewhere there might be a white paper on calculating the precise, perfect resistor value but most people on this board usually just go with 220 or 330, which are very common resistor values.
    When I mention a clamping diode I just mean a rectifier diode like a 1N4004 or a Schottky (sp?) diode such as a 1N5819. Connect the anode to the Stamp pin and the cathode to +5. Along with the resistor mentioned earlier the diode will prevent errant higher voltages from reaching the pin and possibly releasing some of the magic smoke from the Stamp.
    I brought up these two safeguards because you have stated that you "want to prevent all possible failures as much as I can..." The resistor and diode are not mandatory, they just add a level of protection.
    As for the automotive relay, I'm not 100% certain but I believe some automotive relays may come with a diode across the coil. Usually those have polarity markings for the coil connections. It certainly would not hurt to add your own
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-05 16:22
    Well, I will try to clear up some of what I said. My comments were pretty general.

    1. The LM2940 regulators come in various voltages - 3.3, 5.0, and higher, including 12VDC.
    www.ti.com/lit/ds/symlink/lm2940-n.pdf

    So you could 'pre-regulate' by including one as a first line of defence == either a 12V or a 9V
    The ones that do not work well in auto are the LM7805, LM7809, LM7812 series. Those were early devices and do not do well with automobiles.

    2. When I do use transistors with automotive 12VDC, I try to get the one's rated at max 90VDC as opposed to ones that are rated at 30VDC. They just have more headroom if spikes do hit them. I'd look for similar rating in solid-state relays and regulators if at all possible. (No I am not talking about relay coils or relay contacts -- only about max voltage tolerance of soild state devices that are exposed to automotive nominal 12VDC that includes transient noise.)

    Transient suppresion brings into play a lot of different devices.

    Some are likely to be one-shot, while others can take repeated hits. I am not sure what I would recommend. In all honesty, I haven't owned an automobile for 30 years, so I don't have my own personal test bench. But what I am thinking is a high wattage 30VDC rated zener diode or paired diodes in opposing directions. There are a lot of excellent specialty products that are designed for this specific job, but buying in small quantity may be impossible. But often a big capacitor before a good linear regulator will knock down everything.

    5. Using logic gates are a handy way to insert a sacraficial device that will fry from a transient rather than damaging the Basic Stamp. In some cases, it can clean up messy signals; such as using a Schmit Trigger. And in other cases, it can be used to jump from a higher voltage logic input to a lower voltage logic input. 'The Art of Electronics, 2ed' as a detailed discussion of all the ways to do level changes.

    ++++++++++
    You keep mentioning relays but I am unclear if you desire to use relays to input a high/low to a BS2 or to use the BS2 to control 12VDC with a relay.

    Controlling a 12VDC relay from the BS@ is okay and there are lots of good automotive relays.

    But I see very little advantage to have a relay contact inputing 5VDC to a BS2. You can do this with serveral other methods that are cleaner, less costly, and will have less problems.

    ++++++++++
    Can you clarify in simple words?

    Are you trying to have the BS2 be aware when the car's 12VDC is up and running? You could easily do this with an optoisolator. One side is an LED fitted with a resistor to tolerate the 14.2VDC peak, and the other side in a light sensitive transitor that will provide the BS2 with a safe and sane, clean single of no more than 5VDC. If anything excessive hits the LED and burns it out, you replace the opto-isolator.
  • Very much informative, after looking at my circuit I do see that 220 ohm and 330 ohm resistors are common and push button circuit, I just wanted to understand how you got the values and why you were using them but I do now, I'm sure it's because I'm not using correct terminology but I think we are on the same page. Will 1n4001 work or only 1n4004 I have both. Here is my interpretation of the circuit

    2976 x 2976 - 1M
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-05 17:32
    Where do the 220ohm and 330ohm resistor values come from?

    The i/o pins of the BasicStamp will only tolerate so much current at 5VDC before burning up, about 25 ma at best. If I novice puts +5VDC of unlimited current on an i/o pin, it burns out.

    So using Ohm's Law 5VDC/220ohms = 22.7 ma

    330 ohms is just a wee bit more conservative. 5VDC/330 = ??? ma

    Can you get a PDF and read to determine what is different between the 1n4001 and 1n4004? Or Google '1n4001 vs. 1n4004'
    http://www.ehow.com/info_8634038_difference-between-1n4004-1n4001.html

    If so, you might be able to figure out the answer for yourself.
    Does that 'low signal from the car' ever go above 5VDC?

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-05 16:50
    www.industrologic.com/autotransients.pdf

    Here is a pretty good white paper on automotive transients. Notice the low voltage conditions that a good automotive LDO takes care of.

    But also be aware that everybody that writes these white papers is selling their own product. Nobody on the internet is going to give you a completely unbiased opinion on how to manage auto transients. Even Wikipedia gets edited by industry.

    https://en.wikipedia.org/wiki/Transient-voltage-suppression_diode

    https://www.vishay.com/docs/88490/tvs.pdf
  • The circuit you drew is not what I had in mind. See Attach

  • Bs2 sense and control everything in car

    The control portion uses relays to "push a button" and control power to accessories, and internal circuits.

    I.e to honk the horn, a relay connects 2 wires and activates the horn(negative terminal to gnd). Now, I could use a transistor to switch but rather isolate the lines. That's why I use relays for switching. Below is a list of things I use relays for. Some switch high othere switch low.

    Horn
    light
    wipers
    blinker
    Hazzards
    provide acessory power
    lock/unlock
    trunk
    defrost
    parking brake simulation for gps/radio
    dome light
    push button start/stop
    sonar backup speaker mute
    reverse lights
    switching bigger relays (automotive/ stay relay)
    Some others-


    Yes I would like to sense if there is accessory power. However a list of other stuff also

    Driver door open
    passage door open
    back doors open
    trunk open
    hood open
    arm signal from alarm
    disarm signal from alarm
    reverse signal
    brake
    parking brake
    trunk
    key sense
    ignition power
    acessory power of car
    acessory power of my system
    aux 1
    aux 2
    aux 3
    aux 4
    lights
    Alarm warn
    -direct sensor interface -
    tilt,
    accelerometer,
    motion sensor (not pir)

    8 of the relays are 5v and are built into a seeed studio shield, but all arent, the shield is fully protected. So my questions are in reference to the relays I have to build circuits for.

    But for sensing using the low signal seems to be no issue, as per the discussion above with Hal.

    I was thinking I could use 12v relays to be activated when power applied (signal-door open, keysense etc.) To the relay, the relay will then act as a button to the stamp safely.

    I was doing it that way to try and save money and use parts that I have.

    I do know about optoisolator but just never really decided to go that route, just preference but I never really buy those parts. But if I did I could use for sensing all signals.

    The regulators you speak of are the exact ones that I possess, the 5 and 12. it sounds like you're saying I could safely use those after I use the automobile regulator to regulate the power, good to know.


    Transistor ok understood, higher rating transistor makes sense, it would suck if one fail. But if there's a spike the transistor would take the hit? Is this for the 12v automotive relays, or my 12v and 5v low power Relays? Because I did not plan to use transistors for the 12v automotive or stay relays, I switch them on and off using smaller 5v relays I understand this might be silly but I am looking for direction, that was my easy solution without buying more parts.

    I'm not sure if I need a special tool to check for spikes but with an advanced meter I only was able to detect 12v on "car regulated" lines but I may be implementing the test wrong or just generally going about it in a wrong way.

    Logic gate, I preferred that none of the parts become sacrificial, this is more of a permanent application. Explination below


    Relays:
    Several 5v relays handles most controlling low power task

    5 automotive relays for controlling high power(not so high like acessory power) but to several direct devices

    2 latching relays allows the car to drive without key in special modes

    5- 12v relays to power automotive relays

    The car is a 2009 kia spectra,

    initially I want my "control center"(where everything is housed) to go in my trunk, however because the guage wire and the amount of it I'm using, I decided to make a shorter runs, I'm in Florida and about three months ago my car flooded with water almost up to the top of the seat, there are a lot of electronic in the car at the time but we're all safe because of the location, since everything is gonna be under the seat I decided to use a waterproof box, this box will have silicone in various places and be sealed, it's not ment(my intention) to repeatedly opened, so point is if 1 relay fails the box will not be opened to fix/troubleshoot it, the damage would need to be significant enough, because of this situation I'm trying to be careful about the parts and in my design I have place several rocker switches and other small independent circuits that will help diagnose the exact reason of a failure and manually override if the circuits permit, also when no power is applied to my system or at normal rest the car remain in "factory state"(as if my circuits were not installed). The wire I used is not at all an issue, btw almost all of the sense and control lines have be ran and tested just not connected for obvious reasons. (Lack of complete circuitry)

    4x bs2's

    1 to control entire network (all other bs2)
    1 for sensing /inputs
    1 controlling /outputs
    1 gprs didicated for communications

    Sorry about how I'm explaining this, I can't seem to focustomize and I've been using my phone for this. Thanks you guys

    I tried to provide a lot of information




  • libadmanlibadman Posts: 36
    edited 2015-11-05 18:09
    You used ohm law got it,
    Will low signal from car ever be more than 5v

    the voltage I'm setting to 5v with a regulator, since it's all apart of the same network that's how Im able to sense the low signals from the car on a 5v level, but if that changes or not depends on the reliability of the regulator, but its exspected not to change.

    I'm not being lazy I figured since we were talking is ask you the difference between the transistors however with one glance I was able to get the answers thank you

    OK Hal got it thank you
  • Well, that is a long list for a BS2. You have only 16 i/o pins. With a Propeller, you would double that to 32 i/o, but everything is done at 3.3VDC. So instead of 4 BS2, you might be able to use one Propeller with some port extension.

    In any event, whatever you use -- do it in stages. It is too much to get all done at one time.

    Sense an open door?
    That seems a job for a hall effect sensor. The only drawback with these is that they are 3 wire items -- they need a ground, a power supply lead, and a sense lead (often open-collector).

    What is a hall effect sensor? It senses a magnetic field. So you glue a tiny magnet somewhere to the door, and the sensor is close to the magnet when the door is closed.

    +++++++++++
    I don't know much about 2009 KIAs, but you may have much of this already set up in an automotive system called CANbus. They works extremely well and is used in many cars, trucks, buses, and even in Airbus for fly by wire.

    Why mess with a good thing?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-06 07:24
    Yep, I thought so. The KIA has CANbus. This may be a bit of a game changer for you as there is already a network in your car that monitors and controls most if not all the systems you desire to tie into.

    If you disturb that, you may significantly affect the value of your car.

    If you use that, you need to use the BS2 or a Propeller in an entirely different way.

    http://www.kiaownersclub.co.uk/forum/canbus_topic9516.html
  • Yes you are correct it is a lot and stages is best, I do have a propeller or 2 but I keep damaging them and have just one or two additional reasons to use 4 bs2's instead of 1 or 2 propellers, I cant seem to conclude not 1 stage because of my issues, the sensing, relays, main brain, the gprs is the only thing I may be able to install but not without the main brain.

    When I say the wire had been ran, that means I have tapped into the sensors already including the door sensors so the car side wiring is almost completely done, minus a few ruins I can't make without a solid plan. But I can use a meter to sense the inputs and relay to test the outputs, all work fine. Undoing the wiring is not an option at this point. It's been ran and secured.

    Any ideas on sensing the 12v inputs

    I don't think I need relays for control because almost all of it is low power except a few, but am happy with using them and not really looking to change that. But I'm open to any ideas
  • Well you surely have my attention, where do I find such a beast and how do I interface with him? I will own this car for life.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-05 19:24
    Well, I still can't be certain if it does or doesn't have CANbus. But wiring a 2009 car to the extent you desire is a huge project. And of course, there are some safety issues involved. It seems a lot of what you would install would be in parallel to the existing circuits for remote control.

    Relays may be best in a car as they don't run hot. Just trying to control 3 amps at 12VDC with solid state can get really hot. Also, automotive relays are designed for all the abuse of being under the hood, near gas and oil, and getting soaked in wet weather. Tried and tested over many years.

    As I said previously, I haven't own a car in over 30 years. And even back then, I don't think I owned anything in a model made past the 1970s. You really need someone with up-to-date info about automotive wiring for your specific KIA and I suspect that means either a local automotive course at a community college or a KIA car owner's club in your area.

    I have completely wired a few 1951-3 Chevy trucks, and a few motorcycles rebuilt from the ground up (like a 1953 Triumph 350cc and BSA Victor 441), but this much newer. All that stuff was before microcontrollers existed.
  • Good catch, there Loopy. If it were me I would stop any further modifications until a lot of research has been done. I'd hate to see a whole car get bricked.
  • Yeah I did have the schematic to my car but they charge by the day and it's exspensive, it took me 2 days yo figure out how to accurately read it as for its the entire car schematic with electrical being a section within it. I must reiterate that I ran the wire already which is gas oil ect resistant and all that good stuff, I am tapping into the existing signals, I have a pretty advance alarm system by viper which I installed myself myself that remotely stars vehicle so it isn't so much of a hassle to do a push button start, the latching relays simply to hold the ignition when the alarm let's go and to release the shift lock solenoid.

    the latching relay handles the bulk of the safety concern when dealing with this wiring job, it is on me to handle the other safety concerns, are used 14 gauge wire that is weather water oil and gas resistance it can heat up to 200 degrees before it starts to melt the plastic that protects it, I use heat shrink tubing black tape and zip ties to secure the wire, and of course my excessive need to protect the circuits in various different ways, fail safes, ect using 10 guage wire in parts of the system, waterproofin. If I'm leaving out a safety concern let me know. I'm looking for any advice
  • I'm so pass research, I wanted to have as less of an impact on the vehicle as I can as far as wiring goes yes although I used over 50 or 60 wires, I have connected them in a very non invasive way and do not use them other than their intended use in the basic operation of the vehicle, the Basic Stamp its only acting as simulation it is not actually controlling voltages or anything else within the car itself that is why all the lines are isolated with relays, think of it as extending a switch or sensor. I'm not sure but my questions only relate to the stability of my system to prevent excessive maintenance, but any advice is helpful.
  • The only thing that I have/will tried into that is not intended operation is the shift lock and maybe the ignition. Which has already been done, I've researched push button aftermarket.
  • So not to sound repetitive, after collecting all this background, is there a better way to sense 12v signals other than using a relay as a button, something affordable and reliable I'm open to any advice not just about this but anythjng.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-06 08:02
    I did a bit of research on the 2009 KIA and it seems that ALL CARS STARTING IN 2008 in the USA may have CANbus or another standard that is similar. That just might be 'a better way to sense and control 12V signals'.

    https://en.wikipedia.org/wiki/Vehicle_bus
    http://www.kia-forums.com/kia-ceed-forum/57144-ceed-can-bus.html

    Hacking into a CANbus automotive control system is very different from a traditional automotive 12VDC wiring scheme. There are multiple microcontrollers on the CANbus that are controlled by codes that the car maker likes to keep propretary (secret) for passenger cars, though they do share the data for big trucks because the Federal government requires such for road safety and vehicle inspection.

    You can set up a Propeller or even a BasicStamp with a CANbus node to snoop the system and display data on laptop or desktop computer. Microchip makes a chipset (the MCP2151 and MCP2551) that allow you to just monitor in listen mode or to participate in an active mode. I would prefer to use a Propeller as it has full duplex serial available -- capturing data to a computer file or watching in real time would be easier.

    So it seems adding 50 or 60 wires is a parallel and an extra layer of wiring that may be unnecessary or excessively complicated if it must be used.

    You likely have an OBD-II port that provides a direct connect to your car's CANbus, but I DO NOT HAVE A WAY OF KNOWING EVERYTHING THAT IS CONNECTED TO YOUR CAR'S CANbus.

    http://connector.pinoutsguide.com/16_pin_car_J1962_OBD_2_special/
    http://pinoutsguide.com/CarElectronics/kia_obd2_diagnostic_pinout.shtml
    Note the pinout specs for the KIA.

    YOU DO NOT HAVE TO CUT into the wiring of the car and do serious physical modification, you just plug into the bus at a provided socket (somewhere under the dash or hood). Nothing gets physically disturbed. You either monitor signals or insert signals to override the control of devices. You can buy an OBD-II plug on Ebay to interface.

    Can it be done successfully? CANbus was designed to prevent hacking. It would be slow going at best. People pay big bucks for a CANbus monitor designed for their specific car. There can be millions of code choices available to choose from. And some forms of CANbus hacking enable auto theft and may be frowned upon by police.

    Gadget Gangster has or used to have a CANbus shield that I believe was intended to work with the Propeller. And there are CANbus shields that are Arduino compatible.

    I even have my own CANbus board that works with both the BS2 and the Propeller, but there is quite a bit to learn if you want to really work with it. I have never used it with auto. My intention was to use it for a home automation and security system.

    https://en.wikipedia.org/wiki/CAN_bus

    +++++++++++
    I do realize this is a huge change in direction from what you have been doing; but if you really want to learn automotive wiring and control, this is where the future lies.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-06 08:00
    The OBM-II seems to also support an ELM327 that seems to be a separate diagnostic bus that may or may not include CANbus. EBay offers a lot of adapters. This might focus only on engine performance.

    http://www.ebay.com/itm/ELM327-Wi-Fi-Bluetooth-Interface-OBD2-II-Car-Auto-Diagnostic-Scanner-Tool-/171941990212?hash=item28088a8f4

    As I mentioned before -- either a local community college automotive course or a KIA owners club may be your best bet for accurate info. The automotive industry went to all this digital technology for better pollution control, better anti-theft, and a 'wow factor'. But they really want you to pay through the nose for any DIY use.
  • libadmanlibadman Posts: 36
    edited 2015-11-06 13:23
    That's awesome, I was not sure that the "canbus" is another name for the onboard computer, I'm am not interested in interfacing that way, as for in my eyes, there is more of a safety concern, the way I inplimented this project greatly reduces the possibility of damage to the car, I did know about the onboard computer, however that computer just flips a bunch of relays in my car (not only relays) and interpret signals, I rather deal with the relays or signals directly to reduce the chance/prevent damage, I do not see it as a good idea to interfere with the normal operation of the car internal computer system in that way, just to reiterate..... THE STAMPS ARE ONLY SIMULATING, and sensing. So even if they (my system or Part of it) fail the only thing that happens is my personal circuits won't work, I can buy more basic Stamps but not so inclined to replace the canbus in a car. The easy way is not always the better although it may seem that way on the surface. I have 2 OBD-II ports, 1 in car, 1 under the hood, they sense some of the same signals and some are different depending on which port you use the one under the hood or inside the car. I have only uses that/those ports to collect speed sense/pulse data which I accurately received, a lot of the sensing I could get from there but I'm not interested in interfacing my car in that way, I rather safely have 40 overkill wires then a 2-3 wire connections that could possibly damage my computer system within the car in the event something were to go wrong, regardless of what happens, with my method the car is protected from my circuits. I know that I may give off the impression of being totally objective but I'm not. So to clear the air, I am aware that cars have a onboard computer to control sense most/everything. I was not aware it was universally called canbus, I am not interested in the least in controlling my car in this way, I do not work on cars, EVER (like a mechanic) this is a personal project, it's not the first or last time I wired/rewired a car but I try and get better each time and impliment new ways to do things, canbus is never an option for me. (Maybe in the far future 2009 is too old, I'm looking to hack newer cars, and yes its frowned upon and voids any and every warranty usally, in fact depending on the way you implement your wiring many companies will not perform work on your car for liability reasons, I am always complimented on the way everything was implemented into my vehicle)

    As part of my RESEARCH before starting this particular project I collected information about how most aftermarket products connect and interface with veichels, and the result is the majority will splice into existing signals or find ways to interface BESIDES that canbus, some aftermarket stuff will plug into that obd obm or whatever its called (diagnostic port) but very few aftermarket products try and interface with it recreationaly mainly only for diagnostics, as I mentioned my alarm is advance and it sense and controls most of this stuff anyway just not all. That point being that a company who success is reliant on the fact that they must safely interface with almost any type of vehicle with a minimum disturbance to the original electrical system, has chosen this type of an interface.
    Some car alarms do directly interface with the CANbus of a car however those are all factory alarms.


    I know that you're only providing me with alternatives and I appreciate that,

    I've heard of a canbus was not sure what it was, when you mentioned it before I did not think you were making reference to the car computer system, I don't know what I thought, I just heard easy. Lol



    Back to my broken record..... any better ideas on sensing high 12v from a car beside my relay idea
  • Exactly what is the purpose of all this data collection? Are you going to have a display panel somewhere on the dashboard to display all this data? That concerns me because it's possibly going to be another distraction to the driver watching the display instead of the road and situations around the vehicle.
  • libadmanlibadman Posts: 36
    edited 2015-11-06 14:42
    Well to keep it simple, it's minor automation

    take actions based upon scenario

    This system does not have a generally accessible user interface, the system can be set to "modes" via text message with a pin and command, there are 4 invisible touch buttons hidden inside the car, that are used for direct interface but again only I know that and you cannot accidentally pushed the buttons.

    if the driver gets in and no passengers get in take this action

    if the driver and front passenger gets in but no back passenger take this action

    if all passengers get in take this action

    If driver and back passage gets in but no front passanger take this action (adult, small kids)
    kids do not sit in the front seat unless they are weight compatible

    my car has a backup sensor in it, but it yells stop stop stop stop sometime it inadvertently reads wrong and yell stop while I'm driving, this can be annoying so automatically the vehicle with disable the speaker that says stop
    but if someone else drives my car I would like that feature reenabled automaticly

    my car has a stereo system that's has a native navigation dvd player sirius radio apps, gyroscope, accelerometer, speed sense and all that other Smile too, point is the radio is not dumb and can tell when the car is moving it requires you to ground the parking brake I would not like my parking brake signal to my radio to be permanently grounded, only when I'm in the car and the reason I would like a grounded is when I'm in the car and driving I cannot do anything on it besides look at the map when my car is moving, unless I'm completely stopped (I can't even change radio stations). you may see it as a distraction but there is no use in having a navigation system that you cannot alter while you are driving, I know it seems like I have a lot going on but I don't use any of it besides and navigation I'm a very safe driver I just like to have my options. a distraction is a distraction regardless of what it is, I've seen people do a lot of crazy stuff in drive and not kill themselves not that I'm suggesting anyone to do crazy stuff and drive, and I've seen a lot of people think and drive and it did not go so well for them, lol

    my vehicle also has TVs built into the Sun visors, and again you may view this as a distraction but I never use them to watch movies or anything even though I could, instead they have a constant feed of my backup camera that way I always can see behind me with just a glance, I always keep the passenger visor tv down and on. those TVs change what they are showing depending on my passengers, if my front passenger is playing a video game they often would like to use that television, my system will only aid in the process with video switching and providing power to these multiple accessories, needless to say there are DVD/sd/usb/av players and televisions built into the headrest of both seats, they have a slew of features that I would like to tap into a control programmatically,

    last but not least I am yet to implement this portion of the program but since so much is going on and I'm already interfacing with so much I figured I would construct a black box type setup for the car and have a propeller or Basic Stamp keep a log of EVERY event that happens in my vehicle and write to an sd and or send in real time over gprs, I guess I don't need to mention how this could help.
    its always been the plan to how's everything in the Marine rated electrical box which I already have


    and the best part to me is controlling my car through text message,
    if I lose my key I can simply text my car to unlock and or start


    I have complete right and control to do so but would not implement the future as in did not connect the wires to do so but I could definitely stop my car from running via text message, the reason I did not wired that up it's because if I could stop it with a text message it could also stop my car by mistake or fault.

    I can control everything from the hazards to which blinker is on I just can't turn anything off as far as something that is physically connected to a switch and turned on in the car again I choose not to bypass the normal operation of the vehicle, my system can only assist in controlling it cannot take complete control or override and it is not my desire to do so

    I can beep the horn via text message web browser whatever

    I can completely take power away from the radio system via text message

    if it rains the wipers will automatically cut on

    the system can sense how many times someone pushes the brake and the duration of each brake, and determine aggressive driving based on algorithm, and give a verbal warning. my GPS system already does this but only for roads it has the speed limit to, which aren't many mainly just highways, and that warning is strictly based on speed threshold

    I spoke of my car being flooded before, at the time I have not wired the windows into my alarm system. if I would have it could have saved my car from flooding, I woke up in the majority of my car was under water already but none had gotten in, I remotely started my vehicle walked over to it and looked inside, i was happy it started, I'm 6'1 and it was at my waist but there is no water inside, if I could have rolled down my windows I could have climbed in through the window and drove my car away and prevented the inside from getting soaked.

    how helpful with all this control be if someone stole my car and how spooked out they would be. Lol


    I almost forgot there is no display the system can respond via horn-siren-text message- or head lights and any combination of them.

    the invisible buttons or not to be used only for emergency situations, more importantly the way that the vehicle was able to tell that I am in it versus another driver is by tapping on the brake and sequence,

    Tap the brake twice and hold the 3rd time, 3 seconds later the car starts in my mode, (during this process my system will disengage the brake shutdown switch to the remote start to give me time to take my foot off of the brake after the vehicle starts) put the key in turn to on position and drive away the remote start will disengage when I hit the break and the key will take over which is already in the on position so the car never shuts off

    alternatively,
    get in drive the car and everything automatically reverts to factory settings, no ground simulation hacked, disable access to the accessories like gaming systems, televisions ect, and upon simple request I can send a text message to reenable those features when im not in the car
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-06 15:23
    Actually, I have no problem with you NOT using the CANbus.

    While it is easy to connect to and you can snoop the activity, that doesn't amount to much. You need the actual code scheme that your car maker uses for your particular make, model, and year. Without that, a wrong code input might do something unexpected -- like fire off an airbag if that is wired into that particular CANbus.

    The added problem is that different makes and models use CANbus differently. More expensive cars and maybe German cars try to use more items tied into it. While lower cost cars might not bother with the added complexity.

    Overall, the scheme is a way to make a Black Box that is harder to hack into.

    The car's 'computer' is just one of several ECUs that connect to CANbus. CANbus is a multi-master broadcast network. But many people talk as if the Engline Control Unit is the is only one computer in the car. Certainly, it is the most complex and requires a serious amount of respect. But you might have another ECU (Electronic Control Unit) for automatic skid control, one for power steering, and one handling shifting within the transmission. A car may easily have as many as 70 or so CANbus nodes with a variety of Electronic Control Units. The problem is all the devices are called ECUs (both the Engine Control Unit and the other Electronic Control Units).

    We are all in the dark about what exactly is going on as the complexity and diversity is intentional to create 'intellectual property' and to keep you dependent on the car's dealership for service.

    +++++
    With all that wiring you have installed, organization is critical to having what you want. So you might pull all the wires into the trunk and provide terminal strips for each and every one of them and keep a record of what's what.

    I prefer the Eurostrips. Each can handle something like 12 wires and has mounting holes between each wire connection. The advantage is that wires are completely surrounded by insullation http://www.galco.com/buy/Altech/40.012

    Here is a more conventional terminal strip. http://www.allelectronics.com/make-a-store/item/ts-210/10-position-dual-row-strip-20-amp/1.html

    From there, you can be creative with your BasicStamps or whatever you desire to use. The biggest problems you might have could be voltage drop from long wire lengths, especially driving 5VDC signals. You may even have to boost signals to get good results.

    Originally many autos were 6VDC, but the cars found that cranking starters pretty much brought the system down to a range where nothing was getting enough power -- so everyone went to the 12VDC system we use today.

    Solid state DC Relays may be the best way to turn items on and off. These will accept from 3 to 32VDC and many can be driven directly from a BasicStamp. Over the years, the device have gotten smaller and smaller. And they can easily handle switch an unregulated range of DC with a minimum of transient suppression. But they may be a bit expensive, shop Digikey and Mouser for ordering in quantity.

    http://www.jameco.com/1/1/730-kf0604d-dc-dc-solid-state-relay-control-voltage-3-32vdc.html


Sign In or Register to comment.