Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Voltage inverter

Status
Not open for further replies.

tristanlee85

New Member
I'm designing a knock sensor citcuit for a car to detect when kncok occurs. Currently, the circuit works as: when there is no knock, the output is 0V. When there is knock, the output is 12V. Now, I would like to keep the current output from the 555 times just as it is now because that activates a LED and a buzzer. Off of the current output, I would like to design a circuit to take the 0V (when there is no knock) and make the output 5V, and when there is knock (12V), take the 12V and output it as 0V. The reason I am doing this is because the device I would like to additionally output to requires a 0V (knock) to 5V (no knock) input where as my current output is 0V (no knock) and 12V (knock).

If you need me to explain anything a little beter, I'd be glad to.
 
Just use an NMOS transistor on the low-side and a pull-up resistor on the high side? The input would be the NMOS gate and the output would be the voltage at the NMOS drain.

+5V -> Resistor -> (D)NMOS(S) -> GND

Input = NMOS Gate
Output = (D)
 
Last edited:
When 0V is going to the gate of the NMOS it is like an open switch where no current flows. THe result is that (assuming no current flows between input and output) there is no current drop across the resistor and the output sees 5V.

But when there is 5V/12V (depending on the NMOS) at the gate, then the NMOS is like a closed switch and current flows. Because current flows and the NMOS resistance is very low compared to the resistor (which should be a high value like 4.7kohms or 10kohms), the current will produce a near 5V drop across the resistor while the transistor basically connects the output to ground (0V).

The resistor should be a high value like 4.7kohms or 10kohms because you don't want it to short circuit the +5V to ground when the NMOS is a closed switch. You just want just enough current to produce the 5V drop across the resistor.
 
Here is what I have right now:

**broken link removed**

At the very top, I've got a LM7805 regulator to regulate the voltage from 12V to 5V. Let me describe this a little more thorough:

Before adding the 5V regulator, I originally had a plain 5V source connecting to R7. The active HIGH circuit that I added is circled in red. If the voltage at "KNOCK INPUT TO MS" is 0V, the voltage at "KNOCK OUTPUT TO MS" is 5V. If the voltage at "KNOCK INPUT TO MS" is 12V, the voltage at "KNOCK OUTPUT TO MS" is 0V. Now, before adding the 5V regulator circuit (in green), this functioned perfectly. Since it wouldn't be very practical to have both a 12V and 5V input to the board, I decided to use the regulator from the 12V source and regulate it to 5V.

In my mind, I don't see where i went wrong. I simulated the circuit with a basic 5V source and it operated just as it is supposed to. Now that I added the 5V regulator, when SW1 is open, my "KNOCK OUTPUT TO MS" is 5V just like it should be. When I close the switch, the voltage goes down to 20mV instead of 0V. If I open the switch, the output is supposed to rise back up to 5V, but with the regulator in the circuit, it doesn't. It still stays at 20mV. After a few seconds of simulating it with SW1 closed, the simulation will fail and Multisim reports and error log that I can't understand.

Can anyone tell me why the 5V regulator is cause this to crash and function improperly?
 
The transistor has a normal saturation voltage of only 20mV when it is turned on.
Your sim thinks a "buzzer" is a short.
 
Ok, I don't understand. The simulation fails even if I don't use the buzzer. If SW1 is closed, it's supposed to simulate knock and the LED is supposed to light up and have an output of 0V. If I leave SW1 closed for too long, then something fails and I get a simulation error. This only happens if I use the voltage regulator in place of a true 5V source. That's what I don't understand.
 
If the pot isn't there then closing SW1 makes the 555's output high until the switch is opened. It can't time-out if the switch is still closed.

I don't know what is wrong with your sim. Maybe it sees that the polarity of C1 and C2 are backwards.
 
The switch is just to test the circuit. The pot is used to adjust the input once it's wired to the car because it may think that normal engine noise is knock when it might not be. So, only the switch is used in my simulation since I really can't simulate knock.

When I close SW1, the output is supposed to go high. When I open the switch, there shouldn't any output at all and the LED should go out, but instead it fails. Does anyone have Multisim that would like the file?
 
Just use a inverter from a 4069 and a voltage divider.
 
tristanlee85 said:
The switch is just to test the circuit. The pot is used to adjust the input once it's wired to the car because it may think that normal engine noise is knock when it might not be. So, only the switch is used in my simulation since I really can't simulate knock.

When I close SW1, the output is supposed to go high. When I open the switch, there shouldn't any output at all and the LED should go out, but instead it fails. Does anyone have Multisim that would like the file?

I would like the file.
 
I've attached the 2 different circuits in the zip file. One schematic has a basic 5V source and runs without errors. The other uses the voltage regulator and I get an error, but I just bet it's a simulation issue.
 

Attachments

  • Knock Sensor Project.zip
    128.3 KB · Views: 112
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top