2

I am a beginner in the Arduino world. I made some basic projects of the book that comes with the starter kit (it's was borrowed by a friend of mine) and also I used a humidity, a temperature sensors and a LCD display.

I want to buy an Arduino Uno for measure room temperature, humidity, carbon monoxide, carbon dioxin and maybe a couple more variables. I will to use 4 sensors, 1 buzzer, 1 LCD display and 1 ESP8266 serial WIFI wireless module.

After this work I will add for functionalities but as I have a lot of components I am not sure if the Arduino Uno can supports them because it has a limited quantity of pins.

Do I need an Arduino with more pins? what if I use all these pins and I need more? Can the Arduino Uno be expanded with more pins?

As the Arduino Uno is a very small computer, can its processor support all these components and their operations?

Roby Sottini
  • 448
  • 2
  • 10
  • 23

4 Answers4

3

An Uno has more than enough pins for the devices you described.

  • A DHT22 Relative Humidity and Temperature sensor needs only one digital pin for both variables.
  • An MQ-7 Carbon Monoxide sensor needs one analog pin.
  • An MG-811 Carbon Dioxide sensor needs one analog pin (and an amplifier).
  • A Piezo buzzer needs one PWM pin.
  • The LCD with a Hitachi interface needs four digital pins.
  • The ESP module needs two digital pins.

That's 7 digital pins, one of which needs to be a PWM pin, and 2 analog pins. I did not make any choices about best or cheapest devices, just ones I either knew about or could find quickly by searching. But with this pin requirement doesn't come close to exhausting the available pins on an Uno so there's plenty of capacity left unassigned for you to make other choices that might require different interfaces or more pins.

JRobert
  • 15,407
  • 3
  • 24
  • 51
1

I think you want to know how many sensors 1 Arduino can support. But just in case, I am answering both interpretations of the title of your question:

  1. How many different types of sensors can an Arduino support?:

With the correct software and hardware, the Aruidno can interface with almost any kind of sensor. The exceptions include but are not limited to sensors which produce more data than an Arduino can process (such as a video camera) or sensors that require fast responses (such a time of flight laser distance sensors (LIDAR)).

  1. How many sensors can an Arduino support at the same time?:

This depends on what processor resources are needed. If the sensor needs the ADC there 6 channels on most Arduinos. If you need more, there are hardware solutions. But many here have suggested to simply add a 2nd Arduino.

To specifically address your laundry list:

room temperature

Thermistor connected to ADC. But most are not linear, so you will have to create a look up table.

humidity

I think there is a SPI module on the market to do this.

carbon monoxide

These sensors usually require an amplifier. And change with age & temperature. So a lot of software here as well as hardware.

carbon dioxin

Not sure about this one.

buzzer

Self osculating? Then you only need a logic output.

1 LCD display

Alpha & numeric? Most have 4 or 8 pin Hitachi interfaces. But you can look for a SPI or serial port LCD so as to conserve on Arduino pins.

ESP8266

This is just a serial device. You will need the Ardino's serial port.

I'll leave it up to you to make a detailed assessment of the necessary processor resources. Because you need to first pick out the specific hardware you will be using.

That's half the battle. The other half is verifying the libraries for all these sensors and communication devices will not interfere with one another. That I will leave up to you as it is not an easy task to wade through all the code for all the different libraries you will be using. And, again, until you pick out exactly what sensors and devices you will be using it is impossible to even start analyzing as we wouldn't know which libraries to look at.

st2000
  • 7,513
  • 2
  • 13
  • 19
1

The question itself is a bit broad, but I'll try and provide some insight here.

The number of sensors that can be supported, and the number of pins they require, will depend on what sort of interface they use.

  • If your sensor has an analog interface, you will need an analog input pin for each sensor.
  • If your sensor has an I2C interface, you can have multiple devices sharing the same pins (a bus) provided that they have different I2C addresses (often configurable with jumpers on the device).
  • If your sensor has an SPI interface, you can have multiple devices using the same pins (a bus), except that each will need a chip select PIN connected to a digital I/O pin on your Arduino so that it can 'select' each device.
  • If your sensor has a serial interface, you can generally only have one device.

To add complexity to the problem, you can get expansion modules for the Arduino that will give you extra analog pins or other communication interfaces.

With the long list of sensors you have above, you may also be hard-pressed for program space, as most sensors will need code and/or libraries to interface with them. The Arduinos with more pins (such as the MEGA) also have more program space.

I would encourage you to do some further research on the sensors you want to use, and finding out what interface they use, and what Arduino libraries are available for them. This way, you can fully understand the requirements and limitations of any parts you want to use.

Further reading:

toxicantidote
  • 255
  • 1
  • 7
1

Look at the MUX Shield, I just used one to add 48 Inputs to a MEGA making it capable of having 98 Inputs or Outputs

Brian Moreau
  • 112
  • 3