2
\$\begingroup\$

I need to build a scale that is not attached to any computer. The goal is to weigh a dustbin and show the weight value on a small LCD screen. The weight I want to measure is approximately 10 kg, but I have to do the tare of the weight of the dustbin to weigh only the contents. The price of the equipment has to be cheap. I tried to look for an online solution and the only solution I found was with an Arduino. The problem is that the Arduino is connected and powered by USB to the computer and I can not use computer. How could I build the balance cheaply? Is there any way to run the program on Arduino without having to always connect it to the computer and feed it by stack for example?

Example with Arduino:

\$\endgroup\$
6
  • \$\begingroup\$ Not really important to the question, but in English it is tare. Gross weight (the total weight) = net weight (the weight of the goods) + tare weight (the weight of the empty container). \$\endgroup\$
    – Mattman944
    Jun 15 '19 at 12:50
  • 1
    \$\begingroup\$ There's a plug at the upper left corner of the Arduino in your picture. That's a power plug. See how simple it is to use one? \$\endgroup\$
    – JRE
    Jun 15 '19 at 13:41
  • 6
    \$\begingroup\$ Um, an Arduino is a computer, isn't it? \$\endgroup\$ Jun 15 '19 at 22:27
  • \$\begingroup\$ @Mattman944 Thanks for the suggestion. I changed my question and put tare instead of TARA. \$\endgroup\$ Jun 15 '19 at 23:00
  • 5
    \$\begingroup\$ You need to define "computer" in your question. To many electrical engineers, saying "I can not use computer" could mean that you are not permitted to use a microcontroller, as many of us would consider that to be a computer. However, not using a microcontroller for this task would be a fairly special requirement. Do you really mean that you just need to not have it connected to a PC? \$\endgroup\$
    – Makyen
    Jun 16 '19 at 0:38
8
\$\begingroup\$

Flashing

Once you upload your sketch to an Arduino, it does not need to be connected to a computer anymore; the Arduino IDE uploads the sketch into Flash of the Arduino, which will stay there until overwritten again, even when the Arduino is powered off and not connected to any power source. The uploading process is called Flashing (done by the Arduino IDE normally).

USB power

For powering, instead of using the USB plug to the computer, use a socket adapter with a USB plug, same as a telephone/USB phone charger. This will have the same behavior as connecting it to a computer, except that flashing is not possible.

Battery power

(from comment below)

You can simply connect the battery to the Vin, because the Arduino already has a voltage regulator (which works recommended from 7 to 12 V and absolute maximum rating of 20 V). The voltage output from e.g. the 5V or GPIO pins will be (approximately) 5 V. The reason that you the minimum voltage should be 7 V of Vin, is that the internal voltage regulator is not 100% efficient (no voltage regulator is).

So if you connect a battery that is at least 7 V (e.g. a 9 V battery or 5 or 6 AA batteries you are ok). Note that if you use 5 V batteries from 1.5 V, you get 7.5 V so the limit of 7 V will be reached quite soon as the voltage of the batteries drop.

\$\endgroup\$
5
  • \$\begingroup\$ Okay, I'm relieved to know that I do not need to always introduce the program into Arduino. But how could I power the Arduino with batteries? \$\endgroup\$ Jun 15 '19 at 12:50
  • \$\begingroup\$ The Arduino accepts through the Vin pin 7 to 12 volts (recommended). That will give a stable 5V internal power supply. So you can connect a 9V battery to the Vin pin.. \$\endgroup\$ Jun 15 '19 at 13:55
  • \$\begingroup\$ But I need a voltage regulator to apply exactly 5V on the Arduino Vin, or I can simply connect the battery to the Vin without any kind of problem or interference with the weight sensors and with the LCD that will display the weight of the contents of the bin? \$\endgroup\$ Jun 15 '19 at 22:57
  • \$\begingroup\$ You can simply connect the battery to the Vin, because the Arduino already has a voltage regulator (which works recommended from 7 to 12 V and absolute maximum rating of 20 V). The voltage output from e.g. the 5V or GPIO pins will be (approximately) 5 V. The reason that you the minimum voltage should be 7 V of Vin, is that the internal voltage regulator is not 100% efficient (no voltage regulator is). \$\endgroup\$ Jun 15 '19 at 23:04
  • \$\begingroup\$ So if you connect a battery that is at least 7 V (e.g. a 9 V battery or 5 or 6 AA batteries you are ok). Note that if you use 5 V batteries from 1.5 V, you get 7.5 V so the limit of 7 V will be reached quite soon as the voltage of the batteries drop. \$\endgroup\$ Jun 15 '19 at 23:04
1
\$\begingroup\$

The Arduino in your photograph has a barrel jack on it for powering from a battery. A suitable battery pack is one like this. Battery Holder - 4x AA to barrel jack connector

I teach Arduino robotics at the local university. As others have stated, use the computer and USB to actually program the Arduino, then remove it from the computer and simply run it from the battery pack.

\$\endgroup\$
0
\$\begingroup\$

short answer: yes. The program is written on the controller and can run without computer. Powering an arduino via USB charger is done frequently and using a battery is well within the possiblities. I guess you will find quickly plenty of examples for that. If money and size is of essence and you are willing/abled to handle a "bare" µC outside the arduino eco system I can actually recommend the MI0283QT Adapter v2. It is intended as an rpi/arduino shield but comes with a built in NXP LPC1114 µC which can be easily reflashed to work without an external rpi/arduino. Adding a simple Battery monitor system and li battery one gets a nice stand alone touch display mini "computer" with touch display.

\$\endgroup\$
0
\$\begingroup\$

Yup. It is very easy.

There are 2 ways:

  1. Provide 5-12 V on the Vin pin of arduino and connect (-) or ground to the ground on the arduino. You can also use an adapter whose output pin matches the black coloured jack on the arduino.
  2. Connect the programming cable to a mobile charger (USB port on the charger).

For the 5-12 V source you can very easily use a small LiPo battery (depending on budget) or AA batteries in series should also do the trick.

(Note: 5-12 means 5 to 12 V, any voltage in that range would work.)

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for the edit JRE \$\endgroup\$ Jun 15 '19 at 15:03
  • \$\begingroup\$ But I need a voltage regulator to apply exactly 5V on the Arduino Vin, or I can simply connect the battery (9 V) to the Vin without any kind of problem or interference with the weight sensors and with the LCD that will display the weight of the contents of the bin? \$\endgroup\$ Jun 15 '19 at 23:02
  • \$\begingroup\$ Yes carmen you can directly apply 9V to Vin as the arduino board has in-built voltage regulator. \$\endgroup\$ Jun 16 '19 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.