Wednesday, 2 July 2014

Extremely simple multiplexing example

So in this very simple example I use the famous RGB Leds.

The LEDs have 4 legs: 3 of them are used for selecting the colour basically, applying different voltages will result in different colour tones. The 4th pin is the GND: when grounded, the LED will turn on. So, on the Arduino board, we are using 4 pins, all connected to the LED. But what if we want 2 LEDs? Do we need 8 pins? Well not necessarily.

We can use transistors to solve this problem. For this example I used NPN (BC548)

Both LEDs have the RGB legs connected to the Arduino, whereas their ground pins don't go the same way. They go to their respective transistor's collector . These transistors have their emitter pins connected to ground and the base goes to 2 different pins on the Arduino. Basically, when setting high these pins (connected to the base) we turn the transistors on and, by doing so, the LEDs are grounded and they will turn on. Now we can also select which LED we want to light up.

Here's the schematics:




Here's a short demo.


The LED colours are set for random, so they change every 500ms.

We'll see later how to obtain 2 different colours.

The code is very easy. Simply set to high the pin connected to whichever transistor you want tu turn on and use the analogWrite for the RGB pins, so you can get different colours.




Tuesday, 1 July 2014

Reaction Timer

This is another school project, a simple circuit used for practising troubleshooting.

I cannot release the schematics as they are not mine to give.

How it works: this circuit simply measure the time it takes to release the first button and press the second one. When the first push button is pressed, the timer is reset (and the buzzer sounds). As soon it's released, the timer starts counting and it will stop when the second push button is pressed. On the displays we can see the time.

Here's a short demo:





The main components are 4 chips : a 74LS76 (Dual JK Flip-Flop), a 74LS10 (triple 3 input NAND gate) and two 74LS90 (Counter).

That big trainer you see, where the breadboard is attached is once again a school project. In our very first semester we had to build one of these babies here, from bending the metal to soldering all the components.
It's then used throughout the whole course for several other units.