Monday 29 June 2015

DC3-12V Push Pull Type Solenoid Electromagnet DC Micro Solenoid










Description:
According to the principle of electromagnetic induction, electromagnetic coil is energized after a fixed iron core
generates magnetic pull movable core, fixed thereon along with the movement of the plunger, to produce thrust.
It depends on the size of the stroke length of the coil.

Specification:
Size: 11 * 12 MM
Length: 20 MM
Voltage: 03V  Current: 0.08 A
Voltage: 06V  Current: 0.17 A
Voltage: 09V  Current: 0.26 A
Voltage: 12V  Current: 0.35 A
Internal resistance: 32.8 Ω
When energized,move down about 2.5mm

Package include:
1x Solenoid

Friday 1 May 2015

 DS3231 AT24C32 IIC precision Real time clock memory module for Arduino HLRG










Description:
DS3231 is a low-cost, extremely accurate I2C real-time clock (RTC), with an integrated temperature-compensated crystal oscillator (TCXO) and crystal. The device incorporates a battery input, disconnect the main power supply and maintains accurate timekeeping. Integrated oscillator improve long-term accuracy of the device and reduces the number of components of the production line. The DS3231 is available in commercial and industrial temperature ranges, using a 16-pin 300mil SO package.
   RTC maintains seconds, minutes, hours, day, date, month, and year information. Less than 31 days of the month, the end date will be automatically adjusted, including corrections for leap year. The clock operates in either the 24 hours or band / AM / PM indication of the 12-hour format. Provides two configurable alarm clock and a calendar can be set to a square wave output. Address and data are transferred serially through an I2C bidirectional bus.
   A precision temperature-compensated voltage reference and comparator circuit monitors the status of VCC to detect power failures, provide a reset output, and if necessary, automatically switch to the backup power supply. In addition, / RST pin is monitored as generating μP reset manually.
Save time and high precision addition, DS3231 also has some other features that extend the system host of additional features and a range of options. The device integrates a very precise digital temperature sensor, through the I2C * interface to access it (as the same time). This temperature sensor accuracy is ± 3 ° C. On-chip power supply control circuit can automatically detect and manage the main and standby power (i.e., low-voltage battery) to switch between the power supply. If the main power failure, the device can continue to provide accurate timing and temperature, performance is not affected. When the main power re-power or voltage value returns to within the allowable range, the on-chip reset function can be used to restart the system microprocessor.

Module parameters:
1 Size: 38mm (length) * 22mm (W) * 14mm (height)
2 Weight: 8g
3 Operating voltage :3.3 - 5 .5 V
4 clock chip: high-precision clock chip DS3231
5 Clock Accuracy :0-40 ℃ range, the accuracy 2ppm, the error was about 1 minute
6 calendar alarm clock with two
7 programmable square-wave output
8 Real time clock generator seconds, minutes, hours, day, date, month and year timing and provide valid until the year 2100 leap year compensation
9 chip temperature sensor comes with an accuracy of ± 3 ℃
10 memory chips: AT24C32 (storage capacity 32K)
11.IIC bus interface, the maximum transmission speed of 400KHz (working voltage of 5V)
12 can be cascaded with other IIC device, 24C32 addresses can be shorted A0/A1/A2 modify default address is 0x57
13 with rechargeable battery LIR2032, to ensure the system after power failure, the clock move any natural normal
14 Packing: single anti-static packaging
Wiring instructions (with Arduino uno r3 for example):
SCL → A5
SDA → A4
VCC → 5V
GND → GND


Package Included:

1* module 

Monday 9 February 2015


L239D DC Motor Driver & Pin Configuration

Although I’ve only used 1 motor, it is possible to use 2 motors on a single L293D chip, of course you then have to compensate on the current accordingly to ensure enough juice for both motors under peak load. Remember that if you use 2 motors, the power source will be the same voltage but the current needed will be doubled – a good start is by altering how your batteries are connected in series or parallel.
“The L293D is a monolithic integrated, high voltage, high current, 4-channel driver.” Basically this means using this chip you can use DC motors and power supplies of up to 36 Volts, thats some pretty big motors and the chip can supply a maximum current of 600mA per channel, the L293D chip is also what’s known as a type of H-Bridge. The H-Bridge is typically an electrical circuit that enables a voltage to be applied across a load in either direction to an output, e.g. motor.
This means you can essentially reverse the direction of current and thus reverse the direction of the motor. It works by having 4 elements in the circuit commonly known as corners: high side left, high side right, low side right, and low side left. By using combinations of these you are able to start, stop and reverse the current. You could make this circuit out of relays but its easier to use an IC – The L293D chip is pretty much 2 H-Bridge circuits,  1 per side of the chip or 1 per motor.
The bit we really care about in all of this is the 2 input pins per motor that do this logic and these, more importantly for our needs, can be controlled from the Arduino board.
You also don’t have to worry about voltage regulation so much because it allows for 2 power sources – 1 direct source, upto 36V for the motors and the other, 5V, to control the IC which can be supplied from the Arduino power supply or since my motor power supply is only 6V I’m going to use this (if the motor supply was higher I would consider using a transistor or voltage regulator). The only thing to remember is that the grounding connection must be shared/ common for both supplies. Below you can see the pin layout for the chip and the truth table showing the output logic.
Pin 1Pin 2Pin 7Function
HighLowHighTurn clockwise
HighHighLowTurn anti-clockwise
HighLowLowStop
HighHighHighStop
LowNot applicableNot applicableStop
Generally speaking most DC motors require a lot more current than the Arduino board can provide for instance the motor that I’m using needs around 5 to 6 Volts. Now I could use a 12 Volt power source for the Arduino, but then its going to drain quickly when it has to power everything, 
You’ll need a few capacitors in this circuit to smooth out the power load to the motors as much as possible to help avoid any spikes and stabalise the current.  using a 50 Volt 10 uF capacitor on the power supply – I suggest you do this as the bare minimum. You could also add in a capacitor for each motor that you use – something like a 220nF multilayer ceramic capacitor should be OK for the small motors.

The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. They are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. 


All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled, and their outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled, and their outputs are off and in the high-impedance state. 

With the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications.





The H-bridge arrangement is generally used to reverse the polarity of the motor, but can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the motor's terminals are shorted, or to let the motor 'free run' to a stop, as the motor is effectively disconnected from the circuit. The following table summarises operation, with S1-S4 corresponding to the diagram above.

Structure of an H bridge (highlighted in red)
S1S2S3S4Result
1001Motor moves right
0110Motor moves left
0000Motor free runs
0101Motor brakes
1010Motor brakes
1100Shoot-through
0011Shoot-through
1111Shoot-through


Darlington Driver 8-Channel ULN2803 DIP





The eight NPN Darlington connected transistors in this family of arrays
are ideally suited for interfacing between low logic level digital circuitry (such
as TTL, CMOS or PMOS/NMOS) and the higher current/voltage
requirements of lamps, relays, printer hammers or other similar loads for a
broad range of computer, industrial, and consumer applications. All devices
feature open–collector outputs and free wheeling clamp diodes for transient
suppression.
The ULN2803 is designed to be compatible with standard TTL families
while the ULN2804 is optimized for 6 to 15 volt high level CMOS or PMOS.


1602 16x2 Character LCD Display Module HD44780 Controller Blue Blacklight 







Operate with 5V DC.
LCD display module with Blue blacklight.
Wide viewing angle and high contrast.
Built-in industry standard HD44780 equivalent LCD controller.
Commonly used in: copiers, fax machines, laser printers, industrial test equipment, networking equipment such as routers and storage devices.
LCM type: Characters
Can display 2-lines X 16-characters.


Standard HD44780 LCDs are useful for creating standalone projects.
  • 16 characters wide, 2 rows
  • White text on blue background
  • Connection port is 0.1" pitch, single row for easy breadboarding and wiring
  • Pins are documented on the back of the LCD to assist in wiring it up
  • Single LED backlight included can be dimmed easily with a resistor or PWM and uses much less power than LCD with EL (electroluminescent) backlights
  • Can be fully controlled with only 6 digital lines! (Any analog/digital pins can be used)
  • Built in character set supports English/Japanese text, see the HD44780 datasheet for the full character set
  • Up to 8 extra characters can be created for custom glyphs or 'foreign' language support


Description

The ’HC595 devices contain an 8-bit serial-in, parallel-out shift register that feeds an 8-bit D-type storage register. The storage register has parallel 3-state outputs. Separate clocks are provided for both the shift and storage register. The shift register has a direct overriding clear (SRCLR) input, serial (SER) input, and serial outputs for cascading. When the output-enable (OE) input is high, the outputs are in the high-impedance state.
Both the shift register clock (SRCLK) and storage register clock (RCLK) are positive-edge triggered. If both clocks are connected together, the shift register always is one clock pulse ahead of the storage register.

Features

  • 8-Bit Serial-In, Parallel-Out Shift
  • Wide Operating Voltage Range of 2 V to 6 V
  • High-Current 3-State Outputs Can Drive Up To 15 LSTTL Loads
  • Low Power Consumption: 80-µA (Max) ICC
  • tpd = 13 ns (Typ)
  • ±6-mA Output Drive at 5 V
  • Low Input Current: 1 µA (Max)
  • Shift Register Has Direct Clear

Technology Family
HC    

VCC (Min) (V)
2    
VCC (Max) (V)
6    
Voltage (Nom) (V)
6    
F @ Nom Voltage (Max) (Mhz)
28    
ICC @ Nom Voltage (Max) (mA)
0.08    
tpd @ Nom Voltage (Max) (ns)
34    
Output Drive (IOL/IOH) (Max) (mA)
7.8/-7.8    
Input Type
CMOS    
Output Type
CMOS    
3-State Output
Yes    
Rating
Military    
Operating Temperature Range (C)
-40 to 85    






  • DESCRIPTION


    Add lots more outputs to a microcontroller system with chainable shift registers. These chips take a serial input (SPI) of 1 byte (8 bits) and then output those digital bits onto 8 pins. You can chain them together so putting three in a row with the serial output of one plugged into the serial input of another to make 3 x 8 = 24 digital outputs. You can chain pretty much as many as you want. This makes it easy to control a lot of outputs like LEDs from only 3 digital microcontroller pins.

    This item contains three 74HC595 chips!

    These chips are DIP package so you can easily plug them into any breadboard or perfboard with 0.1" spacing. The digital outputs are good for about 20mA, which makes them ideal for LEDs or driving power transistors (say for controlling a lot of solenoids).


Serial to Parallel Shifting-Out with a 74HC595

Shifting Out & the 595 chip
At sometime or another you may run out of pins on your Arduino board and need to extend it with shift registers. This example is based on the 74HC595. The datasheet refers to the 74HC595 as an "8-bit serial-in, serial or parallel-out shift register with output latches; 3-state." In other words, you can use it to control 8 outputs at a time while only taking up a few pins on your microcontroller. You can link multiple registers together to extend your output even more. (Users may also wish to search for other driver chips with "595" or "596" in their part numbers, there are many. The STP16C596for example will drive 16 LED's and eliminates the series resistors with built-in constant current sources.)
How this all works is through something called "synchronous serial communication," i.e. you can pulse one pin up and down thereby communicating a data byte to the register bit by bit. It's by pulsing second pin, the clock pin, that you delineate between bits. This is in contrast to using the "asynchronous serial communication" of the Serial.begin() function which relies on the sender and the receiver to be set independently to an agreed upon specified data rate. Once the whole byte is transmitted to the register the HIGH or LOW messages held in each bit get parceled out to each of the individual output pins. This is the "parallel output" part, having all the pins do what you want them to do all at once.
The "serial output" part of this component comes from its extra pin which can pass the serial information received from the microcontroller out again unchanged. This means you can transmit 16 bits in a row (2 bytes) and the first 8 will flow through the first register into the second register and be expressed there. You can learn to do that from the second example.
"3 states" refers to the fact that you can set the output pins as either high, low or "high impedance." Unlike the HIGH and LOW states, you can"t set pins to their high impedance state individually. You can only set the whole chip together. This is a pretty specialized thing to do -- Think of an LED array that might need to be controlled by completely different microcontrollers depending on a specific mode setting built into your project. Neither example takes advantage of this feature and you won"t usually need to worry about getting a chip that has it.
Here is a table explaining the pin-outs adapted from the Phillip's datasheet.
PINS 1-7, 15Q0 " Q7Output Pins
PIN 8GNDGround, Vss
PIN 9Q7"Serial Out
PIN 10MRMaster Reclear, active low
PIN 11SH_CPShift register clock pin
PIN 12ST_CPStorage register clock pin (latch pin)
PIN 13OEOutput enable, active low
PIN 14DSSerial data input
PIN 16VccPositive supply voltage

Example 1: One Shift Register

The first step is to extend your Arduino with one shift register.

The Circuit

1. Turning it on

Make the following connections:
  • GND (pin 8) to ground,
  • Vcc (pin 16) to 5V
  • OE (pin 13) to ground
  • MR (pin 10) to 5V
This set up makes all of the output pins active and addressable all the time. The one flaw of this set up is that you end up with the lights turning on to their last state or something arbitrary every time you first power up the circuit before the program starts to run. You can get around this by controlling the MR and OE pins from your Arduino board too, but this way will work and leave you with more open pins.

2. Connect to Arduino

  • DS (pin 14) to Ardunio DigitalPin 11 (blue wire)
  • SH_CP (pin 11) to to Ardunio DigitalPin 12 (yellow wire)
  • ST_CP (pin 12) to Ardunio DigitalPin 8 (green wire)
From now on those will be refered to as the dataPin, the clockPin and the latchPin respectively. Notice the 0.1"f capacitor on the latchPin, if you have some flicker when the latch pin pulses you can use a capacitor to even it out.

3. Add 8 LEDs.

In this case you should connect the cathode (short pin) of each LED to a common ground, and the anode (long pin) of each LED to its respective shift register output pin. Using the shift register to supply power like this is called sourcing current. Some shift registers can't source current, they can only do what is called sinking current. If you have one of those it means you will have to flip the direction of the LEDs, putting the anodes directly to power and the cathodes (ground pins) to the shift register outputs. You should check the your specific datasheet if you aren"t using a 595 series chip. Don"t forget to add a 220-ohm resistor in series to protect the LEDs from being overloaded.

Circuit Diagram

The Code

Here are three code examples. The first is just some "hello world" code that simply outputs a byte value from 0 to 255. The second program lights one LED at a time. The third cycles through an array.
logic table
595 Logic Table
logic table
595 Timing Diagram
The code is based on two pieces of information in the datasheet: the timing diagram and the logic table. The logic table is what tells you that basically everything important happens on an up beat. When the clockPin goes from low to high, the shift register reads the state of the data pin. As the data gets shifted in it is saved in an internal memory register. When the latchPin goes from low to high the sent data gets moved from the shift registers aforementioned memory register into the output pins, lighting the LEDs.

Example 2

In this example you'll add a second shift register, doubling the number of output pins you have while still using the same number of pins from the Arduino.

The Circuit

1. Add a second shift register.

Starting from the previous example, you should put a second shift register on the board. It should have the same leads to power and ground.

2. Connect the 2 registers.

Two of these connections simply extend the same clock and latch signal from the Arduino to the second shift register (yellow and green wires). The blue wire is going from the serial out pin (pin 9) of the first shift register to the serial data input (pin 14) of the second register.

3. Add a second set of LEDs.

In this case I added green ones so when reading the code it is clear which byte is going to which set of LEDs

Circuit Diagram

The Code

Here again are three code samples. If you are curious, you might want to try the samples from the first example with this circuit set up just to see what happens.
Code Sample 2.1 Dual Binary Counters
There is only one extra line of code compared to the first code sample from Example 1. It sends out a second byte. This forces the first shift register, the one directly attached to the Arduino, to pass the first byte sent through to the second register, lighting the green LEDs. The second byte will then show up on the red LEDs.
Code Sample 2.2 2 Byte One By One
Comparing this code to the similar code from Example 1 you see that a little bit more has had to change. The blinkAll() function has been changed to the blinkAll_2Bytes() function to reflect the fact that now there are 16 LEDs to control. Also, in version 1 the pulsings of the latchPin were situated inside the subfunctions lightShiftPinA and lightShiftPinB(). Here they need to be moved back into the main loop to accommodate needing to run each subfunction twice in a row, once for the green LEDs and once for the red ones.
Code Sample 2.3 - Dual Defined Arrays
Like sample 2.2, sample 2.3 also takes advantage of the new blinkAll_2bytes() function. 2.3's big difference from sample 1.3 is only that instead of just a single variable called "data" and a single array called "dataArray" you have to have a dataRED, a dataGREEN, dataArrayRED, dataArrayGREEN defined up front. This means that line
data = dataArray[j];
becomes
dataRED = dataArrayRED[j];
dataGREEN = dataArrayGREEN[j];
and
shiftOut(dataPin, clockPin, data);
becomes
shiftOut(dataPin, clockPin, dataGREEN); 
shiftOut(dataPin, clockPin, dataRED);