Author Topic: Could someone validate my design...  (Read 2817 times)

0 Members and 1 Guest are viewing this topic.

Offline bcxTopic starter

  • Newbie
  • Posts: 7
  • Country: au
Could someone validate my design...
« on: November 04, 2013, 09:58:47 am »
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 reg
u3 is a ULN2003
D3 is a 5.1v zener diode.
R1 is a 1.2k resistor
D2 & D3 are 1n4004
Q1 & Q2 are just regular npn transistors like 2n2222
J2 is ISCP/Jtag header
J3 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)
  • Set
  • Resume
  • on/off
  • Status LED - Blue
  • Status LED - Red
  • Status LED - Green

The 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 car
  • what’s the point of the capacitors near the crystal? I found this on a few Atmel examples
  • would 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 calculating
  • is 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 yet
  • What 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 ;P

Cheers,
Bill
« Last Edit: November 04, 2013, 02:17:16 pm by bcx »
 

Offline KJDS

  • Super Contributor
  • ***
  • Posts: 2442
  • Country: gb
    • my website holding page
Re: Could someone validate my design...
« Reply #1 on: November 04, 2013, 10:20:14 am »
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.

Offline bcxTopic starter

  • Newbie
  • Posts: 7
  • Country: au
Re: Could someone validate my design...
« Reply #2 on: November 04, 2013, 10:29:22 am »
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.
« Last Edit: November 04, 2013, 10:32:32 am by bcx »
 

Offline dfmischler

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: us
Re: Could someone validate my design...
« Reply #3 on: November 04, 2013, 12:53:28 pm »
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.

« Last Edit: November 04, 2013, 12:58:35 pm by dfmischler »
 

Offline bcxTopic starter

  • Newbie
  • Posts: 7
  • Country: au
Re: Could someone validate my design...
« Reply #4 on: November 04, 2013, 01:41:00 pm »
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.

My 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 squarewave
speedo ouput needs to generate a 12v squarewave

Thanks
 

Offline bcxTopic starter

  • Newbie
  • Posts: 7
  • Country: au
Re: Could someone validate my design...
« Reply #5 on: November 04, 2013, 02:02:03 pm »
Someone that doesn't have way more than a few good years experience in proper electronics and software design playing about with cruise control is not something I'd ever endorse in a million years.

I 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, etc

I 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 :)
« Last Edit: November 04, 2013, 02:15:42 pm by bcx »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf