Arduino vs Raspberry pi

Hello guys, sorry to disturb you all... is there any expert in arduino or raspberry pi here please. I want to get started with IoT (internet of things), I want to have my own server (I saw someone on youtube creating his own server using only his rasbperry pi).... I don't really know what's the difference between an arduino or a rasbperry pi... would really appreciate if someone can just give me an overview and if someone can recommend me what to have to build my own server and just get started with IoT, will really appreciate :c
81 Replies
ἔρως
ἔρως3d ago
well, depends on which arduino and raspberry pi
Jochem
Jochem3d ago
a raspberry pi is really nothing more than a PC, just smaller. It runs a regular operating system (almost always a flavor of linux), supports USB peripherals, wifi, ethernet, bluetooth, has video and audio out, runs at gigahertz speeds, has gigs of ram, the ability to run pretty much any programming language known to man, and even just be used as a low-end desktop computer. An Arduino is a microcontroller. It's a much, much more basic circuit that runs at megahertz speeds, has kilobytes of memory, and zero built-in peripherals. You program it with a C-like language (there's micropython too, but it's usually too slow for actual arduinos I think), but your code will be the only thing that runs on it. There's no OS. You also don't get wifi or networking or many other things you get for "free" with a raspberry pi
ἔρως
ἔρως3d ago
there's also the raspberry pi pico, which is closer to an arduino but also very different
Jochem
Jochem3d ago
yeah, a pi pico is a micro controller, not a single board computer (sometimes refered to as an SBC) like the other raspberry pis
Faker
FakerOP3d ago
hmm can we have some sort of "universal" device that does the same thing as a raspberry pi and and arduino instead of needing them both? My primarily I want to set up a server so I guess I need to go with the raspberry pi
Jochem
Jochem3d ago
there's also tons of other SBCs like orangepis and a bunch of others
ἔρως
ἔρως3d ago
banana pi too and there's so many
Jochem
Jochem3d ago
a pi also has GPIO, so a pi can do most things an arduino can
Faker
FakerOP3d ago
I literally have 0 knowledge on them right now 😭 but I guess I should do some research them came back
ἔρως
ἔρως3d ago
there's also the "clones" that use rockchip chips
Faker
FakerOP3d ago
will just do some research and came back
ἔρως
ἔρως3d ago
what exactly do you want to do? or what sort of project?
Faker
FakerOP3d ago
set up my own server host my own thing
ἔρως
ἔρως3d ago
do you want to control anything?
Faker
FakerOP3d ago
I saw that on youtube, it's seem fascinating
ἔρως
ἔρως3d ago
a tiny screen? sensors? something?
Faker
FakerOP3d ago
euh
Jochem
Jochem3d ago
that is 100% something an arduino can't (practically) do. But also, if you want to run your own server, it's cheaper to just use any old PC or laptop you have laying around
Faker
FakerOP3d ago
I don't think so oh ok
ἔρως
ἔρως3d ago
then use a virtual machine or a pi zero 2 w with headers it's cheap af or look for it's clones
Faker
FakerOP3d ago
Ok ok will just have a look at what you guys mentioned and came back. What I wanted to do is, I had a project for uni, the thing is my friends and I have to use our database which was SQL Server. But the thing is, we don't have a cloud db for that, so each one of us need to run their local instance. What I wanted to do is create my own "local" sql server where my friend and I could work together. This is where someone recommend me to use a raspberry pi
Jochem
Jochem3d ago
if you want to run Microsoft SQL Server, you'll need windows, which won't run on a pi
Faker
FakerOP3d ago
ah ok that sucks 😭
Jochem
Jochem3d ago
if you want to run something like mariadb or mysql or postgres, it'll run on a pi just fine
ἔρως
ἔρως3d ago
yeah, and windows on pi has been outdated for a while
Faker
FakerOP3d ago
their is no way I can create a local server for the sql server ? using another technology ?
ἔρως
ἔρως3d ago
and honestly, it's almost perfect for showcasing something tiny
Jochem
Jochem3d ago
I'd just not bother with windows on pi, cause the license you'd have to buy to run windows is much more expensive than the hardware are you set on MS SQL Server?
ἔρως
ἔρως3d ago
it also runs like crap, so
Jochem
Jochem3d ago
or is something like mariadb or mysql fine too?
Faker
FakerOP3d ago
euh I needed to use MS SQL but the project is over now xd but just to have the knowledge I wanted to try it out
Jochem
Jochem3d ago
then your best option for MS SQL Server is to grab an old PC or laptop and use that
Faker
FakerOP3d ago
Alright, noted !
ἔρως
ἔρως3d ago
the knowledge of ms sql isn't transferable for others, by the way
Jochem
Jochem3d ago
eeehhhhh... it's still SQL
Faker
FakerOP3d ago
yeah it's just a dialect, I guess
ἔρως
ἔρως3d ago
yeah, but the install process and everything is 100% not translatable to others
Jochem
Jochem3d ago
it's a little different to query. Management is very different. But using MS SQL Server isn't significantly different than using Postgres
ἔρως
ἔρως3d ago
just the sql is transferable user management and everything is so different
Faker
FakerOP3d ago
Thanks for the advice guys, will just read a bit more then decide on what I will do, ty !!
13eck
13eck3d ago
A bit late to the convo, but if you're not dead-set on using SQL Server you could switch to SQLite, which is a perfect fit for something like a Pi. It's still SQL, so your SQL Server knowledge is transferrable, and being SQLite it's super easy (barely an inconvinence!) to transfer the data from one machine to another—it's just a file! Copy and paste and you're set to go.
Faker
FakerOP3d ago
heard a lot about SQLite, I should try to give it a go
ἔρως
ἔρως3d ago
you should it's actually really awesome
Faker
FakerOP3d ago
DB like SQLite is for small project, like personal projects, no ?
ἔρως
ἔρως3d ago
https://sqliteonline.com/ <-- you can try it on websites like this it's a serious database
13eck
13eck3d ago
In my opinion, SQLite should be your default, go-to database
ἔρως
ἔρως3d ago
over 10 years ago it could handle about 100000 unique visitors
Faker
FakerOP3d ago
oh ok
13eck
13eck3d ago
Sure it doesn't do multi-threading. Sure it doesn't do distributed. But until you actually need those things it just flies.
Faker
FakerOP3d ago
I thought it was something like mongoDB where we would use it just for something really small
ἔρως
ἔρως3d ago
no, no it's a real full blown sql database
13eck
13eck3d ago
"Really small"? No, "really medium-big"
Faker
FakerOP3d ago
yep, I have some free time right now, will give it a try, thanks guys 💯
ἔρως
ἔρως3d ago
i recommend that you put the file in a separated folder, on it's own, as it may need to write temporary files there
13eck
13eck3d ago
From a blog written in 2023. Over 500k writes per sec and over 1m reads per second. That's not "small" by any streatch of the imagination.
No description
ἔρως
ἔρως3d ago
sqlite is used in many many things android uses it
13eck
13eck3d ago
Chrome uses it
ἔρως
ἔρως3d ago
firefox uses it as well i think it is used in aviation too
13eck
13eck3d ago
It's literally the most used database in the world. Though we're getting a bit off-topic here as this question was originally about Arduino vs RPi :p
ἔρως
ἔρως3d ago
it was about that to host a database and hey, if someone compiled a version of the client for arduino, with an sdcard reader, it can do sqlite
Faker
FakerOP3d ago
hmm I when creating tables? or the databases itself ?
ἔρως
ἔρως3d ago
the database is a single file
13eck
13eck3d ago
The database itself is a …damnit Epic :p
ἔρως
ἔρως3d ago
🤣
13eck
13eck3d ago
Well, to be fair, you can have as many database files as you want. If it makes sense to divide the data into multiple files you can (but if you need to read/write to multiple files then just have one)
Faker
FakerOP3d ago
I just changed my mindset on SQLite, I never thought it was used such extensively
ἔρως
ἔρως3d ago
it is
13eck
13eck3d ago
For example, say you have a Discord bot that has specific settings for each server it's in. You could easily have one db file per server since they're not directly related to each other. That way if a server removes your bot it's a simple "delete server file" to remove that data
Faker
FakerOP3d ago
yeah I see
13eck
13eck3d ago
But you wouldn't have a seperate db file for the user table and one for the orders table in an online store DB. You'll be cross-referencing them together all the time. One file for that
Faker
FakerOP3d ago
yep true
ἔρως
ἔρως3d ago
also, highly sensitive data could be stored in multiple files in multiple directories (to avoid temporary files being used by accident)
13eck
13eck3d ago
-# am very passionate about SQLite, can you tell? lol
ἔρως
ἔρως3d ago
you can have a completely different database file for the backend if the front-end has a vulnerability that allows sql injection, you wouldn't leak the admin page or if the admin login has a vulnerability, the user data would be safe
13eck
13eck3d ago
Another fun thing you can do is use different DB files for access levels. Say for example you have a sales coordinator who needs access to specific info to run stats for your sales. Instead of giving them limited access to the DB itself, you run a query on the DB and make a new DB file with the result. The sales coordinator now only has the info they need to do their job. No need to worry about them getting access to info they don't need/shouldn't have. Of course if the SQL query is badly written…shit can happen. So it's kinda 6 of 1, half-dozen of the other 🤷
ἔρως
ἔρως3d ago
also, audit logs could be stored in separated databases, to be easy to analyze that is also a nice benefit and you can anonymize the data before giving it
Faker
FakerOP3d ago
so to sum up all that ----> LEARN SQLite xd
ἔρως
ἔρως3d ago
basically
ἔρως
ἔρως3d ago
you can use sqlitestudio or another sqlite client to mess directly with the database also, i strongly suggest you to use the .sqlite file extension, instead of using the .db or .sqlite it disambiguates a lot on what the file is for (in reality, you can name it with .trololol as an extension, but, using .sqlite3 is better)

Did you find this page helpful?