I am a newbie and facing a problem right now. I want to use Arduino to make a interactive lamp. If everything goes well and there is a demand for it, I want to produce a series of these lamps and sell it. But it seems to me that it is not clever to put a whole Arduino Uno in a lamp. So is there any possibility to transfer the code/program from my Arduino to a cheaper microcontroller which is powered by batteries and use it for my lamp?
I apoligize if this is a dumb question or if it got already asked in the past. I would be very thankful if someone could help me out.
Yes, that's quite possible. There is no magic to an Uno. It's just an ATmega328P microcontroller on a PCB with some support components.
There are a good array of microcontrollers that are supported by the Arduino framework and if you use one of these, it is likely you can use your same code with minimal changes. There are also many other microcontrollers which don't have Arduino support. If you pick one of those, you'd need to make some significant changes to your code.
Why would you want to transfer from tge Uno to another board. You can simply choose a different board in the IDE and compile and upload to that board; after that, you can put the board in your lamp.
Staying within the Arduino family, you can opt for e.g. a Nano. You can also opt for a SparkFun Pro Mini; both use the same microcontroller as the Uno.
@sterretje: I am very new to all this so I didn't understand everything. I am looking forward to produce a series of these lamps so I have commercial intentions. When I look up the price of one Uno or Nano its about 20 bucks. I thought that there has to be a cheaper board that can provide similar functions like the Uno or Nano. Therefore my question is do you guys know a board that can do this?
I looked up the Pro Mini that you mentioned which is a lot cheaper. If you think that this is the best option than I will probably go with the Pro Mini.
The Arduino is "open source". So there are a ton of cheap clones. You can get minis for like $2 or $3 in quantity from China.
That said, you can get the ATmega328p chips for even less in bulk. Design and order some boards for a few dollars each (or less) in quantity. And have pretty much the same functionality as an Uno.
Just saying there are ways to keep it cheap if you're serious about your idea.
FTDI cable works great with the Pro Mini, much easier than hooking up another Uno or so.
But for your lamp the ATmega328p may be total overkill in terms of numbers of I/O, or memory. There are many more ATmega and ATtiny processors, significant savings to be made there.
For something in production you don't need USB normally; use the ISP header for programming. This is very easy using a USBAsp adapter.
Is the lamp intended to be hacked? Then use one of the standard Arduino boards. Or a clone. Let your customers know what is inside and they will surprise you with the weird and wonderful ways they modify it.
If you want to make a regular consumer product which has safety compliance then start prototypes with Arduinos but the final product will end up a long way away from that starting point.