As it is a long time since I have done this,I would like to know what or how is the recommended way of powering the Arduino with a LM35 sensor by either a 5v or 9v supply.
I know about using VIN with the +Vcc wire, but does that apply to the 5v as well a 9v supplies.
No, you need at least 6.5~7V for the Vin pin on an Uno.
You can connect a 5V power supply directly to the 5V pin of the Uno. But you must be sure it is a correctly regulated 5V power supply, because if it is not, damage to the Uno is almost certain.
A question for you: how does your question relate to interfacing with software on the computer?
If you are in doubt about where on the forum to post a question, there is a sticky post at the top of most sections that explains what the section is about and what type of questions to ask there.
The Arduino Uno board can be powered via the USB connection or with an external power supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the GND and Vin pin headers of the POWER connector.
The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.
The power pins are as follows:
Vin. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
GND. Ground pins.
IOREF. This pin on the Arduino board provides the voltage reference with which the microcontroller operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power source or enable voltage translators on the outputs to work with the 5V or 3.3V.
Never. EDIT: I now know that when @avalon66 says "Vcc" this means the wire from the PSU, not the Uno's Vcc pin which is labelled 5V)
If you connect a 9V PSU to the barrel socket, you will have 9V at the Vin pin because they are internally connected. If you then connected Vin to Vcc (meaning the Uno's Vcc pin which is labelled 5V), you would then have 9V at (Uno's) Vcc, which would damage the Arduino.
I am putting the arduino with the sensor and mini breadboard in a plastic box, which will have a power socket.From the ocket there will be a +Vcc and GND wires. So if I can't connect 9v to Vin, what about a 5v supply, and where do I connect the same wires.
thanks
You said this is an Uno and I thought the pins on Uno were labelled Vin and 5V.
But other Arduino do have a Vcc pin. Like Pro Mini and Pro Micro. Because they are available in 5V and 3.3V versions made with the same PCB, these Arduino have a Vin and a Vcc pin.
Ok, so if I can't connect to Vin with 9v +Vcc wire, what or where do I coonect a 5v supply because I will be using the 5v connect on the Arduino Uno to power the mini breadboard with the LM25 and 16x2 lcd
Now that I understand that by "Vcc" you mean the +9V wire from the PSU, yes, you can connect it to the Vin pin of the Uno.
If you want to use a 5V PSU, you must be certain that it is a regulated 5V power supply. If it is not regulated, the "5V" can be much higher than 5V when only a small current is drawn, and this could damage the Uno.
If you are certain (like you have checked the voltage with a multimeter and it is close to 5V (e.g. 4.5~5.5V) then you can connect the 5V and ground from the PSU to the mini breadboard, and from there, connect the 5V and ground to the 5V and ground of the Uno, the sensor, and LCD.