DEV Community

Ghazi Khan
Ghazi Khan

Posted on

[Question] Which hardware to choose? Arduino or RaspberryPI

Hi All beautiful people,

I want to create a home automation system for my home. I could buy a pre-built service but I always wanted to learn about IoT and this is a use case I can work on.

I don't have knowledge of Hardware, so need you guys to help me select hardware through which I can control lights and fans to start with.

I have read many places about Arduino and Raspberry Pi. People are building some really cool stuff with these.

For coding, I will use NodeJS to create connection and API's

Top comments (9)

Collapse
 
dsthode profile image
Damian Serrano Thode

Your best option is using a microcontroller, that is, an Arduino or better yet an ESP32 or NodeMCU like Yannik_Sc said, because it has a wifi interface.

With this microcontroller and a relay to toggle the lights you can then create network endpoints which are activated via wifi with a standard http request. You could then set-up a raspberry pi as the main gateway to your home automation network with a web frontend made in NodeJS.

Collapse
 
derekenos profile image
Derek Enos

I second the ESP32. I've been programming them using MicroPython to build various IOT / robotics projects. The dev board that I've been using costs $10 USD, with the standalone module costing ~$4 USD.

Collapse
 
gkhan205 profile image
Ghazi Khan

Thank you Damian, You actually cleared my doubt on creating a network and handle it. :)

Collapse
 
edabrito7 profile image
Eduardo Brito

Hi Ghazi.. Arduino and Raspberry have different purposes (Arduino has a microcontroller built-on and Raspberry doesn't). I think you should consider that for Arduino you need a little bit of C knowledge but on the internet there are as many tutorials as you need.. If you want to control light and fans my opinion would be to choose Arduino..

Collapse
 
gkhan205 profile image
Ghazi Khan

Thank you Eduardo. Yes, I want to control lights and fans for now. Maybe I will add more controls in the future. But what I want now in feature is that I should be able to control these switches through the internet.

Collapse
 
edabrito7 profile image
Eduardo Brito

Yes, definitely you can.. there are solutions like ESP8266 with a TCP/IP completed stack and it is very cheap

Thread Thread
 
gkhan205 profile image
Ghazi Khan

Thank you I will check this for sure. :)

Collapse
 
yannik_sc profile image
Yannik_Sc

In general:
Raspberry PI if you want network, parallelism and a more or less known environment (it runs Linux).
If you only need network and "single threaded" applications as well as a small form factor you probably want to use a NodeMCU/ESP.
If you can go completely without networking and you use a serial bus or something like this for communication (if you need it at all) you may choose the Arduino.
However, the ESP and Arduinos are mainly programmed in C/C++ (some also run Lua or Python). You should keep this in mind when you get to your final decision.

For Node.JS however your only choice (as far as I know) is the Pi. But in the end they all can do the same for IoT. Only the available libraries are different on the Raspberry vs Arduino (which includes the ESP and NodeMCU).

Collapse
 
gkhan205 profile image
Ghazi Khan

Thank you for your deep insights into this :). It will surely help me to get prepared for this.

I want to create a system that I can control from the internet as well, so if I'm not at home then also I should be able to control switches.