Depending on the licence its either legal or illegal.
The Arduino for exemple is under the Creative Commons Attribution Share-Alike license. Wish allow commercial use if they are credited and under the same license.
If it is Noncommercial and you are making money out of it, then it is illegal.
If the author allow Commercial use, then I'm pretty sure he doesn't care, but it doesn't stop you from sending him money has a personnal recognition and he will be glad for it.