Conducting a project but I am having trouble on raspberry pi

Plugging in devices such as LAN adapters, Wi-Fi cards, printers, etc. to Arch Linux ARM.

Conducting a project but I am having trouble on raspberry pi

Postby Maida » Mon Mar 26, 2018 8:21 am

I am conducting a project which needs to use a precise ultrasonic sensor but I am having trouble working it with the raspberry pi. The sensor I’m using is the Senscomp 600 series; the manual isn’t available online but I’ve posted a few relevant pages here. I realize the sensor works on 5V logic but I figured a 3.3V signal would be enough to set the Trig port to logic 1 (as it was enough for another 5V logic sensor I’ve used in the past) and I could simply use a voltage divider to bring the output Echo signal down from 5V to 3.3V. However after connecting the circuit it does not seem to work. The issue could be that the sensor requires a higher Trig voltage (it says +4V in the manual so maybe that’s the minimum), in which case how could I increase my signal voltage? I’m not very familiar with this, but I’ve read of people using a transistor to output a 5V signal using a GPIO pin and the 5V pin.

Alternatively the issue might be my set-up. The manual calls for a pull-up resistor to be established to a 5V power supply, but since the logic is 3.3V for Raspberry Pis, I have the Echo pin pulled up to 3.3V. Here is a diagram of my circuit:
Image

I am pretty new to circuits, but as I understand it, the echo pin with a pull resistor acts like this:.
Image

Switch (in this case the echo pin from the sensor) is open, the MCU (in this case the Raspberry Pi) will read VCC (logic 1), and when the Switch is closed, the MCU will read 0V (logic 0). If this is how it works, pulling up to 3.3V should work perfectly find for the raspberry pi (I think).

Also note that I have the sensor connected to an external 5V power supply and is not drawing power from the raspberry, as is suggested in the manual. The python code I’m using measures the time from when Trig is set to True, to when Echo is measured to be True, then multiplies it by the speed of sound. Any advice on what I could try would be much appreciated. As always, thank you very much!
Maida
 
Posts: 1
Joined: Mon Mar 26, 2018 8:01 am

Re: Conducting a project but I am having trouble on raspberr

Postby summers » Mon Mar 26, 2018 9:26 am

I've used Hall Sensors (5V ish) with the pull up resistor on the sense wire to 3V, and that worked fine. If you look at how pull up resistors work (e.g. the "effective" schematic) then can see that it just pulls the pin up to the voltage that its connected to. So thats for sensor outputs. But for sensor inputs, you'll have to look at the schematic - and see what happens if its fed 3.3V. Its a question of the voltage needed for the sensor to switch, usually it will be below VCC - but you'll need to check where.

Oh yes, on pull up resistors - I usually use more than 5kOhm. need to remember that when the pin is pulled low, the current will flow through the pull up resistor. So 5kOhm at 3.3V will give just under a mA, and thats more than I usually want ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Conducting a project but I am having trouble on raspberr

Postby andre » Wed Mar 28, 2018 11:25 am

I would suggest using level shifters like this https://www.sparkfun.com/products/12009
andre
 
Posts: 68
Joined: Wed Jan 25, 2012 1:39 pm
Location: Eindhoven


Return to Hardware

Who is online

Users browsing this forum: No registered users and 7 guests