0x0000
Posts: 137
Joined: Tue Aug 27, 2013 8:59 pm

Connecting Sensor that require 4.5 min I/P voltage to GPIO

Tue Dec 24, 2013 1:08 pm

I know that the GPIO pins cannot bear voltage greater than 3.3volts,

but I have this sensor that has operating voltage range from 4.5v to 5.5v.

The sensor must have an input voltage of 4.5volts and it produces o/p voltage of 4.5-5.5 volts.

Can I connect its input pin to the 5v GPIO pin ?

Or, would it work with the input voltage of 3.3volts ?

I am talking about the HC-SR04 sensor here.

User avatar
joan
Posts: 14658
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Tue Dec 24, 2013 1:12 pm

Connect the output to a resistor divider pair to bring the voltage down to a safe value. Google will show how.

Also http://abyz.co.uk/rpi/pigpio/ex_sonar_ranger.html

0x0000
Posts: 137
Joined: Tue Aug 27, 2013 8:59 pm

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Tue Dec 24, 2013 1:22 pm

joan wrote:Connect the output to a resistor divider pair to bring the voltage down to a safe value. Google will show how.

Also http://abyz.co.uk/rpi/pigpio/ex_sonar_ranger.html
you mean,
connect the VCC pin of the sensor to the 5volts pin,
and connect the output pin with the voltage divider circuit to bring down the voltage to 3.3volts. and then connect the output of voltage divider to the GPIO pin ?

User avatar
joan
Posts: 14658
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Tue Dec 24, 2013 1:26 pm

That's right.

LateDev
Posts: 44
Joined: Fri Dec 20, 2013 6:27 pm

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Tue Dec 24, 2013 2:23 pm

0x0000 wrote: but I have this sensor that has operating voltage range from 4.5v to 5.5v.

The sensor must have an input voltage of 4.5volts and it produces o/p voltage of 4.5-5.5 volts.
No it doesn't, 4V5 to 5V is its supply Voltage.

Can you point to where it says it has to have a 4V5 input ?

The input is a TTL level signal with a 10uS pulse to initiate it.
TTL signal level is defined as 0 to 0.8V as low and 2V to VCC as high. Therefore a 10uS pulse direct from the GPIO should trigger this device.
That just leaves the output which is a TTL PWM and there are a variety of ways to reduce the voltage level. A series resistor from the o/p connected to the GPIO pin, and then another resistor from the GPIO to earth acts as a voltage divider.

http://www.elecfreaks.com/store/downloa ... _Guide.pdf
To help where possible, and always to learn.

0x0000
Posts: 137
Joined: Tue Aug 27, 2013 8:59 pm

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Tue Dec 24, 2013 5:01 pm

See the attachment...
Attachments
Untitled.png
Untitled.png (31.18 KiB) Viewed 2641 times

neilf
Posts: 72
Joined: Sun Nov 11, 2012 8:14 am

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Tue Dec 24, 2013 7:28 pm

0x0000 wrote:I know that the GPIO pins cannot bear voltage greater than 3.3volts,
but I have this sensor that has operating voltage range from 4.5v to 5.5v.
The sensor must have an input voltage of 4.5volts and it produces o/p voltage of 4.5-5.5 volts.
Can I connect its input pin to the 5v GPIO pin ?
Or, would it work with the input voltage of 3.3volts ?
I am talking about the HC-SR04 sensor here.
If you buy a US-100 instead of an HC-SR04 it should work OK with the GPIO pins without any voltage conversion.
e.g. http://www.ebay.co.uk/itm/US-100-Ultras ... 3cda011e76
It's not quite as cheap, but I find it seems to have a more stable output - less jitter. It also has a serial control option which might be useful for some users. You need to remove the jumper on the back to enable GPIO-type control, with the jumper in place it enables serial control. It also has automatic temperture compensation on board, which is useful if you need maximum accuracy.

There's a manual for it here
http://www.e-gizmo.com/KIT/images/ultra ... %201r0.pdf
that someone has written.

It might be a pound or two more than the HC-SR04 but it's well worth it.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12585
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Tue Dec 24, 2013 9:20 pm

0x0000 wrote:See the attachment...
The datasheet of the HC-SR04 isn't a proper full datasheet and doesn't list electrical specifications. The given values are only for its power needs. On top of that there are no pictures of the back side of the module with the chip. Rumour is that a EM78P153A is used. If you look its datasheet up, then you will see that it accepts signals lower than 0.8V for a low, and anything higher than 2.0V for a high.

That means that a 3.3VPI output signal will be plenty high for the module, and for the 5V signal from the module into the PI I would use a resistor divider with a 3K3 and a 2K2 resistor.

0x0000
Posts: 137
Joined: Tue Aug 27, 2013 8:59 pm

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Wed Dec 25, 2013 9:17 am

mahjongg wrote:
0x0000 wrote:See the attachment...
The datasheet of the HC-SR04 isn't a proper full datasheet and doesn't list electrical specifications. The given values are only for its power needs. On top of that there are no pictures of the back side of the module with the chip. Rumour is that a EM78P153A is used. If you look its datasheet up, then you will see that it accepts signals lower than 0.8V for a low, and anything higher than 2.0V for a high.

That means that a 3.3VPI output signal will be plenty high for the module, and for the 5V signal from the module into the PI I would use a resistor divider with a 3K3 and a 2K2 resistor.
Thank you very much, I'd look into EM78P153A datasheet right away, and will adjust the VDR resistors values to what you have suggested.

boyoh
Posts: 1399
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Wed Dec 25, 2013 11:14 am

One possible way, you might try dropping
The voltage using two diodes in series
Each dropping . 0.6v. Worth a try
1n4002 1n4002
Sensor O/P 4.5v-----A--(Diode)--K----A-(Diode)-K-----GPIO
0.6v + 0.6v = 1.2v

4.5 - 1.2 = 3.3v
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

LateDev
Posts: 44
Joined: Fri Dec 20, 2013 6:27 pm

Re: Connecting Sensor that require 4.5 min I/P voltage to GP

Thu Dec 26, 2013 1:38 pm

0x0000 wrote:See the attachment...
That tells you the operating Voltage, as in its supply Voltage range, and not the I/P Voltage, which is stated as TTL level.

The O/P just needs a series resistor to the I/P with a bypass resistor from I/P to gnd, thus providing a Voltage divider. Easy enough to work out with Ohms law
To help where possible, and always to learn.

Return to “Beginners”