sahab
Posts: 29
Joined: Wed Jun 15, 2016 4:17 am

Add sensors with a HAT ? [Solved]

Tue Nov 27, 2018 4:03 pm

I have a Pi Zero , to which Google VoiceHat is attached. Possible to add sensors to this setup ? In particular I am looking to add temperature/humidity sensor.

Thanks
Last edited by sahab on Thu Nov 29, 2018 1:38 pm, edited 1 time in total.

DirkS
Posts: 9804
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Add sensors with a HAT ?

Tue Nov 27, 2018 4:15 pm

Yes, no problem. See https://pinout.xyz/pinout/voice_hat for the pins that are in use by the HAT.
I2C, SPI and several GPIO are still free to use
Various pins are broken out on the HAT itself.

User avatar
bensimmo
Posts: 3956
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Add sensors with a HAT ?

Tue Nov 27, 2018 4:15 pm

Which Voicehat, the HAT (full size V1) or the Bonnet (PiZero size V2)?
I don't know the V2 one.
Look up the pinout on the AIY site and see if i2c is still available to connect to. If it is, then yes, you can. Or if V2, then yes you can ,the I2c section and others are on various pins.

sahab
Posts: 29
Joined: Wed Jun 15, 2016 4:17 am

Re: Add sensors with a HAT ?

Wed Nov 28, 2018 10:37 am

Great to know. I have ordered a sensor: DS18B20

Question on using: Found several guides, which only have breadboard diagrams and follow along guides. No even explains adding a 4.7k resistor without breadboard. Like this: https://thepihut.com/blogs/raspberry-pi ... he-ds18b20

Image

Does the 4.7k resistor connects the power and data wires ?

DirkS
Posts: 9804
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Add sensors with a HAT ?

Wed Nov 28, 2018 11:02 am

sahab wrote:
Wed Nov 28, 2018 10:37 am
Does the 4.7k resistor connects the power and data wires ?
Looks like it, doesn't it?
Here's a nice answer: https://arduino.stackexchange.com/a/30824

sahab
Posts: 29
Joined: Wed Jun 15, 2016 4:17 am

Re: Add sensors with a HAT ?

Thu Nov 29, 2018 12:14 pm

DirkS wrote:
Wed Nov 28, 2018 11:02 am
sahab wrote:
Wed Nov 28, 2018 10:37 am
Does the 4.7k resistor connects the power and data wires ?
Looks like it, doesn't it?
Here's a nice answer: https://arduino.stackexchange.com/a/30824
It does look like it. Does it connect like it looks ?

But I am none the wiser even after looking at that link :( . I can't really decipher the following...
The 1-wire bus requires that the control signal be pulled high so the master device can pull it low to ask for data, and the slave device can pull it low to give the data. This allows you to have multiple 1-wire devices on the same "one wire".
Help please

User avatar
bensimmo
Posts: 3956
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Add sensors with a HAT ?

Thu Nov 29, 2018 1:20 pm

You use it.
Between DATA and +ve Voltage. (Often yellow and red)
It does not work without.

sahab
Posts: 29
Joined: Wed Jun 15, 2016 4:17 am

Re: Add sensors with a HAT ?

Thu Nov 29, 2018 1:37 pm

Thanks @bensimmo for confirming that the resistor connects the data wire and the power wire.

btw this link - https://wp.josh.com/2014/06/23/no-exter ... mp-sensor/ shows how it can work without the 4.7k resistor. Apparently some processors "built-in internal pull-ups on the I/O pins that can be enabled via software." The Link shows how to enable in arduino. I can't find anything for the pi though. Not in a mood to do research.. but I don't have a 4.7k resistor handy...

Solved issue. thanks

sahab
Posts: 29
Joined: Wed Jun 15, 2016 4:17 am

Re: Add sensors with a HAT ? [Solved]

Sun Dec 16, 2018 6:09 pm

This is super late. But I finally have it working :) . 18 C here in my room in delhi. online shows 12C


Some info for others:

Exact pin layout for AIY (version 1) is on this page: https://aiyprojects.withgoogle.com/voice-v1/ . I used GPIO04 (yellow) for the data cable. GND (black) and 3.3 (Orange) for power. 3.3 and GND are located in the middle topish. I don't know if other GND 3.3 pins can be used.

Resistor position: As simple as connecting the power and data cable with the resistor. One end of resistor to each wire. Make sure to NOT CONNECT both ends of resistor to any one wire (oops).

In hindsight, learning the breadboard would have been wiser and instead of starting this thread, as breadboard design is super duper trivial. And after knowing how a breadboard works, would have understood those diagrams . Lesson learned.

Return to “HATs and other add-ons”