# Connect First Sensor to Breadboard

**URL:** <https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832>\
**Category:** Raspberry Pi\
**Created:** [21 November 2020 11:34 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832 "2020-11-21T11:34:53Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [21 November 2020 11:34 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/1 "2020-11-21T11:34:53Z")

</div>

Hello there,

I have a Raspberry Pi 3 B+ and breadboard. I have also bought the [Soil Temperature/Moisture Sensor - SHT10](https://core-electronics.com.au/soil-temperature-moisture-sensor-sht10.html). How do I learn how to connect this thing up to the breadboard, and then ultimately the RPi?

For a non-electrical person, I’ve looked at the [SHT10 Datasheet](https://cdn-shop.adafruit.com/datasheets/Sensirion_Humidity_SHT1x_Datasheet_V5.pdf), but that did not appear to tell me what wire goes where etc. Are these the instructions:

Four wires: Red = VCC (3-5VDC), Black or Green = Ground, Yellow = Clock, Blue = Data

I should be able to connect this sensor direct to the breadboard and then the RPi right? I don’t need a microcontroller or analogue to digital converter etc.?

Thanks so much.

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [23 November 2020 01:55 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/2 "2020-11-23T01:55:49Z")

</div>

Hi Kirk,

There is a recommended circuit diagram in the datasheet on page 5:  
 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/a/a5290a3544af38569e70fe2556d3f394ed533417.png)

You will need to wire in a pullup resistor between VCC/VDD (Red) and Data (Blue).Note that there has been a slight revision with different wire colours so we need to update our product page (I’ve added it to our todo list). Checkout Adafruit’s product page for the latest information: [https://www.adafruit.com/product/1298](https://www.adafruit.com/product/1298)

Checkout the pinout for a Raspberry Pi to see where to connect this to on a Pi:

> **[I2C at Raspberry Pi GPIO Pinout](https://pinout.xyz/pinout/i2c)**
>
> Raspberry Pi I2C pins

And yes, that’s correct. You’ll be able to power this from the 3.3v rail on the Pi and communicate with it directly using I2C, as per this tutorial:

> **[I2C with Raspberry Pi - Tutorial](https://core-electronics.com.au/tutorials/I2c-with-raspberry-pi.html)**
>
> Hello there, how’s your day been? Good? Fantastic! Not so good? Don’t worry it’s about to get a lot better, because today we’re going to take a look at how to use the I2C interface on our Raspberry Pi to control I2C devices.
> What is this “I2C” you...

Regards,  
Oliver  
Support | Core Electronics

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [24 November 2020 12:09 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/3 "2020-11-24T12:09:49Z")

</div>

Thanks so much @Oliver. Really appreciate the guidance.

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [24 January 2021 22:24 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/4 "2021-01-24T22:24:17Z")

</div>

I’ve now successfully hooked up the temperature and CO2 sensors to my RPi via the breadboard. I connected the 4 wires from the SHT10 to the breadboard into 4 new rows. From my CO2 sensor, I jumpered 4 cables as follows:

1. VDD to Red (VCC)
2. GND to Black (Ground)
3. TX/SCL to Yellow (Clock)
4. RX/SDA to Green (Data)

I then added a 10kOhm resistor - I’m hoping this is right: one end in the row with the Red cable and the other end in the row with the Green cable. Is this correct? Is this now a pullup resistor?

Running `sudo i2cdetect -y 1` shows me the 2 addresses of my other 2 sensors, but not this SHT10.

Have I done something wrong?

Thanks again,  
Kirk.

---

<div class="post-metadata">

**Author:** ![Mitchell](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/mitchell/32/3564_2.png) [@Mitchell](https://forum.core-electronics.com.au/u/Mitchell)\
**Post date:** [24 January 2021 23:46 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/5 "2021-01-24T23:46:16Z")

</div>

Hi Kirk,

That should be correct, there would have been a resistor provided as well. Just elimate issues, have you tried disconnecting your other sensors and running the SHT10 by itself?

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [30 January 2021 13:28 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/6 "2021-01-30T13:28:54Z")

</div>

I have just given that a go now @Mitchell, and no luck. The SHT10 is now directly connected (via the breadboard) to the RPi by itself. I can’t seem to get any value when running `sudo i2cdetect -y 1`. Are there other things I can do to troubleshoot this?

Cheers.

---

<div class="post-metadata">

**Author:** ![Oliver33](https://avatars.discourse-cdn.com/v4/letter/o/a9adbd/32.png) [@Oliver33](https://forum.core-electronics.com.au/u/Oliver33)\
**Post date:** [31 January 2021 01:38 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/7 "2021-01-31T01:38:50Z")

</div>

Can you show us a photo of your wiring?

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [31 January 2021 02:04 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/8 "2021-01-31T02:04:19Z")

</div>

Hi @Oliver33, I hope these photos help. Given that all my wires from the RPi to the breadboard are all black, it will likely be impossible to tell from the photos how I’ve wired it, so here is what I’ve done:

1. GPIO Pin 1 to Red
2. GPIO Pin 9 to Black (Ground)
3. GPIO Pin 5 to Yellow (Clock)
4. GPIO Pin 3 to Green (Data)

I also have the resistor that came in the pack in both the Red and Green rows.

This shows the RPi, my breadboard with the two other sensors (not currently connected), and the SHT10 coloured wires hooked up to the RPi.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/5/5a268573f59412028566290314a2b56ab202273a.jpeg)

A close-up of the breadboard wiring:

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/b/b346ebab85c0c3b3ffa0b292576abbfaebbcbc8e.jpeg)

Top view:

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/4/4c403d51fd3952ce15cfffa81a530a510b472567.jpeg)

Does this help? Do you need a different view perhaps?

Cheers.

---

<div class="post-metadata">

**Author:** ![Oliver33](https://avatars.discourse-cdn.com/v4/letter/o/a9adbd/32.png) [@Oliver33](https://forum.core-electronics.com.au/u/Oliver33)\
**Post date:** [31 January 2021 06:45 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/9 "2021-01-31T06:45:34Z")

</div>

I think everyone in this thread gets some egg on face. This sensor uses the same pinout as I2C, but it’s not I2C compatible - however, you can connect it to I2C without harm or mis-reading.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/9b89bd36de12a4ebe917a4c401c2ef446710ff16.png)

Here’s a python library you can use to read data from the sensor:

> **[Pi-Sht1x](https://pypi.org/project/Pi-Sht1x/)**
>
> Python 3 library for Sensirion SHT1x series of temperature & humidity sensors for the Raspberry Pi.

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [31 January 2021 07:46 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/10 "2021-01-31T07:46:20Z")

</div>

This is a wonderful pick-up @Oliver33. Thanks for this. Hoping not to sound too dumb, but what does this actually mean from the perspective of getting it working? I have been through the I2C tutorials, so I understand what it is, but how do I actually connect then ‘communicate’ with this sensor, given I have 2 others that are working using I2C?

Thanks again.

---

<div class="post-metadata">

**Author:** ![Oliver33](https://avatars.discourse-cdn.com/v4/letter/o/a9adbd/32.png) [@Oliver33](https://forum.core-electronics.com.au/u/Oliver33)\
**Post date:** [31 January 2021 08:36 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/11 "2021-01-31T08:36:20Z")

</div>

If you want to use them simultaneously you have two options:

1. Connect the SHT sensor to a different pair of GPIO pins for its special Clock and Data
2. Write code that switches the mode of the I2C Pins between normal GPIO (for use with the special SHT library) and I2C

The first one’s definitely going to be much easier. Follow the instructions on [this page for installation](https://pypi.org/project/Pi-Sht1x/), then check out the [examples.py](https://github.com/drohm/pi-sht1x#examplespy) example script:

> **[Pi-Sht1x](https://pypi.org/project/Pi-Sht1x/)**
>
> Python 3 library for Sensirion SHT1x series of temperature & humidity sensors for the Raspberry Pi.

If you haven’t done this before, here’s the relevant section from Core’s Pi Beginner’s Workshop:

> **[Raspberry Pi Workshop for Beginners - Tutorial](https://core-electronics.com.au/tutorials/raspberry-pi-workshop-for-beginners.html#ch2)**
>
> Welcome to the Raspberry Pi Workshop for Beginners! Here you'll be able to follow along with our series of bite-sized videos that cover everything you'll need to know to get started with your Raspberry Pi, and start making awesome projects. My name...

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [31 January 2021 10:04 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/12 "2021-01-31T10:04:59Z")

</div>

Thanks again @Oliver33. I don’t want to use them ‘exactly simultaneously’. The intent really was just to read from each sensor say every hour or so. The readings don’t need to be simultaneous, but as long as they’re close in time. So the idea was to simply call each sensor in turn around every hour, so is option 1 still okay or is there a better solution?

Now just whilst I think of it, some of the libraries for the sensors seem to have methods for turning the sensor on / off (i.e., putting it in some sort of rest mode I guess). Is this necessary, or do you simply just keep them ‘on’?

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [1 February 2021 04:54 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/13 "2021-02-01T04:54:20Z")

</div>

> [@Oliver33](#):
>
> I think everyone in this thread gets some egg on face.

😳 😅

Egg on face indeed! Oops, sorry @Kirk!

I’d recommend going with Oliver’s option 1:

> [@Oliver33](#):
>
> 1. Connect the SHT sensor to a different pair of GPIO pins for its special Clock and Data

It’ll be much simpler and easier to set up in practice.

As for sleeping, it depends on the sensor and application. I can see in the sensor datasheet they recommend keeping the sensor in sleep mode for at least 90% of the time to limit self-heating to below 0.1°C - more important for relative humidity readings than temperature readings actually.

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [1 February 2021 05:41 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/14 "2021-02-01T05:41:05Z")

</div>

Excellent. Really appreciate that again @Oliver and @Oliver33.

So just to confirm:

1. I should hook up the other 2 sensors back to how I had them previously (as that was working)?; then
2. Wire up the SHT10 like this:

- GPIO pin 17 (3.3V) to Red
- GPIO pin 25 (Ground) to Black
- GPIO pin 12 (GPIO 18) to Green
- GPIO pin 16 (GPIO 23) to Yellow

And use this Python call to initialise the object:  
` with SHT1x(18, 23, gpio_mode=GPIO.BCM) as sensor: ...`

Is that about right?

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [1 February 2021 06:09 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/15 "2021-02-01T06:09:08Z")

</div>

No worries, and yep, looks right to me 🙂

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [1 February 2021 12:35 UTC](https://forum.core-electronics.com.au/t/connect-first-sensor-to-breadboard/8832/16 "2021-02-01T12:35:58Z")

</div>

We finally got there! All three sensors are now working. Thanks so much for all your assistance @Oliver, @Oliver33 and @Mitchell.

😃 👌
