how to Step down a square signal.

Our weekly LIVE video chat. Every Wednesday at 8pm ET!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
krlos
 
Posts: 10
Joined: Fri Aug 08, 2014 5:37 pm

how to Step down a square signal.

Post by krlos »

Hello!

I want to use a 8V square signal as the input for a flow sensing system (it could be with an Arduino), the problem is that most microcontrollers cannot take input signals over 5V.

The sensor I need to use has an open collector output, and the sensor internal circuitry needs at least 8V to run, so the output is gonna be 8V or more.

The options to step down the square voltage that I have in mind are:
  • A voltage divider.
  • A linear regulator.
  • A buck converter.
I appreciate any recommendation.

Regards.

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: how to Step down a square signal.

Post by adafruit_support_bill »

A voltage divider is the simplest solution and should work well here.

User avatar
paulf8080
 
Posts: 208
Joined: Sat Jan 18, 2014 10:25 pm

Re: how to Step down a square signal.

Post by paulf8080 »

Open collector means the output is either open circuit or switched to ground. There is no 8V out. You use what is called pull up resistor to provide a voltage when the output is open. One end of the resistor goes to the micro controller VCC the other to the signal trace.

EDIT: Duh, I have playing with an ATTiny85 for a long time and I forgot to mention that some micro-controllers have a program option to turn an internal pull-up on GPIO pins that are programmed as inputs.

User avatar
krlos
 
Posts: 10
Joined: Fri Aug 08, 2014 5:37 pm

Re: how to Step down a square signal.

Post by krlos »

Hi PaulF8080!

Thanks for the reply!

Yes some microcontrollers have internal pull up resistances, the thing is that the lowest Vcc can be for the open-collector sensor to work is 8VDC, and the microcontroller I wanna use works at 5VDC...

Regards

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: how to Step down a square signal.

Post by adafruit_support_bill »

But an open collector output means it is not pulled up to VCC when high. It is only pulled down when low. The collector of the output transistor is left 'open' so your processor can pull it up to whatever voltage it needs:

http://en.wikipedia.org/wiki/Open_collector
Image

User avatar
krlos
 
Posts: 10
Joined: Fri Aug 08, 2014 5:37 pm

Re: how to Step down a square signal.

Post by krlos »

Hi adafruit_support_bill

You're totally right, I might have misused the term open collector, here's the info of the sensor I wanna use:

Flow sensor
Square Output
8-24VDC voltage range
The sensor only has two wires

The manufacturer seems not to want to provide info on how to use the sensor without the rest of the equipment they sell, so the file below is as much as I could get from them:

http://www.badgermeter.com/Badger-Files ... 2W-pdf.pdf

The electrical diagram on this files confuses me a little bit.

Thanks for all your replies and help!

Regards

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: how to Step down a square signal.

Post by adafruit_support_bill »

Looks like the voltage across the sensor needs to be at least 8v, so the voltage divider initially suggested should work.

User avatar
paulf8080
 
Posts: 208
Joined: Sat Jan 18, 2014 10:25 pm

Re: how to Step down a square signal.

Post by paulf8080 »

Your app sheet is for connecting to a non-digital PLC. They give a voltage/current model diagram of their bipolar open collector. A bipolar transistor switch is a transistor with back to back diodes, hence the diode drop of .6v. .6v is plenty low enough for a GPIO zero. So my opinion still stands and it is an open collector[note the little box that says switch], All you need is a pull-up. If you really paranoid you can emulate the current sensor schematic by replacing PLC with an opto-isolator.

User avatar
krlos
 
Posts: 10
Joined: Fri Aug 08, 2014 5:37 pm

Re: how to Step down a square signal.

Post by krlos »

Hey PaulF8080, thanks for keeping up with my post, I really appreciate it.

I understand what you mean, specially looking at the diagram you posted before, but this sensor has only tow wires (http://www.rainbird.com/documents/turf/ ... _EN-ES.pdf) , one must be Vcc (VDC), and the other must be ground, so how can that match the diagram you posted before?

Regards

User avatar
paulf8080
 
Posts: 208
Joined: Sat Jan 18, 2014 10:25 pm

Re: how to Step down a square signal.

Post by paulf8080 »

krlos wrote:Hey PaulF8080, thanks for keeping up with my post, I really appreciate it.

I understand what you mean, specially looking at the diagram you posted before, but this sensor has only tow wires (http://www.rainbird.com/documents/turf/ ... _EN-ES.pdf) , one must be Vcc (VDC), and the other must be ground, so how can that match the diagram you posted before?

Regards
I didn't post any diagrams. I am just a bored retired electrical engineer that knows how OC circuits work and has computed pull-up resistor values using thevenin equivalent diagrams, like you posted. I'm thinking the pulse transmitter has something to do with square wave signals, but I have no clue, sorry.

User avatar
krlos
 
Posts: 10
Joined: Fri Aug 08, 2014 5:37 pm

Re: how to Step down a square signal.

Post by krlos »

@PaulF8080: Oh you're right, it was't you who posted the diagram.

Anyway, I think I started this post in the wrong way, I should have:
  • Posted the diagram provided by the manufacturer
  • State that the minimum voltage is 8VDC
  • ask how to connect that with a microprocessor like an arduino...
I think that's a better approach to asking for my problem.

Best regards.

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: how to Step down a square signal.

Post by adafruit_support_bill »

PaulF8080 may well be correct about the internals of the sensor. In that case, a simple pullup to 5v should work and that is easy enough to test.

If the sensor does indeed need a minimum of 8v as stated, then the voltage divider solution is still valid.

User avatar
paulf8080
 
Posts: 208
Joined: Sat Jan 18, 2014 10:25 pm

Re: how to Step down a square signal.

Post by paulf8080 »

@krios: You need to add clauses to your sentences to change it from a statement of fact to an opinion(eg I think, maybe, I suspect etc). You are leading people down the wrong path. I enjoy the ride, though.

I woke up with another opinion. :-) The two wires that come out of the sensor are probably from an AC generator. The pulse transmitter is maybe an AC to square wave converter with an OC output.

See: http://forum.allaboutcircuits.com/threa ... ead.10319/

One reply to that thread is very useful.

Image

User avatar
krlos
 
Posts: 10
Joined: Fri Aug 08, 2014 5:37 pm

Re: how to Step down a square signal.

Post by krlos »

@PaulF8080: Thanks again for your support and the time you're putting into this. Thanks for your suggestion on the clauses. However I don't understand what sentence you refer to, an example might help (By the way, I am not a native speaker, as you may have noticed, nor have I ever been or lived in a place where English is the official language, so excuse any misunderstandings caused by my English level.)

Here's a short description of the operation of the sensor:
http://www.badgermeter.com/Flow-Instrum ... larger.htm

So the output of the sensor is already a square wave whose frequency is proportional to the flow rate of the liquid going through the sensor.

User avatar
paulf8080
 
Posts: 208
Joined: Sat Jan 18, 2014 10:25 pm

Re: how to Step down a square signal.

Post by paulf8080 »

@kiros Your English is spoken like a native so ignore what I said. The fact that your native language is not English makes me jealous.

Since this is a "talk to an engineer" topic, you should know that engineers never stop thinking about better ways to solve a problem. Managers have trouble telling engineers to stop thinking and ship the product.

So here is a much simpler solution with an AC opto-coupler with the collector output:

http://electronics.stackexchange.com/qu ... ptocoupler

Image

The 2K pull-up may be eliminated if the GPIO has a pull- up.

Locked
Please be positive and constructive with your questions and comments.

Return to “Ask an Engineer! VIDEO CHAT (closed)”