Explained Schematics

  1. 1 Watt LED Transistor Driver
  2. LM393 Comparator Circuit
  3. Decade Counter
  4. LDR/Thermistor Circuit
  5. Pull Up Resistors
  6. 555 Astable Clock Generator
  7. 555 Monostable Trigger Circuit
  8. Counter Circuit
  9. Thermistor and Light Dependent Resistor (LDR) Circuits
  10. Stepper Motor Controller
  11. Driving Dot Matrix Displays


1 Watt LED Transistor Driver

ledtrans

In LEDLabs this circuit allows micros etc to drive a heavier load than there output pins can sink and source, which could be typically 10-20ma,
as these 1 watt leds consume upto 350ma a collector driven load circuit is used, known as the common emitter
the bc337 transistors can handle up to around 800ma of collector current   we want to drive a load current of around 150ma, not the maximum of 350ma (as will be to bright) so from the data sheet for the bc337, the hfe or gain of the transistor is around 100 @ 100ma and as low as 60 for 300ma so for base resistor ib=ic/hfe = .150/100= 2ma. As there is a .7v drop across base-emitter, our equation is 5v-.7 = 4.3v
so.. 4.3/.002 = 2150 ohms, we want to ensure the transistor is in full saturation and operating as a switch, and not in its linear region,
we factor in a saftey margin of at least half times this value and have chosen a 1k resistor, this will ensure the transistor will fully saturate and switch on.

So we want to drive an led at around 150ma and the data sheet shows us we can go upto about 350ma the forward voltage drop across the led is 3.2v. We will require a current limiting resistor (r2) we will factor in the voltage drop (vce) across the transistor switch, the data sheet shows that vce(sat) = 1v max, these conditions are for high current and voltage which we are not using so .3v is the most likely and will use this here.

So we have: Vsupply=vr2 + vled + vce
rearranging this give us vr2 = vsupply – vled – vce = 5 – 3.2 – .3 = 1.5v
we know that r2 will drop 1.5v and the current will be 150ma

Ohms law says r=v/i = 1.5/.150 = 10 ohms so the power is = vxi = 1.5vx150ma = 225mw or .22w for the resistor.

This is the minimum resistor value to gain maximum brightness. (this is assuming that 150ma was the maximum led current) to keep within safe tolerances use resistor values higher than the calculated value if maximum brightness is not required.

These kind of leds maximum current is upto 350ma, but we dont need them this bright, so have based it on around 150ma, and there is a variable brightness adjust resistor, which we dont want to exceed its max power rating which is typically upto 150mw and when this is adjusted it can share up to half of the load of the other resistor at a certain point.
The other useful reason for this transistor type driver, is it can power higher voltage circuits, this transistor can be connected to a 12 volt supply as its ratings of vceo is 45v.

Example, if this board was powered by a 12 volt source, the circuit would have a 5 volt regulator for the micro, then this transistor circuit could be wired straight back to the 12 volt line. This would change the equation above,
the supply voltage – the forward voltage drop of led/Led current would = 12v-3v = 9v/150ma = 60 ohms. Rated at 1.35w.
The main reason for connecting to a higher source is that a component like a 9 volt buzzer might want to be used, this circuit at 5 volts would not be high enough to drive it. As the large leds above do not require maximum brighness for this project board, a higher value of resistor is chosen, this makes the leds run dimmer, and consequently reducing the power. However they still are bright enough.
Care should be taken when switching on any of the larger Leds as they are very bright when the variable brightness is set high and should avoid looking directly into them, always make sure the brightness is set low first. The 20R resistor can be changed to say a 100R to reduce further if required. The 20R resistor sets a current of around 110ma, and not there maximum range of 350ma which is to bright for this purpose, and also sets a lower continuous dc current for the transistor driving them, should they be on permanantly.         UV should not be looked directly into, as the peak wavelength can not be seen, just the visible side as in the purple colour.

 

Back to top



LM393 Comparator Circuit

 

opamp

The LM393 dual comparator is used in this circuit, the power supply is pre-wired to the board, and the inverting input to one of the comparators is wired to a 10k potentiometer in order to set the reference voltage.
An output connector is available to measure and set this voltage, this can be measured by connecting it to the lm3914 voltage input connector.
The other comparator is left open for free use, but has the power supply wired.

The lm393 is open collector, so will require a load or pull-up resistor connected from its output to the +ve rail. In one of the comparator circuits a  load/pullup resistor is used, which offers the voltage drop required and toggles a red led and a green led
these represent: Red led: High output, and green led: Low output.
When the ldr etc is connected to the non-inverting input and gets close to the reference voltage of the comparator, set out by vref and analogue out from ldr circuits, the differential inputs can get very close, and because a signal from an ldr is generally a slow moving signal, this can cause the comparator to oscillate .Which in turn could send several pulses out and confuse micros.
So a small amount of hysteresis is added in the form of a 100k resistor from the output back in to the non inverting input, this gives a nice clean single switch over pulse and helps with circuit stability, it also acts a bit like a schmitt trigger.
This can be connected to the pulse counter on board, or indeed a micro-controller.

 

The other circuits can also be connected to the comparator or pulse counter. The light switch, over temperature and under temperature switches.
The lm3914 voltmeter can be used to set the threshold voltages for the ldr and thermistor circuits and the voltage reference to the comparators, the scale is 0v-3.6v and not 5v as some pcb boards state, so every led on the lm3914 represent 360mv.              Comparator 1, has one input available as the inverting input is connected to a potentiometer, whereas comparator 2 has both inputs available for free use, and can be made to drive given circuits,  which comparator 1 may not, as it has leds already attached. remembering that comparator 2 is open collector and would require a pull-up resistor to provide an output voltage.

 

Back to top



Decade Counter

The counter circuit is formed around the 4026b 7-segment decoder, it is a cmos ic, decade counter, with carry out functions, and can be cascaded for higher maximum counts.
It can drive 7 segment displays without resistors at low voltage, However a series resistor is used which doesn’t compromise brightness to much. a low value, or no resistors can be used and both the IC and resistors and display remains cool at 5v, at higher voltages say 12v, this may not be the case and a suitable series resistor should be worked out using ohms law.
In case of some failure of the 4026 or led segment with no current regulation, if a 330r is used, it would offer protection to the segments of the display at 5v limiting the current to 10ma/segment. This is based on a typical red 7 segment.
Lower value resistors can be used for green and other colours.
The displays are easy to fit in the sils provided, and the colour of display can be changed by just swapping them out of the sil connectors, If say a green display is used, this has a higher voltage drop than red, and depending if using resistors, this could look quite dim at 5v.
Using single resistors maintain an even uniform brightness of each segment, rather than one fixed 100r or 220r connected in series to the 0v pin of the IC.
And can also protect the IC from some kind of overload.
People have there own ideas about using series resistors or not,for this device.

In this circuit a logic 1 or high pulse in cn1 increments the count by one,
or by pressing sw1.
The carry out cn3 at count 10 activates a low – high transition and if connected to cn1 of the next stage would then count to 10, in this 2 stage circuit a maximum of 99 can be realised.

The reset button sw2 will reset the count to zero.This can be acheived by micros by connecting to cn2, and taking high.
The right most 7 segment is the least significant bit (lsb) and the left 7 segment is the most significant bit (msb).

These two displays are independent, so can be used singularly or can be connected together. The pulse counter is ideal for counting pulses from the stepper motor circuit or other actions performed.

The left hand side display can oscillate when not connected to any logic level and is termed as floating, floating inputs on logic gates cause this behaviour. the result been random counting. To stop this behaviour on logic gates the inputs can be tied to a logic level. In LEDLabs, a 560k pull down resistor is used to stop this floating input. If it was not used, connecting the carry out of the far right display to the carry in of the left side display stops this, or if the clock input, is tied to a logic level.

Good practice on unused input logic gates is to tie the unused inputs to a logic level, and never take an output directly to 0v.

Back to top



LDR/Thermistor Circuit

lm393

Four of the various sensor circuits in LEDLabs are in the form of light and temperature, analogue level outputs, comprising light switch / dark switch and over temperature / under temperature these can be set relative to ambient conditions.

An output connector can be used to measure the corresponding analogue voltage level across the potential divider circuits, which in turn can be measured in the lm3914, which scales from 0v -3.6v and not 5v as some pcb boards states. or indeed the op-amp comparator lm393 for sensing.
An analogue input to a micro can also measure this value.

The thermistors used here are 10k negative temperature coefficient (ntc) whose resistance changes with temperature, the lower the temperature the higher the resistance.
A 10k thermistor is a good choice and measures approximately 10k @ 25 degrees, so with a 10k variable resistor a good swing is achieved.

The light dependant resistors (ldr) used here have a dark resistance of around 1M ohm. And whose resistance changes with the amount of light falling on it. The more light falling the lower the resistance.

A voltage divider is shown in (fig1) and is generally made up of two or more resistances, here we are looking at r1 and r2, and vout is the right hand side equation with the remaining voltage left over v1.
So for the ldr circuit above (fig2) in the dark it has high resistance of 1M ohm + and hence has a high vout and acts as a dark activated switch. Under light conditions vout is lower, as the resistance falls of the ldr, and may turn some device off when light falls, if connected to the lm3914 volt meter the voltage and behaviour of these four circuits can be monitored.

Transposing the ldr and resistor, we then have a light switch as (fig3). LEDLabs has an extra 1k resistor in series with a variable resistor making up the dividing network as shown above, the 10k variable can be swept through 1k to 11k to set the levels more precisely, the 1k allows for more finer control and if used to control a transistor, this fixed resistor must be used to stop zero ohm to the base of the transistor.
To work out the series resistor for an ldr circuit, the equation is : r = square root of rmin x rmax, example rmin = 100 ohms rmax = 1Mohm therefore, 100×1000000 and the square root of this product = 10k, so LEDLabs uses a 10k variable,
if the parameters of the ldr is not known from data sheets, it can be measured under both conditions, to find rmax and rmin measure the resistance when in total darkness and similarly with bright light falling upon it.

Back to top



Pull Up Resistors

pullup

LEDLabs has a set of pull-up resistors and pull-down resistors, as fig1 shows, this is useful for micro-controllers, as some pin ports require pulling up or down through a given value resistor to the voltage rail, however some now have embedded pullups.
Various logic ic’s also require these, particularly when interfacing between two types of technologies, for example TTL and CMOS.
It also ensures that a pin is at a logic level either 5v or 0v, so it is not ‘floating’ which could cause oscillation and erratic behaviour by the ic monitoring this. It could take the input as a logic 1 or logic 0.

Two leds, red for high and green for low are just opto indicators for the set of pullups. LEDLabs also has two button commands one with a pull-up resistor and one with a pull-down resistor as seen in (fig2).
When sw1 is pressed this pulls down cn1 to 0 volts so is active low when sw2 is pressed this pulls up cn2 to 5 volts so is active high.
So these are useful tools for micro-controllers and various other logic.

Two crystal oscilators are on board as shown in (fig3) a 4mhz and a 16 mhz with 22pf capacitors for quick connection to micro-controller pins if required. Also the zif socket can be used for add on sensor modules, as it has breakout connections.
8 leds of various colours as shown above in (fig4) are indicators for an 8 bit port test, they are all common to the 0 volt rail, and will light when port pins are active high (logic 1).

The micro-controller port has connections to ‘breakout’ to other circuits etc as shown in (fig5). a switch on LEDLabs is available for free use and not connected as fig6 a spare buzzer is also available, and has a 100r resistor to limit current flow and a reverse biased diode for protection.

Back to top



555 Astable Clock Generator

555astable

The 555 timer module gives a variable frequency clock generator, of square waves.
The frequency is varied through a potentiometer (vr1) and a set of four dip switch settings which change the capacitance, which allows for 10hz, 200hz, 5khz, and 50khz.

By selecting the dip switch 1 with the others off will allow the slower range of frequencies then sweeping (vr1) to its maximum will end that range,
this can be seen through the repeater led as blinking.

If higher frequencies are required turn off dip switch 1 and select dip switch 2 for the next set of frequencies and so on.
As frequency increases the led will flash that fast that it becomes out of our persistence of vision and appears on all the time.
Clock pulses or serial trains, are useful for toggling logic gates or been read by a micro’s serial interface.
if this output is fed into the 4026b counter,you can see how this toggle effect works.

Back to top



555 Monostable Trigger Circuit

monostable

The 555 timer is wired as a monostable delay/trigger circuit.
The timing is acheived through the rc network, vr1 c2 capacitor and r2.
A larger capacitor will allow for longer delays a 220uf is used here in LEDLabs
with a 470k variable which gives around about 1 second delay to a couple of minutes or so.

If the variable is moved to a given setting, switch 1 can be pressed to see how long the delay lasts for, an led light and sounder is triggered.
When a signal from a micro etc goes active low, this will trigger the module, this is a very useful tool for making sure an event has happened, and can be audiable or visually realised when program testing.

A reverse bias diode is across the coil of the buzzer in case of any back emf generated, which could damage the 555 timer.

Back to top



Counter Circuit

counter

The counter circuit is formed around the 4026b 7-segment decoder.
It is a cmos ic, decade counter, with carry out functions, and can be cascaded for higher maximum counts.
In this circuit a logic 1 or high pulse in cn1 increments the count by one, or by pressing sw1.

The carry out cn3 at count 10 activates a low – high transition and if connected to cn1 of the next stage would then count to 10, in this 2 stage circuit a maximum of 99 can be realised.
The reset button sw2 will reset the count to zero.This can be acheived by micros by connecting to cn2, and taking high.
The right most 7 segment is the least significant bit (lsb)
and the left 7 segment is the most significant bit (msb).
These two displays are independent, so can be used singularly
or can be connected together.

The pulse counter is ideal for counting pulses from the stepper motor circuit or other actions performed.

Back to top



Thermistor and Light Dependent Resistor (LDR) Circuits

ldrtherm

Four of the various sensor circuits in LEDLabs are in the form of light and temperature, analogue level outputs,
comprising light switch / dark switch and over temperature / under temperature these can be set relative to ambient conditions.
An output connector can be used to measure the corresponding analogue voltage level across the potential divider circuits,
which in turn can be measured in the lm3914, or indeed the op-amp comparator lm393 for sensing.
An analogue input to a micro can also measure this value.

The thermistors used here are 10k negative temperature coefficient (ntc) whose resistance changes with temperature,
the lower the temperature the higher the resistance.
A 10k thermistor is a good choice and measures approximately 10k @ 25 degrees, so with a 10k variable resistor a good swing is achieved.
The light dependant resistors (ldr) used here have a dark resistance of around 1m ohm. And whose resistance changes with the amount of light falling on it. The more light falling the lower the resistance.

A voltage divider is shown in (fig1) and is generally made up of two or more resistances, here we are looking at r1 and r2, and vout is the right hand side equation with the remaining voltage left over v1.

So for the ldr circuit above (fig2) in the dark it has high resistance of 1m ohm + and hence has a high vout and acts as a dark activated switch.
Under light conditions vout is lower, as the resistance falls of the ldr, and may turn some device off when light falls, if connected to the lm3914 volt meter the voltage and behaviour of these four circuits can be monitored.
Transposing the ldr and resistor, we then have a light switch as (fig3).

LEDLabs has an extra 1k resistor in series with a variable resistor making up the dividing network as shown above,
the 10k variable can be swept through 1k to 11k to set the levels more precisely, the 1k allows for more finer control
and if used to control a transistor, this fixed resistor must be used to stop zero ohm to the base of the transistor.
To work out the series resistor for an ldr circuit, the equation is r = square root of rmin x rmax, example rmin = 100 ohms rmax = 1m ohm therefore 100×1000000 and the square root of this product = 10k, so LEDLabs uses a 10k variable,
if the parameters of the ldr is not known from data sheets, it can be measured under both conditions,
to find rmax and rmin measure the resistance when in total darkness and similarly with bright light falling upon it.

Back to top



Stepper Motor Controller

stepper

The stepper motor controller IC used is a ULN2003, which has seven npn darlington pair transistors which are known as current amplifiers, each having a reverse biased diode inbuilt to clamp any back EMF transients caused by switching inductive loads.
Stepper motors have coils so are therefore inductive, and the diode inbuilt protects the transistors from potentially high switching voltages.

This is a good interface IC to drive heavier loads, as it has high current gains formed by the darlington pair transistors, which are open collector and are in common emitter configuration, and can drive up to 500ma  (single channel) less for more than one channel conducting continuous see data sheets for exact amounts and current vs switching cycles.
The ULN2003 is not limited to driving stepper motors, as they are quite versatile and can drive relays, solenoids, filament lamps led displays etc, when using these in different circuits other than LedLabs., led labs stepper motor driver is just for low power motors like STEPPER MOTOR 5V 4-PHASE 28BYJ-48.

The stepper motor bit pattern led indicators A B C D, will show which phase is switched on and how fast they are switched on.
The five port connector drives the four phases of the motor and the common.
The four port input comes from a micro or some other timed switching controller.

Back to top



Driving Dot Matrix Displays

 

 

LEDLabs is equipped with an onboard atmega 328p micro-controller; the same controller used for the Arduino.
This can be programmed insitu, by simply connecting the tx and rx and reset and common ground to the inputs of led labs from the uno board.

Two dot matrix displays are driven by the max 7219 driver integrated circuits, which have a data, load, and clock connectors,     The clocks, should be linked together as should the load pins, and data out to data in should be linked for both displays, then inputs from the micro to the clock, data, and load pins to drive these.   these can be controlled by the atmega 328p, and reprogrammed without moving the chip, by connecting the rx, tx, reset and common ground pins of the arduino uno board.

The 2x 10k resistors to set the total current near the displays can be changed to 27k or 47k, which will be less bright, but will not clobber the power supply as much, if experiencing any significant voltage drops in the power supply.
A boot loader may have to be installed on the atmega328p to match the programmer board used, and information on this is available on the arduino website, using the arduino as a avr isp.
If the atmega was removed from the uno board and placed in LedLabs it would work straight away as it matches programmer, and can be programmed insitu, by connecting rx, tx, rst, and 0v from the uno board to led labs. If using the uno board, when purchasing the atmega328pu micro-controller chip  on its own, purchase with uno boot loader already installed.  In any case,  the atmega328pu  ic should be removed from the uno board when programming the led labs board.
Other Micro’s such as the pic can also control the displays.
If no particular program is running on the dot matrix displays, it will just have random data loaded and may flash or light all segments when not in use, if the data in to the max7219 (near the displays) is taken to 0v, this should blank the display and save power. The inputs have been left floating, to avoid any type of driving problems from various technologies.

LEDLabs has 3 x 8 bit shift registers, forming a 24 led propagation fountain, very good effects can be seen on the display, such as walking ‘ones’, or even sharing the data line which controls the dot matrix displays, (when it is running) to the data input of the shift register, and clock from the 555 astable circuit on board to slow the clocking down.

It has output enable always on. 3 connectors are provided, one for the strobe and data and clock
The registers shift automatically to the next device. These can be used from the atmega or pic, or other ways. If not in use taking the input strobe pin to ground should blank the display or it can be just left as is. The switches on ledlabs  can feed data 0’s in to the registers to blank the leds if required, see manual use of shift registers in the project section.

The shape of the led propagation fountains  last set of leds are arranged intentionally, because this can show how data bottle necks happen, when running a walking ones sort of programme.  (it gives a good type of visual effect).
Analogue inputs and digital pins including PWM, are accessible on LEDLabs Which can receive input signals from LEDLabs, and act on them, and also output to the LEDLabs board, or indeed any other circuit or device, if another circuit is used make sure to connect the ground from LEDLabs to the ground on the other device, to ensure they use a common ground, or undesirable effects may be noticed like program code not working correctly.

Other micro’s are programmed in the usual way through their programmers, then the micro removed and placed in Led Labs. some programming boards such as Raspberry pi have output connectors, which can be linked to devices on LedLabs, just connecting the ground from one of these programmers to LedLabs to common them together.

 

 

 

CD 4046 VOLTAGE CONTROLLED OSCILLATOR

vcoupload
VCO, SHOWING THE PHASE OF BOTH INTERNAL COMPARATORS

 

 

 

 

 

 

 

 

 

 

This circuit uses the 4046 VCO/PLL IC, Voltage controlled oscillator and phase locked loop, and using this very versatile chip in its basic form to change frequency output (vco_out) when the input voltage changes (vco_in). These chips contain 3 main parts inside a phase detector comparator, a low pass filter(integrator) and a voltage controlled oscillator, whose frequency output  is proportional to voltage input.                                                                                                                           The phase locked loop will try to lock or maintain the frequency after comparisons of the two signals vi and vosc by the phase comparator, When  a phase lock occurs,  pin1 and pin2 outputs of the two comparators can be taken to a logic gate and a lock indicator /detector circuit could be attached, the output of these comparators on pin 1 and pin 2 of the cd4046, are a set of pulses whose widths are proportional to the difference between it’s two input signals, where pin 1 is normally high, and pin 2 is normally low, except for the pulses, the output current capability is low up to a couple of milliamps/pin on these outputs, (see data sheets) so from 5v with a red led a 4.7k should be okay to use, enough to see the pulsing.             The output of the VCO is usually better fed in to the input of the audio amp particularly for audio sounds.                                                         See projects section for  vco circuit.

 

 

LM386  AUDIO AMP

 

AUDIOUPLOAD
LM386 WITH SPEAKER ATTACHED

 

 

 

 

 

 

This small amplifier is set internally with a gain of 20 and is usually okay for general use, if for whatever reason, more gain is required a 10uf electrolytic capacitor connected to pin 1 and pin 8 will increase it by a factor of 10 to a gain of 200, however this will have to be soldered beneath the board across pin 1 and pin 8 as shown in diagram above.

The circuit module has an input with volume control, this can be controlled with the 10k trim pot, however its right on the cusp and would have to trim the pot slow. A logarithmic  trimmer would work best here rather than a linear type for better control. This also has an output to drive the speaker module too.

 

 

Back to top