12v to 5v logic

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi folks,

   

Ive got my hands on a wireless remote control, Basically i want to connect the output from the wireless receiver to an input on my PSoC1 microcontroller to control some external devices.

   

Unfortunately the output of the wireless receivers relay is 12volts and the inputs are 5v, my question is can i just use a 5v regulator such as the L7805 and add capacitors to make sure its a stable voltage such as in the diagram below?

   

   

Thanks

0 Likes
18 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

It would be cheaper and less power-consuming to use a voltage-divider consisting of 2 resistors to get an input-voltage between 0 and 5V. The next question could be: where to get the power from to run the PSoC. Since a step-down converter has a better efficiency factor than a 78xx voltage-regulator you may consider to use a switching regulator. Have some googles on that theme.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Its not clear what you are trying to do so -

   

 

   

1) A simple diagram would be helpful.

   

2) Are you tyring to -

   

     a. Power PSOC off a 12 V supply ?

   

     b. Power PSOC with some other supply, and take in 12V and 5 V logic signals

   

         from Receiver into PSOC ?

   

     c. Is receiver relay output a 0, 12V output, or a set of contacts connected to 12 V that

   

         receiver actuates by turning on relay coil

   

 

   

3) You can see a block diagram with labeled voltages would be helpful.

   

 

   

If you are trying to translate a 12 V logic signal to a 5V signal, there are a ton of interface

   

parts, failrchild semi, ON Semi, that will do that job for pennies. In addition they have single gate

   

logic translators that will do that. They feature low drive, low power typically, and short circuit protection.

   

If its a low speed low C interface translation needed then R divider would be fine.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If you are trying to power PSOC from 12V -

   

 

   

1) Linear regulator typically a lot less noisy, so if you are doing precision analog

   

consider this.

   

 

   

2) Switcher can have wider input range, in fact there are parts that will buck or boost depending

   

on input supply, like a battery pack that starts out high (regulator in buck mode) and then drops

   

below desired Vdd (swicthes over to boost mode).

   

 

   

3) TI, National, Micrel, LT, Phillips are just some of the providers. NSC/TI have an online design

   

tool to pick and design and evaluate a designs perfromance. Inclduing BOM generation.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

hi guys,

   

thanks for the replies,

   

Basically I want to interface one of these: http://www.ebay.co.uk/itm/RF-Wireless-Electric-Garage-Gate-Door-Remote-Control-/310412645874?pt=UK_G...

   

with an input on my PSoC 1, the output from the receivers relay is 12vdc far too much for an input on the psoc. i was thinking of bringing the 12v signal down to 5v and then using the 5volt as a logic high.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

So the voltage divider solution with two "R"s is the easiest.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Then a simple R divider should work. You do have to be concerned

   

with power sequencing, eg. get PSOC started up first, then GD opener.

   

If R divider limits total current to < PSOC pin injection current spec you

   

might be able to get away with powering up both devices at once.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 A lot of remotes provides relay contact outputs. ie, Contact close/open during activation.

   

Check if that is the case, if it is then you don't need the voltage divider. 

0 Likes
Anonymous
Not applicable

Hi guys, im not sure if my relay has he microcontroller output, I am still waiting for it to arrive, However I actually have a few of these 5v regulators here now and some capacitors, it would cost me anything to make up a little circuit using the components i suggested, Im short on resistors though. In saying that could I use the setup i suggested. I was also thinking of using a 100uF and a 10uF capacitor instead of the ones listed on the diagram. Speaking of which, is it a good idead to put a filtering/smoothing capacitor across the 5vdc supply connected to ground on the PSoC1 device when i eventually decide to run it on a pcb i make up myself. I was thinking of putting a 0.01uF capacitor across the supply pin and connect it to ground? any ideas, thanks guys

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

On regulator output you should have both a bulk and a .01 or .1 Ceramic. Bulk handles large

   

current switching transients, like driving LEDs or large C loads, and the ceramic takes care of

   

higher freq noise that the high ESR bulk caps cannot. Read your regulator specs, make sure

   

there is no minimum ESR cap specs on the output that aid in stability management.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Hi Dana,

   

thanks for the advice, will try implementing that system

0 Likes
Anonymous
Not applicable

So you received the remote and it is ouputing 12V?

   

Make I know why you need to use a regulator?

   

you can use a resistor divider

   

or

   

a resitor in series with a 3.9V zener diode

0 Likes
Anonymous
Not applicable

hi lleung,

   

its just that i dont have any of these zeners about at the moment, id need to order them in. ive made voltage clamps before, i remeber using a 5v7 zener with a diode in series to drop the voltage down to 5vdc, with a resistor value of 100k, not in that order though

0 Likes
Anonymous
Not applicable

 No matter what you use, just remember to limit the voltage at the input pin lower then the VCC(VDD). 

   

I would not use a 5V7 zener to clamp the input as the input should less then 5V.

   

I woudl also measure the output of your reguatlor first and it should always be lower then the VCC of your PSOC

0 Likes
Anonymous
Not applicable

with the 5v7 i wasnt using the said circuit, ive used 4v7's and 100k resistor to provides some protection to inputs and outputs on the psoc but thats about it, I meant to reply to the other query i had before about the programming, i kind of liked the method you were describing but im a little confused about it, i may revisit it soon, just that ive ben busy, also thanks for your replies very helpful

0 Likes
Anonymous
Not applicable

 welcome

0 Likes
Anonymous
Not applicable

I know what Dana Knight and Bob Marlowe were saying about using simpler methods of implemeting the code based on being a beginner/novice at PSoC but gosh darn ive a good feeling about your code and would stick with it, its just im a little slow at it lol

0 Likes
Anonymous
Not applicable

Pratice makes perfect. I always beleve the best way to learn is to actually do it yourself. 

   

As I point out that the one I suggested still has holes, not perfect, but in the process of implementing the code, he/she would find the holes themselves and this makes the learning more effective. 

   

There was a saying that

   

"it is better to teach one to fish rather then give them the fish."

0 Likes
Anonymous
Not applicable

agreed,

   

will begin looking into in again.

0 Likes