![]() | ![]() | ![]() |
| | |||||||
| General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion? |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hi there, I want to count the time with a µController (counting the 50 Hz power line freq). For this, I need to turn the sine-wave into a square signal with a schmitt trigger. Now I have no idea what values to use for the hysteresis resistors. I'd have guessed the pre-resistor to be, say 1k, and the feedback-loop resistor 10 Ohms??? Would that work? And btw, can I use the LM 358 (using only one channel), it's the cheapest Op-Amp I've found. I want to use the 6 Volt out from a simple transformer. Will I need a galvanic isolation between the input signal for the Op-Amp and it's power supply?? Sorry for being so unexperienced with Schmitt Triggers... Many thanx | |
| |
| | (permalink) |
| why complicate things, use an npn transistor and a couple of resistors before the capacitive filter in your power supply, and a pull up resistor to your uC supply rail. | |
| |
| | (permalink) |
| Why complicate things with transistors, caps and some resistors? here is a microchip app note that uses just a 5M resistor directly into a PIC pin. http://ww1.microchip.com/downloads/e...tes/00521c.pdf it relies on the internal clamping diodes and low current. If you are using a uC without internal clamping diodes, you can add them externally. Note, none of the above solutions provide isolation. I'd use an AC opto isolator (+ 2 resistors) if that's important to you (and it should be). | |
| |
| | (permalink) |
| If you are using a PIC microcontroller, usually at least one port incorporates a schmitt trigger. (eg. RA,4 on a 16f84). (Check the data sheet for ports marked ST) You need to connect via about 22-33K series resistor to the output of your low voltage (eg. 9v ac supply (before the bridge rectifier) and use a 5v zener and 0.1uf capacitor across the port pin to protect the controller from any voltage above +5v and suppress supply noise. | |
| |
| | (permalink) | |
| Quote:
__________________ I also post at the following sites: http://www.stop-microsoft.org http://www.heated-debates.com Screen name: Aloone_Jonez And http://www.silicontronics.com, same screen name as here. | ||
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| I'll be using an Atmega16 - there is some mention of a Schmitt Trigger in the datasheet, but it doesn't say which pin to use. Can anyone help me with this?? | |
| |
| | (permalink) |
| look at pg 50 and 51 of the atmega16(L) datasheet (doc2466). you will see 2 schematic diagrams that answer your questions. | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| Now here's another idea, but I'm not sure if that would work. I think this could probably create a short circuit along Ground, frying the bridge rectifier, but I'm not sure of that. Please verify this schematic or declare it as rubbish | |
| |
| | (permalink) |
| Here's what you are proposing. see anything odd about it? | |
| |
| | (permalink) |
| Would placing a galvanic isolation (1:1 transformer) before the resistor and the zener-diode help? It should work then, shouldn't it? | |
| |
| | (permalink) |
| The grounds at either side of the rectifier shouldn't be connected, it will short circuit two of the rectifiers!
__________________ I also post at the following sites: http://www.stop-microsoft.org http://www.heated-debates.com Screen name: Aloone_Jonez And http://www.silicontronics.com, same screen name as here. | |
| |
| | (permalink) |
| Yes, I know (at least, I do now). But that's what I mean: If I put a galvanic isolation between those two - the problem should be solved, rite? | |
| |
| | (permalink) |
| since you want to use a bridge (and thus no common ground), use an opto isolator and drive the led from the AC side. The H11AA814 http://www.fairchildsemi.com/ds/H1/H11AA814A.pdf is exactly what you would need - $.49 from mouser. Use a dropping resistor to limit the current to the dual LEDs. the photo transistor collector should be pulled to +V via a 10K resistor and the emitter connected to ground. Take the output from the collector as input to the ATMega. You will see pulses at 120 hz. the top test circuit on page 6 of the datasheet shows the basic hookup. edit: to be clear, connect the LEDs leads to the 2 legs of the transformer output, though the dropping resistor. resistor value is calculated just like you would for a regular LED Last edited by philba; 7th September 2006 at 12:33 AM. | |
| |