asmd
Posts: 1
Joined: Tue Feb 11, 2020 1:07 pm

interfacing multiple components with Raspberry pi

Tue Feb 11, 2020 1:11 pm

how to interface an ultrasonic sensor, moisture sensor and gsm module with Raspberry-pi 3 B+ and how to write the program?

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

Re: interfacing multiple components with Raspberry pi

Tue Feb 11, 2020 8:17 pm

asmd wrote:
Tue Feb 11, 2020 1:11 pm
how to interface an ultrasonic sensor, moisture sensor and gsm module with Raspberry-pi 3 B+ and how to write the program?

From BoyOh

Do you understand basic Electronics ?

Do you understand how the Raspberry Pi In /Put & Out/Put's work

The Raspberry Pi is NOT PLUG & PLAY

You have some research to do , It is all at your finger tips

The forum will point you in the right direction , But will not do it all for you
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
neilgl
Posts: 2111
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: interfacing multiple components with Raspberry pi

Tue Feb 11, 2020 11:19 pm

It depends what interfaces the devices use. If they are all SPI or I2C you can have several "slave" devices and pi as "master"
Let us know what devices you have.
e.g. if ultrasonic sensor is HC-SR04 ultrasonic sensor - that can use 2 GPIO not SPI/I2C

PhatFil
Posts: 1672
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: interfacing multiple components with Raspberry pi

Wed Feb 12, 2020 12:21 am

My approach as someone with a s/w only background would be to find basic example projects for each item of hardware you want to exploit and emulate each individually with your pi and h/w to ensure that they all work as expected and to begin to understand how each element works.

Just remember to make things easier on yourself, to select projects that all use the same example scripting language and if python BE VERY MINDFUL of the difference between python 2.x and 3.x

If you discover your examples use conflicting or the same gpio #1 stage will be to edit your code and breadboard set up to change one or more project to use alternative pins or in the case of the i2c bus different addresses.. and start to create a single code file to react with all your h/w.

... Should get you started and well on the way to seeing the way forward, if not return with more Questions,,

Return to “Beginners”