Could someone validate my design... - Page 1
Forum section: electronics / projects

author: bcx
author_rank: Newbie
timestamp: November 04, 2013, 09:58:47 am
content: Hi all,I'm hoping someone will be able to offer some advice to a beginner? (all my electronics theory and skills are self-taught!)Long story short, what this circuit does is interface a Mitsubishi cruise control stalk to a VN commodore cruise unit.The Mitsubishi cruise stalk has a resistance for each function - i.e. 3k for resume, 1k for set, 330ohms for cancel, etc. and then output a 12v signal for each function.Basically without going into too much detail about the specifics - voltage of the cruise stalk is read in using a voltage divider (R1) - as said before, each function has a fixed resistance. This makes a 0-5v input that the micro reads. If the ADC value falls between hardcoded values, then it turns pins 24, 25, 26 or 27 on while the ADC value is in range. If it's not in a range, the outputs should be off.U1 is a ATmega8.U2 is a 7805 voltage regu3 is a ULN2003D3 is a 5.1v zener diode.R1 is a 1.2k resistorD2 & D3 are 1n4004Q1 & Q2 are just regular npn transistors like 2n2222J2 is ISCP/Jtag headerJ3 is a pin header for debugging - just to easily connect to the rs232 pins of the micro.other resistors/capacitors, unsure about values yet...Outputs of the ULN2003 (U3) are as follows:Cancel (makes cruise unit think brakes were pressed to cancel)SetResumeon/offStatus LED - BlueStatus LED - RedStatus LED - GreenThe idea of using the ULN2003 is so I can get a 12v signal output from the 5v output of the micro. The status led is a common cathode RGB LED. Micro determines the colour of the LED.Q1 & Q2 are used to read/output the speedo signal into the micro so it can be modified. Input and output is a 12v square wave that changes in frequency as the speed increases (linear). The micro just modifies the frequency.I once upon a time made a version 1 of this circuit (used optocouplers in a similar way that I'm using the uln2003), and it worked (except i discovered that the speedo signal was not the same between vehicles - ended up using Jaycar/silicon chip speed modifier kit). So this time, I'm going to get the micro to modify the speed signal.I guess what I'd like to know is:Would this be OK for use in an automotive system? is there any additional components or protection I’d need?Is there a better way to get a 12v output signal for each function rather than using the uln2003 and resistor?for the speed input (Q2), would this be ok? I'm trying to put the lease amount of load on the speedo circuit of the carwhat’s the point of the capacitors near the crystal? I found this on a few Atmel exampleswould D3/R16 be safe enough to drop the voltages from 12v to 5v for the micro?what are some values for resistors? R1 is 1.2k, but all others I haven’t really worked out what values as I’m not sure the best way of calculatingis there any way of making this circuit smaller? I’m going to get the PCB made double sided, using through hole components... not confident with qfp, smd yetWhat do I do with the unused pins on the micro?If you need any more clarification, please ask. Thanks for your patience! I think I've jumped into the deep end a bit with this.Ps. don't worry about the code on the micro, that's already sorted ;PCheers,Bill

author: KJDS
author_rank: Super Contributor
timestamp: November 04, 2013, 10:20:14 am
content: Automotive is the field that I've done least in, however I do know that the lovely +12V input is one of the most spike ridden supplies available. You need to ensure that your design can withstand +/- 100V spikes on that line.The other issue to cover is what happens if an error occurs on the board and it doesn't release the cruise control. You need to have a failsafe way of ensuring that it is released no matter what goes wrong with your circuit unless you really fancy sitting in a car that is set at 80mph with no override. In the manner of all the best text books, I'll leave that exercise to the reader.

author: bcx
author_rank: Newbie
timestamp: November 04, 2013, 10:29:22 am
content: Thanks for the reply... how do suppress spikes up to 100v?Also, the fail-safe is the brake switch has a 'normally closed' and 'normally open' circuit... so a tap of the brakes will cancel the cruise. My circuit only feeds power into the normally open circuit leaving the other circuit untouched as the fail-safe. But yes, definitely have considered this.Also there is a main switch that kills power to the whole cruise system in easy reach. I've never had to use it in version 1 of this circuit. The code is the same, except will now use interrupts to read the speed signal.

author: dfmischler
author_rank: Frequent Contributor
timestamp: November 04, 2013, 12:53:28 pm
content: Are you kidding? Nobody can validate this design with the information you provided. There is a schematic, but no parts have been identified. I assume there is a PC board, but we don't know what it looks like. There is probably firmware in the thing that looks suspiciously like a microcontroller but we don't know what it does. And there is the "minor" issue of knowing what the input and output signals are supposed to look like.

author: bcx
author_rank: Newbie
timestamp: November 04, 2013, 01:41:00 pm
content: Quote from: dfmischler on November 04, 2013, 12:53:28 pmMy bad, I've updated the first post with some more info.Essentially 0-5v input via adc, output is to turn on 1 of 4 12v outputs.Speedo input needs to accept a 12v squarewavespeedo ouput needs to generate a 12v squarewaveThanks

author: bcx
author_rank: Newbie
timestamp: November 04, 2013, 02:02:03 pm
content: Quote from: Pippy on November 04, 2013, 01:30:58 pmI understand where you're coming from when you say that - however, I'm not changing the way the cruise control works at all. It's merely the way i sending the 'set' or 'resume' signal. The cruise control unit remain unchanged. All the fail-safes that the manufacturer have put in are still in tact - they aren't shown on this schematic - like the dual contact brake switch, clutch switch.As for the experience, back in the day, I studied automotive & automotive electrical (I wanted to be a autoelectrician), but I ended up in another career (IT) and kept electronics and cars as a hobby. I'm able to read automotive wiring diagrams, and fault find wiring problems and other faults. I guess I've never have had a lot to do with the specifics of what makes up these control units from a electronics engineering perspective.A lot of my child hood was playing with Dick Smith's Funway into Electronics, and Intertan's 300-in-1 electronics kit. It's just been a while since I've played with it, plus the circuits pre-date microcontrollers (main focus was analog circuits). As I'm a little bit out of touch with this, I still consider myself a beginner.The software part is all sorted - I normally code in C#, but very fluent in C. I also disassemble and patch ECU ROMs in assembly (specifically Mitsubishi - Hitachi H8 & SuperH) to add features that we never got from factory like live engine tuning, launch control, etcI really do appreciate the concern though... I can definately see how this can be dangerous in the wrong hands. I'm definitely keen to learn, take on board what other think (negative or positive)... Which is why I posted this up on this forum - I thought the ethos of this forum is to exchange ideas and for beginners to learn something