Hello Arduino folks!
For some weeks ago I managed to automate my roller blind with an Arduino, an XBee and a servo so that I could control it with a remote(attiny85+xbee).
NOW I want to take the next step. I'm planning to order some atmega chip (probably this one ATMEGA48)
and the ethernet breakout module called ENC28J60.
What I want to do is connect the ENC28J60 and the servo to the Atmega chip and make the atmega chip run a server which I can connect to via my computer/phone to control the roller blind.
Would this be possible with the ATMEGA48, does it have enough pins and enough capacity to run a server?
And do you have any tips to help me on my way?
I also need to pull down the 7.5 volts from my walladapter to around 3.3 volts, is this possible with this voltage regulator AMS1117? Is it just to connect the 7.5 volts to one of the pins and it automatically converts it down or do I have to anything more? I'm wondering 'cause they say in the datasheet that it can output 1.5V, 1.8V, 2.5V, 2.85V, 3.3V and 5.0V.
The ATmega48 is not a standard Arduino chip.
If you must use a single microcontroller, use an ATmega328P, that one is the most used one on the Arduino boards.
But why go all that length and get into trouble ?
You better buy an official Arduino board. Or you can buy a Arduino Pro Mini clone on Ebay for 3 dollars (and that is inclusive shipping).
The AMS1117 is a family of voltage regulators. The AMS1117-5.0 outputs 5V and the AMS1117-3.3 outputs 3.3V.
Caltoa:
The ATmega48 is not a standard Arduino chip.
So? You can program one with the IDE if you can find the core file (most likely can).
Arduino is a development board. There are site pages just about making stand-alone AVR apps.
BTW, a $3 Pro Mini clone is a steal! I guess it's too much to hope they have header pins?
For some things, an ATtiny will do, but I think not ethernet!
For about $7 you can get an ATmega1284P with 16K SRAM, 30-some I/O pins and extra goodies.
Here's Nick Gammon's complete how-to on breadboard compatibles covering the 328P and 1284P.
But maybe you don't need more than a 328P and ethernet adapter. Dig on this forum and the Arduino site playground and you may pick up a lot of information on what and how other people Arduino across the net.
Caltoa:
But why go all that length and get into trouble ?
You better buy an official Arduino board. Or you can buy a Arduino Pro Mini clone on Ebay for 3 dollars (and that is inclusive shipping).
Okay I understand, I can see that purchasing a Arduino Nano 3.0 would be a better deal. An advantage is that I don't have to regulate my powersupply 'cause 7.5 volts is no problem for the Nano.
The information on the Arduino homesite says though that "when running on external (non-USB) power, the 3.3V output (which is supplied by the FTDI chip) is not available..." So it's not possible to get 3.3 volts out of the Nano if I power it with an 7.5 volt DC-adapter?
AND I suppose the nano can handle an Ethernet breakout module right?
That text is for an old board. The new board has always 3.3V.
The Nano is a board with the ATmega328P, so the pins and the sketch are no problem.
That 3.3V (generated by the FTDI) is probably not enough for the ENC28J60. Perhaps a seperate DC-DC converter from 7.5V to 3.3V is better.
On the other hand, I have a Nano with ENC28J60 shield (a shield for the Nano). But some components get hot, which makes it less reliable.
There are lots of ways to tackle the problem and I don't see why the approach you describe couldn't be made to work, but wouldn't it be simpler to put the web app / UI / whatever front end on the PC and connect the second XBee to your PC so that the PC can talk to your existing Arduino?
Caltoa:
The Nano is a board with the ATmega328P, so the pins and the sketch are no problem.
That 3.3V (generated by the FTDI) is probably not enough for the ENC28J60. Perhaps a seperate DC-DC converter from 7.5V to 3.3V is better.
Alright but what do you mean when you're saying that "3.3V ( generated by the FTDI) is probably not enough..."? According to the datasheet for the ENC28J60 it says that "Operating Voltage of 3.1V to 3.6V (3.3V typical)". So it should be enough right?
Caltoa:
On the other hand, I have a Nano with ENC28J60 shield (a shield for the Nano). But some components get hot, which makes it less reliable. enc28j60 shield nano for sale | eBay
I've read about that heat problem but I've also read that you can solve it with some kind of heatsink? Am I right?
GoForSmoke:
PeterH:
There are lots of ways to tackle the problem and I don't see why the approach you describe couldn't be made to work, but wouldn't it be simpler to put the web app / UI / whatever front end on the PC and connect the second XBee to your PC so that the PC can talk to your existing Arduino?
You might not want a PC running all day just so you can twirl your blinds over the phone?
I wonder how much a Yun costs?
No, seriously, people do have remote Arduinos acting as simple net... which, servers or clients or either?
Exactly, I just want to use the cheapest possible components to get this project working and not tie an "expensive" arduino uno, xbee or computer to the project.
With 'not enough' I ment the current. The ENC28J60 needs more current than most other components.
I think that shield for the Nano that I have has it's own voltage regulator for the 3.3V, so the FTDI chip 3.3V output might not even been used at all.
I have been thinking about a heatsink, but it's too tiny to get a heatsink in there.
Okay so I will be able to run the Nano and the servo at 7.5 volts but I need to convert the voltage down to 3.3 volts to the ethernet board with a voltage regulator that allows around 500mA?
I have some problem understanding the datasheet for the AMS1117-3.3V.
If I connect 7.5 volts to the VIn pin of the AMS1117-3.3V will it give 3.3 volts on the VOut pin if the ENC28J60 draws around 200mA?
Thanks!
Archelon:
Exactly, I just want to use the cheapest possible components to get this project working and not tie an "expensive" arduino uno, xbee or computer to the project.
I assume you already have a PC (you are doing Arduino development, after all) and that you already have all the hardware you listed in your existing solution. Isn't the simplest and least expensive solution just to use what you already have? Yes it's possible to add wired or wireless network interfaces and it's possible to have the Arduino serve out a website, but you're going to need extra hardware and a much more complex sketch, and then you will need to debug that and make it reliable and stable, and then you have got to limit your web app to the capabilities you implement in your web server. If you develop the web site on a PC you have massively better support for developing the web site, and if you also host it on the PC then you have a much more stable solution, and access to much more powerful frameworks for security, logging, portability/encoding etc. Altogether it gives you a much better solution as well as a cheaper one that is easier to develop. You can do the whole thing on an Arduino if you want to, but that doesn't mean it's sensible to.
Archelon:
Exactly, I just want to use the cheapest possible components to get this project working and not tie an "expensive" arduino uno, xbee or computer to the project.
I assume you already have a PC (you are doing Arduino development, after all) and that you already have all the hardware you listed in your existing solution. Isn't the simplest and least expensive solution just to use what you already have? Yes it's possible to add wired or wireless network interfaces and it's possible to have the Arduino serve out a website, but you're going to need extra hardware and a much more complex sketch, and then you will need to debug that and make it reliable and stable, and then you have got to limit your web app to the capabilities you implement in your web server. If you develop the web site on a PC you have massively better support for developing the web site, and if you also host it on the PC then you have a much more stable solution, and access to much more powerful frameworks for security, logging, portability/encoding etc. Altogether it gives you a much better solution as well as a cheaper one that is easier to develop. You can do the whole thing on an Arduino if you want to, but that doesn't mean it's sensible to.
You're right, I actually have a spare low budget laptop which could function as a server. If I am to solve it that way, I got some questions.
I will talk to the Arduino via serial communication(by usb cable or XBee) but what software should I use that can both set up a server and send serial commands? Is Processing an option?
I would like to have the server running all the time, is that possible for a laptop? Or should I instead buy a small computer like the Raspberry Pi, which would not follow the idea of using what I have. hmm...
Processing2 has a net library. Your own PC acts as a net as well so I think that you should be able to go from processing to your favorite server program on the same laptop or do it all in processing but have to write the server software in processing instead. I guess it depends on how featured/complicated you want/need your server to be.
Archelon:
what software should I use that can both set up a server and send serial commands?
You will need to do some coding to create the web app which can talk to the Arduino, and the main choice is what language you want to use for that. The most obvious options are PHP, C++/C# and Java. Once you have chosen your language, you will be in a position to choose the web server implementation and development environment to create the web app. If you don't know where to start then I suggest you stick with C++ in an ASP or ASP.NET web app developed in Visual Studio (there are free editions), but check out PHP before you make the decision because there are plenty of PHP/Arduino examples around and if you don't mind learning a new language it gives you a pretty simple solution.