Uno and WiFi shield or a Yun?

I'm making an energy monitor and I'm using an Arduino to process data and send it online in real-time. The data will be sent wireless to a router.

Before I make a purchase, I'd like to know which of the 2 options from the title is more economical? The shield is more expensive then 3 Unos, so the Yun is a preferable choice.

What is your opinion?

Thanks.

Any toughts?

What's doing the wireless part? That may influence what you select for the Ethernet part.

I would tend to lean towards getting the Yun if you have Linux experience. It's gives the flexibility of running a more sophisticated server from the OpenWrt Yun Linux, freeing the Uno to do sensor processing. Alternatively there is a "Yun Shield" on the market for about the same price as a plain WiFi only shield. This is the Linux side of the Yun packaged as a Shield and will work easily with the Uno if you follow the proper setup instructions

Alternatively, you can send RF data from the Arduino to a Raspberry Pi or Beaglebone black, the later doing the web thingy.

Data will be sent wirelessly meaning Ethernet won't be used. An esential part of this project is the budget. I'd like to invest as little as possible. Isn't the Yun as easily to program as the Uno?

PS. I can't buy the Yun from the official shop (arduino.cc). It says it couldn't be found.

There's more support for the WiFi Shield. I'd go with it.

303030kid:
There’s more support for the WiFi Shield. I’d go with it.

I wouldn’t, they seem to be more trouble than they are worth.

A cheaper option is arduino with plain vanilla SD+ethernet shield, connected to a WiFi repeater. I already had the Ethernet shield and therefore had minimal cost and zero learning, but you are likely to be better off that way, even if you start from scratch. The repeater also brings its own assets to the game.

Since you have this sort of thing in mind, I would also suggest you put the money you will undoubtedly save into a Mega, rather than the Uno, as you are likely to need the extra memory.

I need to make this as compact as possible. A repeater and an ethernet shield would take a lot of space. That's one of the main reasons I was planning to invest in a Yun.

Why would I need the extra memory?

cipri92: I need to make this as compact as possible. A repeater and an ethernet shield would take a lot of space. That's one of the main reasons I was planning to invest in a Yun.

You only mentioned economy. If you are really serious about compactness, you might find you can do better than a Yun anyway

Why would I need the extra memory?

These things tend to grow, that is the Arduino way, so you will find out when you run out, and remember where you heard it first. You are not really saying much about what you are doing, but one energy monitor setup can be much the same as another, performing similar functions, with similar code and libraries - sensors, communications, backup, clock, local display - five facilities, and a Uno is usually struggling to handle four.

Well, as I found tutorials showing ways to measure voltage and current, these 2 units are the only inputs I’ll use. I won’t be using any other display ways such as an LCD or an LED array.

The principle is as follows: sampling the current, sampling the voltage, use the Arduino to process these 2 units including estimating the power factor and filtering the harmonics. Harmonics filtering will be done with a simple equation.

Afterwards the results will be sent out via WiFi to a router and then to a plotting website.

I read that 2 kB of RAM memory of the Arduino is enough for 2000 lines of code. The Yun has 4 kB. Won’t that be more than enough?

cipri92:
I read that 2 kB of RAM memory of the Arduino is enough for 2000 lines of code. T

I think this is arrant nonsense. I assume the 2k refers to the SRAM of a Uno which is merely the volatile memory scratchpad. Your Arduino sketch is stored in non-volatile flash-memory which, in the Uno’s case, is 32k, and I can’t see 2000 lines ever fitting in there - not even very short ones. That statement might mean that 2k of volatile memory is sufficient working space to handle a programme with 2000 lines of code, but that is irrelevant. I believe a Mega has 8k of SRAM, and that is where you will find a 2000 line programme.

You may find that what you want to do (at the moment) will fit, but a fairly ordinary programme to hand for a temperature monitor and feed to internet compiles at 40,446 bytes and has about 250 lines of code.

SRAM is what I meant in the lines of code phrase.

You said the Uno is struggling to handle 4 sensors. So, by using only 2 inputs, will a Yun be enough?

Another thing I'm not sure of is the Linux programming. If I buy a Yun, could I program it like a Uno?

cipri92: SRAM is what I meant in the lines of code phrase.

You said the Uno is struggling to handle 4 sensors. So, by using only 2 inputs, will a Yun be enough?

No I didn't. I said four operations, and I named them. The ability to handle sensors depends essentially on the availability of pins. Some sensors can share pins, same applies to devices. Therefore you can run out of memory long before you run out of pins.

If I buy a Yun, could I program it like a Uno?

It appears to have two environments on one board, and I imagine the Arduino environment works the same as any other Arduino. All I know about the Yun is that it comes equipped with USB, SD, Ethernet, and WiFi, yet appears to have the same memory arrangement as a Uno. That looks like the kiss of death to me, but you need someone more qualified to comment, and you may find it OK for your purposes.

The description of the Leonardo states that is similar to the Uno and the PC sees it like a HID. What does it mean?

HID means Human Interface Device i.e. the PC can think the Arduino is a mouse or a keyboard. I have no idea why anybody would want to do that. But I am only interested in data collection, and Arduino can mean all things to all people.

Greensprings: arduino could type you a copy of war and peace

Sounds just like what we all need.

Greensprings: my problem is there is much less tutorial information on the internet for how to really use the yun, i hope that will change

I've seen some examples and they are very similar to an ordinary C program. I suppose the progam which will process my data won't be long and therefore it shouldn't take a lot of memory.

So, in conclusion, should I or should I not invest in a Yun having the criteria mentioned above (size, budget and capability to serve my purpose)?

Nick_Pyner: It appears to have two environments on one board, and I imagine the Arduino environment works the same as any other Arduino. All I know about the Yun is that it comes equipped with USB, SD, Ethernet, and WiFi, yet appears to have the same memory arrangement as a Uno. That looks like the kiss of death to me, but you need someone more qualified to comment, and you may find it OK for your purposes.

Yes, it is two environments in one: a Leonardo, and a 32-bit Linux computer. The SD card, Ethernet, WiF, and USB host interfaces are all managed by the Linux side, so the memory limitations of the Arduino side don't come into play. You can handle much of the network communications, file I/O, etc on the Linux side, and reserve the Arduino side to handle just the timing critical real-time control and hardware interfacing. With most of the peripherals handled by Linux, you have much more power: a full web server implementation, WiF configuration and management, file system management, and lots more, all without consuming ANY of the precious Arduino resources.

I've done quite a bit with the Yun, and I've only scratched the surface. Picture a Leonardo connected with a serial port to a RaspberryPi, but replace the video output with on-board WiFi. It's kind of like that.

cipri92: So, in conclusion, should I or should I not invest in a Yun having the criteria mentioned above (size, budget and capability to serve my purpose)?

I would go for the Yun: smaller than a combined Uno and a WiFi shield, and lots more powerful.