0
\$\begingroup\$

I need a microcontroller that would send statuses of it's input pins (around 5 of them, they can be 0 or 1) to a PC over wifi.

I thought of using arduino, but I don't know what would I need to make it able to send data over wifi? Some wifi module? And would that be a good combination?

This is a part of a device which is going to be on the hand, so it needs to be small and battery powered. (It should send statuses of it's pins at speed of around 15 times a second, and I'll need it to have one output pin set to 1, so I could send that signal to input pins) And since arduino is a bit bigger in size than I would like and it's made for much more advanced stuff I'm not sure if it would be the best choice.

So can anyone tell me what kind of microcontroller do I need and how to use wifi with it?

(I have some experience with arduino, but not with using wifi or other form of remote communication with electronics. If something about the question is unclear please ask in the comments. Thanks)

\$\endgroup\$
3
  • \$\begingroup\$ Why not use the MCU in the wifi module? \$\endgroup\$ Commented Sep 10, 2014 at 15:05
  • \$\begingroup\$ @IgnacioVazquez-Abrams I have no experience with that, so can you please tell me more about how to do that? \$\endgroup\$
    – zoran404
    Commented Sep 10, 2014 at 15:08
  • \$\begingroup\$ This seems like an opinion-based shopping question and will likely be closed unless it is reworked. \$\endgroup\$ Commented Sep 10, 2014 at 15:51

4 Answers 4

3
\$\begingroup\$

Arduino is a good starting point. There is a WiFi Shield available.

Your question, "What kind of microcontroller do I need?" is too broad. There are literally hundreds if not thousands of microcontrollers that you could potentially use. So how do you go about selecting one?

First, there are many manufacturers such as Microchip (PIC), Freescale, Atmel (AVR), etc. Selecting one is largely preference, but also highly dependent on support, price, reputation, available tools/software, feature offerings, etc. PIC and AVR are, for example, very popular platforms for 8- to 32-bit microcontrollers. The Arduino Uno is based on the Atmel ATmega328 8-bit microcontroller.

Let's say you pick AVR after becoming familiar with Arduino as a starter platform. (This is what I did.) Atmel has a microcontroller selector which gives you a parametric selection matrix to help you narrow down choices. The available microcontrollers are quite numerous, and some are purpose-made with specific applications in mind, such as portable music players, automotive applications, touch-based devices, and so on.

Using the selector, you can filter by such properties as memory size, pin count, CPU speed and type, temperature range, included timers and interrupts, external oscillator support, etc.

From what you've explained of your application, you are simply reading the state of five input pins and need to send that to a PC over a wireless (presumably ethernet) network at a rate of 15 Hz. The minimum requirement for that would be, obviously, at least 5 I/O pins, plus a way to connect to another component to send the data. SPI and I2C are common interface types, requiring two to four pins, depending on configuration. The WiFi Shield for Arduino that I mentioned earlier uses SPI to connect to the Arduino.

In the case of the WiFi Shield, all of the processing required for handling TCP/IP, encryption, and so on, is built into the board. If you decide to design and build your own microcontroller-based device, you could potentially find WiFi modules designed to "plug and play" with a microcontroller via SPI, or select individual components and create your own WiFi implementation. Personally, that would be a daunting task, especially if you're not familiar with microcontroller basics.

This site is not suited for product recommendations, but I can at least tell you to look for "WLAN Modules" or "WiFi Modules" at your favorite electronics component vendor. You can use their search tools to find modules that suit your needs, including the connection type you intend to use with your microcontroller.

If you're doing a one-off, or just getting started in learning, I would definitely recommend picking up an Arduino and the WiFi Shield. There is a lot of support for it, most of the difficult work has already been done, and there's even an Arduino StackExchange site.

\$\endgroup\$
6
  • \$\begingroup\$ Do you think I can power arduino and wifi shield from a battery? Could a lithium-ion battery from a phone be used? \$\endgroup\$
    – zoran404
    Commented Sep 10, 2014 at 16:58
  • \$\begingroup\$ You can definitely use a battery. The Arduino is designed to operate on 5V DC if connected via USB to a computer, or 7-12V DC otherwise. It has an on-board voltage regulator. The WiFi shield uses 5V supplied by the Arduino. Li-Ion batteries for phones are typically 3.7-3.8V, so you would need two in series to meet the required input voltage. Be sure to check the specs. \$\endgroup\$
    – JYelton
    Commented Sep 10, 2014 at 17:07
  • \$\begingroup\$ do you have any experience with this? \$\endgroup\$
    – zoran404
    Commented Sep 10, 2014 at 20:18
  • \$\begingroup\$ I have not used the WiFi shield specifically, but I have used other wireless methods to control devices remotely, like operating theatrical props from backstage. (Most of my work uses Atmel AVR microcontrollers.) \$\endgroup\$
    – JYelton
    Commented Sep 10, 2014 at 20:57
  • \$\begingroup\$ Sorry for asking, but can you tell me the cheapest way of making this? As a student I don't have much money and would like to avoid buying more expensive stuff.. \$\endgroup\$
    – zoran404
    Commented Sep 11, 2014 at 2:59
4
\$\begingroup\$

For establishing a communication between a computer and an MCU I strongly suggest you to use Texas Instrument's CC3000 Wi-Fi chip with an Arduino (Easiest way to accomplish what you need). Adafruit and SparkFun introduced breakout* and shield** versions of the Wi-Fi chip. It is easy to use, just connect the wires and start communicating.

There is a strong library support of these products. Either of it can be found in relevant websites. You can send http requests to arduino or you can get http requests from arduino using these libraries.

There are a lot of examples, sketches of this product. One of them is Wi-Fi weather station. Check the video, I believe this is what you want to accomplish.

*Adafruit's breakout
*SparkFun's breakout

**Adafruit's shield
**SparkFun's shield

\$\endgroup\$
2
  • \$\begingroup\$ do you have any experience with this? \$\endgroup\$
    – zoran404
    Commented Sep 10, 2014 at 20:16
  • \$\begingroup\$ @zoran404 I once asked a similar question. Fellow stackexchangers helped a lot. What I wanted to do is similar to yours. I bought an Adafruit cc3000 breakout board, connected to an Arduino. Since then, I use it whenever I need to. Just plug the wires and start communicating. \$\endgroup\$ Commented Sep 11, 2014 at 7:03
1
\$\begingroup\$

I ordered a ESP8266Wifi module (hackaday branch about this module) This WiFi module is ridiculously cheap and can be driven by Rx/Tx. The firmware on ESP8266 provides some commands so you can easily interact with them. I will send my data to a MQTT broker, another program (in your case a pc) contacts the broker and gets the update. The best microcontroller to use would be an Arduino in this particular case who communicates with the ESP8266. A disadvantage of this will probably the power consumption because 2 devices (µC and ESP8266).

\$\endgroup\$
2
  • \$\begingroup\$ Definitely cheaper than arduino wifi shield XD. Hey, if you have a bit of time could you assist me with my project? I just have some questions about which component to use. \$\endgroup\$
    – zoran404
    Commented Dec 16, 2014 at 0:43
  • \$\begingroup\$ You said it needed to be a wearable device, so I think it would be a good idea to pick a low power microcontroller. Another option is modifying the ESP's firmware, but I don't have experience with that. \$\endgroup\$
    – jelledb
    Commented Dec 16, 2014 at 12:50
0
\$\begingroup\$

If using a Raspberry Pi will work with your project, there is a project on Google Code called WebIOPi (https://code.google.com/p/webiopi/) that looks very promising.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.