3

At my workplace give away, I found a bunch of sensors for free (sun founders kit). Unfortunately, the box that contains more than 20 sensors did not have a resistor in it.

I wish to connect a few sensors, namely a temperature sensor and a photo resistor; but connecting them to the rasp pi via breadboard without a resistor. Do you think could cause something to blow up in my rasp pi?

I don't want to destroy my rasp pi.

2 Answers 2

5

There are a range of different sensors in those types of kits. Some are relay type sensors (they turn off or on depending on the thing they are sensing). These don't require a resistor and can be connected and used without problem as shown here EDIT: (See below);

enter image description here

Details for how they can be set up and connected can be found here.

Some of the sensors will be analog. These will require a ADC (Analog to Digital Converter. They can be connected as below;

Details for setting those up can be found here.

There may be some digital output sensors (SPI or I2C or 1 wire (I'm not sure)). Those may well require a resistor, but even if they do you shouldn't blow up the Pi by trying them (Make sure you do your research first though).

The key will be to find out which sensors are which and go from there.

EDIT: User @joan correctly points out the the Pi GPIO pins should not be connected to voltage sources above 3.3V. The diagram that I have above has been edited to show the sensor being fed from the 3.3V rail.

2

You will need to look at each sensor in turn.

If the sensor only has analogue outputs you will need additional hardware, an ADC (analogue to digital converter) to use it on the Pi.

If the sensor has digital outputs you may be able to use it on the Pi.

  1. If the output is open collector (also called open drain) you should be able to connect it to a Pi gpio. The sensor will pull the line to ground but let the line float to an external voltage. Normally you'd use a pull-up resistor to 3V3 on the line (the Pi has internal pull-ups which may be software enabled). The gpio connected to the line will normally read 1 but will read 0 when pulled low by the sensor.
  2. If the sensor is powered from 3V3 then its output will (generally) also be 3V3 so may be connected to a Pi gpio.
  3. If the sensor is powered from 5V then its output will (generally) also be 5V so may NOT be connected to a Pi gpio. Instead you would normally use a pair of resistors to form a voltage divider to convert the 5V to 3V3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.