# Can a sensor connect directly connect to the server? [closed]

The question is simple, and I am not doing any SE in here. I googled first, I didn't find an answer. So, people of electronics, I am not from electronics so don't know where to look exactly.

Just an example scenario below (no SE in any way):

I have a sensor dht11, how do I connect exactly that to a server via wifi.Now I am able to connect to raspberry pi and then to a server from raspberry pi.

How do I go about? I am not asking in here for any secret blueprint of some secret stuff. I know it is available online, I don't just find it because I am not from this domain.

Any helpful links are highly appreciated. Will return back to the "electronics" stack exchange in specific, once I gain expertise in this domain.

(If this is not a right place to ask this, kindly comment on where should I post this)

Thanks!

## closed as too broad by brhans, Bence Kaulics, Nick Alexeev♦Oct 24 '16 at 17:10

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• "Now I am able to connect to raspberry pi and then to a server from raspberry pi." -- You are on right track... Rather you already did that! You cannot connect a raw sensor directly to WiFi... You will need a microcontroller in between which will host the stack. – Swanand Oct 24 '16 at 14:38
• Yeah, this is what IoT is all about: connectivity. However you need to decide which connectivity stack you want to build on: TCP/IP+WIFI, or NFC, Bluetooth, or sub-1G. If your sensor is so small that you don't want to use a RPI just as a wifi transmitter, you can use RPI as a hub to Internet, for a cluster of sensors and use some other lower-cost short range protocol from sensors to the hub. – user3528438 Oct 24 '16 at 14:46
• @Swanand Yes, I'll need a microcontroller. I am currently in a course on coursera, the course is taking a lot of time to complete, where I build my own IoT device. Can you link me, on how I embed my sensor in the microcontroller, I am just stuck on this, rest all is fine. – johnrao07 Oct 25 '16 at 10:50
• @user3528438 I can use Rpi as a hub, and it's a lot easier to do so, but I don't know how reliable Rpi is. So I understand that I need to build my very own microcontroller as a hub. Programming stuff isn't an issue for me, but the electronics stuff is out of my head.Thanks for your answers this time, I think we should have a section to discuss some broader things unlike usual specific problems. Thanks! – johnrao07 Oct 25 '16 at 10:56

What you seem to think you want is:

<Sensor> -> <WiFi>


Whereas in reality what you actually need is:

<Sensor> -> <X> -> <WiFi>


Where <X> is some device that can do two things:

1. Read the data from the sensor, and
2. Connect to the WiFi and send the data through it to the internet.

You have already achieved that with the Raspberry Pi, although for a single small sensor the Pi is considerably more powerful than you would ever need.

Instead you want something smaller. As has been mentioned in the comments using the Pi as a "hub" to connect multiple sensors to the internet is one possibility - for that you may choose something like the nRF24L01+ wireless modules along with small microcontrollers, such as Arduino-style boards, or maybe X-Bee modules with the same boards, etc.

Another option is to use a small WiFi-enable microcontroller, such as the ESP8266, which you can program to read the data from your sensor and to communicate to the outside world through WiFi.