Wednesday, March 31, 2010

Arduino Components: Operational amplifier LM358

Op amp (Operational amplifier), can amplify the input voltage many times it might be millions of times. When I found the number LM358 in Arduino schematic twice I checked up the eagle board and found only one, physically I found one where is the other:
This photo from the schematic:

This photo for the LM358 in Arduino:

I realized that the LM358 is drawn that way in schematics, because it contain two pieces of Op amps, as in LM358 datasheet.

I might write a new post about LM358 in Arduino, I believe this book is very good to learn about Op amps "Op Amps for Everyone"

Conclusion, LM358 IC in Arduino contain two Op amps, this IC can be operated from one + input (no need for + and -).

Tuesday, March 30, 2010

Arduino components: the voltage regulator MC33269D-5.0

Arduino components: the voltage regulator MC33269D-5.0
Voltage regulating is very important in any electronic circuit, Arduino have a regulator to regulate the external power source, MC33269D-5.0 here is a photo (circled in red):

Written on the part: (has no relation with the part real number that I got from schematic)

MC33269D family has many other regulators the number after the dash specify the model type of the regulator, in our case it is 5, in this model the output voltage is 5 Volts.  Other befits of the MC33269D-5.0 is that it can protect the circuit from thermal and short problems.
In other Arduino clone (Minimalist Arduino, ArduinoBreadboard and others) LM7805 is used instead of MC33269D-5.0, they are almost the same.
Vin voltage regulator MC33269D-5.0 in Arduino receive a 7V of power and convert it to stable 5V.

Monday, March 29, 2010

Arduino Components: The Mosfet (field-effect transistor) NDT2955

Mosfets used to switch electronic signals; it has three pins A, B and C, A can be connected to B by applying small current to pin C, but C is isolated from
A and B (this is the true magic).
This is a photo of the Mosfet NDT2955 in Arduino (circled in red)

There is no clear part number on the part, but I get the part number from Arduino EAGLE files and schematic, they are open source and free you can get your copy.
What is the rule of NDT2955 in Arduino, its datasheet clarifies the applications that NDT2955 fits in:
  • DC/DC converter
  • Power management

But in Arduino Duemilanove it works like a power source selector. In previous versions of Arduino (such as Diecimila or NG) there was a power selector jumper which the user will select which is the power source (external power or USB power). The old jumper location in Diecimila and NG was the same location of the Mosfet NDT2955 in Duemilanove.

In Arduino Duemilanove we do not need to switch the power between USB and external power, the Mosfet NDT2955 will select for us. If there is an external power supply and the Arduino Duemilanove is connected to the computer the NDT2955 will select the external power supply, if we turn off the external power supply the NDT2955 will chose the USB power.

Sunday, March 28, 2010

Arduino Components: FTDI FT232RL (USB/Serial Converter)

Arduino is not a USB 100% device, if we examine it we will find this information, Arduino is a Serial device but has the ability to be connected to the USB port. The FTDI FT232RL plays the rule of converting between Serial and USB protocols.
This is a photo of the FT232RL (Circled in red):

The data written on the chip are:

The idea of Arduino communication is: PC sends serial data via the USB port, FT232RL receive that data and convert them to their original state (Serial Data) and transfer them to the Arduino mind (AtMega328P), AtMega328P sends data to PC through FT232RL, so the FT232RL helps Arduino send & receive serial data through a USB port.

Nowadays serial ports are hiding from new PCs. FT232RL make it more convenient to plug your Arduino to almost all computers all over the world. Speed of data transfer for FT232RL is from 300 baud (300 bits per second) to 3 Mbaud, Arduino does not need more than 115200 baud, so when we write sketches in Arduino IDE we specify the baud speed for example:
void setup() {
Serial.begin(9600);         // opens serial port, sets data rate to 9600 bps
void loop() {}
We mention the speed as 9600 baud.
FT232RL can (as it stated in datasheet) be found in many devices 
such as bar code readers, cameras, mp3 players, smart card readers and many other electronic devices.

Serial communication is very good for Arduino family, its simplicity enable us to implement Arduino in many applications the serial communication through a USB interface is an excellent feature of Arduino.

Saturday, March 27, 2010

Arduino Components: The ICSP 6-pin header

The ICSP pin header is the six pins that are showed in this photo;

It is even clarified by written those pins are for ICSP, but what does ICSP mean and what are its benefits. First ICSP (In-Circuit Serial Programming) is a way that allows us to program the chips when they are in circuits, in Arduino it helps in programming Arduino chip (AtMega328P) directly with AVR instructions without the need to Arduino IDE, in this case we can program AtMega328P as the factory programmed Arduino with bootloader. The bootloader helps Arduino device to understand sketches (Arduino applications), and to run them once they are installed in Arduino.

ICSP will help us upgrade our Arduinos in case there are any updates from Arduino team. Arduino team make ICSP like that to allow them make any update in the last minute before sending the device to the customer, in other words they manufacture Arduino without programming it with bootloader, they continue updating the bootloader from time to time, and before sending Arduino to a customer they install the last version of the bootloader.

Other good thing about Arduino ICSP is that it can turn an Arduino to an IPS programmer to program, a general ISP (In-System Programming) programmer if we see this project by Massimo Banzi (co founder of Arduino), he just changed the Arduino crystal and some modifications in Arduino program and turn it to programmer.

Conclusion, ICSP is a way to program Arduino, or an advantage to use Arduino as an ISP programmer.

Wednesday, March 24, 2010

Arduino Components: The Crystal oscillator

Learning in general starts with two questions; How? and Why?, how makes the learner as an imitator or one of a million, why enable your creativity, improve your experiences and make you unique. As a newbie in electronics Arduino is very good in terms of prototyping and making projects in an easy manner. Actually all websites that I read to learn Arduino and electronics focus on how to make this project and HOW to solve that problem. I was looking for more details about the physical components on Arduino, not finding much information about them encourage me write this series: we will start with
Arduino Crystal oscillator:

(The crystal inside the red square)
Arduino crystal helps Arduino dealing with time issues, for example if we build a project that turns a switch A off after 15 minutes on and turn on switch B, C & D one after another with a 20 minutes step. We can use Arduino software to program Arduino to do that, but how Arduino calculate the time? The answer is by using crystal, the number on the top of Arduino crystal is 16.000H9H this gives us information about the frequency which is 16,000,000 Hertz or 16 Mhz, this small component can make 16 millions cycles per second so using this concept Arduino can calculate time.

Furthermore, using this crystal is important in other applications such as microprocessors, webcams, computers, inside my computer motherboard there are two crystals; here is a photo:

Before knowing how crystals works, I thought that computer calculate time using algorithms (Now I understand that computer uses algorithms with crystals to detect time).

Still two questions, why Arduino team select a 16 Mhz crystal and do not use a 32Mhz or more? We have to look in the datasheet of (Arduino brain), ATmega328P: in the first page under "Speed Grade" it has been Clearfield that the maximum frequency should not exceed 20 Mhz, so the 16 Mhz is suitable.

The second question is; What about the crystal accuracy? This depends on the crystal specifications'. Arduino crystal have a 100ppm accuracy, in other words these crystals have an error margin 100 cycles – or + in each one million cycles, this means that the maximum – or + error in time calculated by Arduino is 30 seconds per a year.

Tuesday, March 23, 2010

More About Load Cells' indicators

Indicator is very important in scale applications. Beside its role in amplifying the values that it get from load cell and counting the deal load, it can be programmed to deal with more than one source of raw materials.
At the indicator that I have, there is an ability to control 4 sources of raw materials (some indicators can control 8 sources or more), it can send data to computer through RS232 or RS485 ports.
Because it can send data to RS485 port, there is a good chance to use load cells at a 1200 meters distance
To control the outer sources we should use a buffering Relay and a Diode between the Indicator and the power supply.
This photo for the back of the indicator that we can connect four wires for the material sources:

We can connect wires to the M1, M, M3, M4. Then program the indicator with the weight of each material, when the material reach that point the indicator will send a signal to turn off the relay and turn on another relay so the second material will be loaded to the storage hopper.
This is the wiring schematic recommended by the manufacturer:

I think this will help automate many batching tasks.

Monday, March 22, 2010

More about Load Cells

I will write today and tomorrow about the Load Cells and indicators, and will switch to something else.

All load cell manufacturers and sellers give the buyer a copy of the load cell data sheet, It might be attached inside the package of the load cell. In brief, Load Cells do not have many data that should be written in the data sheet, so my load cell data sheet is only two pages, in the first page information about the applications that the load cell used in. The second page are the technical information, dimensions and wiring.
Have a look to the technical information:

Inside the red line is "Output Sensitivity" which means the highest output (in Volts or mV) of the load cell when it carries the maximum load. Actually this depends on the input value in the photo above the output is 2 mV/V, my input volts are 10 V, so the highest output will be 20 mV when there is a 5 tons under the load cell (because my load cell maximum capacity is  tons), can I increase the input voltage? Yes until 15 V as stated in the technical above in "Excitation Voltage", what will happen if we increase the input more than the 15 V, nothing will happen under 20 V as in the data sheet "Maximum Excitation" except that the indicator will show an error message, if we increase the input voltage more than 20 V, it is not stated what will happen but maybe there will be some problems, small components inside the load cell will be damaged maybe.
I tried to increase input to 16 V and got an error message, of course I did not tried to increase more than the 20 V.

Arduino can not communicate directly with load cells, because Arduino have an analog input that read values between 0 and 5V, between 0 and 5V Arduino can read 1023 values, so can read each 0.0049 V and convert it to 1, for example 2.5V will be read as 512 in Arduino analog input and 5V will be 1023. So the small output numbers of the Load Cell (0 to 20m/V) will not be easy for Arduino to read, so we should use amplifier between the load cell and Arduino.


Saturday, March 20, 2010

Connecting a load cell to my Arduino

Arduino is an open source hardware which allow many people with a little knowledge about electronics (like me) to design their electronic applications and convert ideas to reality.
 I got my Arduino from Sparkfun, last December it is very good and it will encourage people to love electronics and dive deep in. it has 14 digital I/O (In / Out) pins, and 6 analog input pins and 6 analog outputs (Nos. 3, 5, 6, 9, 10, 11 of the digital ones (they can be used as digital or analog)), the different between analog and digital is that digital means 0 or 1, but analog means 0 or .01, .001, 0.002, …, 1.
So the analog value may change from a moment to another, let’s now think the load cell has analog output or digital output?!
Yes it has an analog output because it converts weight to signals the lower weight has a lower signal; the more weight the stronger signal. Note that we are now talking about very small amount of analog signal.
I lunched the Arduino application in my computer (you can get yours from here it is open source and free: selected File> Examples > Analog > AnalogInSerial.
Arduino IDE opened an example was written by Tom Igoe, after changing the delay time from 10 to 250 I verified and uploaded the program (Arduino Community call it Sketch) to Arduino and open the serial monitor in the Arduino IDE, I put some loads at the end of the load cell the Arduino was reading the signals that came from the load cell (Actually I were getting strange values because I think there might be a wrong in the wiring on at any step of connecting the load cell to Arduino).
About the wiring; I connected the power inputs of the load cell to the power outputs of the indicator so I can get a 10V from the indictor, but I connected the signal + to Arduino analog pin 0, and connected the signal – to the Gnd in Arduino.

Friday, March 19, 2010

Working with a Load Cell 2

I still working with the load cells, I got an old load cells to make my experiments and return them to their owner:
The two load cells photos:
The way of wiring load cells may differ from one manufacturer to another, but in every load cell there should be at least four wires; two for power one + and one -, and two others for data one + and one -, some of them has more than four but you might twist (wind) two of them or more together.
My patch cords were very handy and useful in connecting wires between the two cables:
The strange thing that I did not understand easily is the schematic, it explains the entire winding plan but I did not understand the point about the outer wire, I will explain it here so I will be sure you will not have that mistake like me. Here is a copy of the schematic:

Look at that dotted line that connected to pin No. 9; this line means that we should connect the outer wire of the load cell cable, like the one in this photo:
To the outer wire of the indicator cable.

Thursday, March 18, 2010

Working with a Load Cell

First the Load Cell is a device that converts strain (weight) to an electric signal, if we installed a Load Cell in the work area and connected its wires to an Indicator, when we hang a load to one of its end it will send signals to the Indicator, in other words Load Cells are weight sensors.
This is the Load Cell

Because of the output of the load cell is too small (in mA or less) the indicator will multiply that amount using a specific algorithm and display the right weight.
The Indicator

Look it is written on that indicator “Batching Controller”, it is not only a screen for weight results, it has many functions that can do, you can use it to program the dead load which is the weight of the platform, we will consider that weight to be dead load that equal zero and the indicator will only show the weight that exceed the dead load. Another benefit of the indicator is that you can program it to act once the weight reach a specific point, so you can program it to switch off the motor or open another source of materials.
The applications where the load cell is being used are varied, for example crusher plants, concrete plants, asphalt plants and cement factories and even in food and chemical factories, they use the load cells with a pre-programmed indicators (with the weight of the row materials) so they can get a better finished outputs.