Tach frequency signal converter schematic and board layout, how does it look? - Page 1
Forum section: electronics / projects

author: KNO3-
author_rank: Contributor
timestamp: February 27, 2016, 02:37:17 pm
content: Just wanted to post this to get any opinions/advice on it before I put it together. I started messing with arduinos and atmel stuff last year to build a timer to maintain a battery for something in my car. This is my second project, so I'm somewhat new to electronics. I've learned a lot from tying to build this, its been a lot of fun.The goal was to convert one frequency to another in real time and allow for some adjustment. The input is a 5v variable frequency pulse with about a 20% duty cycle and the output, to keep things simple, will just be a varying frequency square wave.The first one with the attiny85 worked but not perfectly and caused some issues with the car. The schematic was done with TinyCAD before I forced myself to learn eagle. The problem was the pulse didnt have enough power behind it for the optocoupler and it was pulling the voltage down causing problems with other things in the car that relied on the signal. I believed the ECU was putting out a positive pulse that could be read. Since then I've learned a little more about logic circuits and now I believe that the reason there was an issue is the ECU actually pulls down to ground and maybe has a weak pull up resistor, or I was trying to power the opto via pull ups from other devices in the car. I removed the opto and connected it directly with just a resistor, which worked for a short while but seems to have killed the attiny.So the new design will be pulled high so the ECU can pull it low. I also think I was having some issues with noise so the new version has some filtering. The old design also didn't last long before failing, I'm thinking maybe the noise environment killed it. So I've added some stuff to control voltage spikes. I also made sure that the input/output could handle getting connected to 14 volts by mistake. If that happens the resistors should be able to drop 9volts across them without exceeding 1/4W.The new one uses a mini pro with the atmega128p. I ended up deciding to use the premade mini because it has the 78L05, LED, atmega and other parts cheaper than i could build it for. Going from 8Mhz to 16Mhz also seemed to improved the stability of the output as well, I'm even considering swapping the crystal for a 20Mhz to squeeze out a bit more speed. I did the board in eagle but I'm not etching it or having it made, just going to use it to run the traces on protoboard. What do you guys think of the circuit and board layout?

author: HAL-42b
author_rank: Frequent Contributor
timestamp: February 27, 2016, 03:16:44 pm
content: What is the purpose of the optocoupler if you are breaking isolation at the 12V input and the tach out pin?

author: KNO3-
author_rank: Contributor
timestamp: February 27, 2016, 03:21:07 pm
content: Quote from: HAL-42b on February 27, 2016, 03:16:44 pmI wanted to isolate the ECU from the circuit in case something went wrong. I didn't bother on the newer design.

author: KNO3-
author_rank: Contributor
timestamp: February 28, 2016, 12:36:46 pm
content: I'm considering getting rid of the transistor. I put it in there to isolate the output if there was any voltage spikes but with the protection circuit I have I'm thinking that using the output directly like I did before should be fine. I also read that the atmega328p can source/sink 40ma. So with the 500ohm resistor I wont get anywhere near that at 5V and anything over that should flow though the diodes. If there are any spikes on the input/output is there going to be an issues sending them into the 5v power rail? I understand a negative spike will directly to ground and dissipate thought the resistor. A positive spike will send the extra current to all the devices on the 5v rail, and if it exeeds this would it sync to ground though the 78L05? I put a 5V1 zener in there to clamp the rail to 5volts just in case.On the 12V side of things I need to protect against voltage spikes up 200V. I think I have negative spikes covered with the diode and hopefully the inductor and 16v zener can handle the positive spikes. I think a 200v spike because of a load dump would be a rare occurrence but I've read that spikes of 60-80v are not uncommon. This time around I have a scope so I'll actually be able to see whats going on in the car this time.