Bi Flasher With and Without Microcontroller

by Arnov Sharma in Circuits > LEDs

1553 Views, 15 Favorites, 0 Comments

Bi Flasher With and Without Microcontroller

MainThumbs.jpg
9uiugu.jpg
01 (24).gif
IMG_20211114_171408.jpg

Hey Everyone Whazzup!

So you want to make a PCB Badge and in that badge, you want to add a simple Two LED Flasher circuit in which Two LEDs will turn HIGH and LOW simultaneously.
This task can be done quite easily with or without a microcontroller.

Using a Microcontroller is good but for such a minimal task, a timer ic could also be used here which would save a lot of costs.

In this Instructables, I'm gonna show you guys how you can use a Microcontroller (Arduino Nano and Attiny13A) and a simple Timer IC Setup to make a Bi Flasher with minimal stuff and Low cost.


Let's get started

Supplies

I will use two types of setups in this project so the following are stuff required in both setups.

Microcontroller Setup

  • Attiny13A
  • LED Red and Green
  • Power Source (can be anything, coin cell, 3.7V battery, Bench Power supply)
  • Arduino as ISP Programmer setup
  • Breadboard
  • jumper wires etc

555 Timer IC Setup

  • 555 Timer IC
  • LED Red and Green
  • 22uf Capacitor
  • Power Source (can be anything, coin cell, 3.7V battery, Bench Power supply)
  • 68k ohms 1/W Resistor
  • 1K Ohms 1/W Resistors

Procuring Materials

04 (33).gif

As for the Source from where I get most of these components, I got the Timer ICs, Attiny13, LEDs, Resistors, and capacitors from ALLCHIPS.

ALLCHIPS is a well-known Platform For Electronic Components Supply, they have everything that you need for any type of project. They are an all-in-one procurement department of hardware manufacturers as all components I used in this project were provided by ALLCHIPS which was a cool and helpful thing!

Also, they have this BOM IN ONE BOX thing which is such a helpful thing, we provide them a BOM List and they procure all the components and deliver them "IN ONE BOX" which is an efficient way of purchasing components for any project!
Check out ALLCHIPS for more info.

Getting Started

17 (22).gif
5 (2).gif
IMG_20211113_002516.jpg

Before Setting up both versions of a Bi Flasher circuit, let first see where and how we can use Bi Flasher setup.

I've been making some PCB Badges recently, these PCB Badges are a combination of Art and Electronics in which we add some artistic elements on a PCB like a character from anime or movie or just a few patterns. we also add LEDs on these badges to illuminate certain aspects of that added character or pattern.

For example, I made a C3PO PCB Badge from Starwars.

I've placed LEDs in his eyes and to control these LEDs, I have used the Bi-Flasher setup which is based on 555 timer IC in the SOIC package.

What I'm trying to say here is, this LED Flashing-Blinking setup increases the impact of the whole Circuit and it also looks pretty awesome. If you want to see the whole Badge making process, check this post of mine-

https://www.instructables.com/Obito-Uchiha-PCB-Bad...

Microcontroller Setup

Capture3.PNG
01 (33).gif

Let's first start with the easiest method in the Book which is to utilize a microcontroller to control LEDs.

The first choice here would be an Arduino board connected with two or more LEDs. This one is by far the easiest set up to make such projects.

Wire the LEDs with Arduino Nano in this way.

  • D3 to VCC of GREEN LED
  • D2 to VCC of RED LED
  • GND of Both LEDs to GND of Arduino

​Here's the Code for Chasing/Bi Flashing of Two LEDs.

int pinsCount=2;             // declaring the integer variable pinsCount 
int pins[] = {2,3};          // declaring the array pins[] 

void setup() { 
pinMode(2, OUTPUT); 
pinMode(3, OUTPUT); 
} 

void loop() { 
 for (int i=0; i0; i=i-1)
  {                                   // chasing left (except the outer leds) 
digitalWrite(pins[i], HIGH);         // switching the LED at index i on 
delay(70);                          // stopping the program for 100 milliseconds 
digitalWrite(pins[i], LOW);          // switching the LED at index i off 
} 
}

Attiny Setup

02 (34).gif
Capture4.PNG

Now, using Arduino was a lazy method which is not efficient enough for a small PCB badge project, we can argue here that the Atmega328AU can be used instead of the whole board but that will be still overpowered setup as Atmega328 here contains lots of IO Pins and it would be a waste to use such an MCU just for blinking two or three LEDs.

Also, Atmega328 or the Arduino Nano board costs a lot and it would be unwise to use such costly MCUs in a simple project. Instead of using an Atmega328 or even the Arduino board, we can use similar Arduino-friendly MCUs instead of any of the Attiny Series MCUs. Let's take Attiny13 as an example.

Attiny13A is a Microchip picoPower® 8-bit AVR® RISC-based microcontroller that features 1 KB of ISP Flash, 64B EEPROM, 64B SRAM, 32B register file, and 4-channel 10-bit A/D converter. The device achieves up to 20 MIPS throughput at 20 MHz at 1.8-5.5V operation. Pretty solid for LED driving projects. This device is perfect for such a minimal application which requires controlling 2-3 different loads with a switch or some simple sensor toggle circuit.

See the attached pinout for Attiny13A, it's the same as Attiny85 but with few internal changes. but the PWM Pins are all same in both MCUs.

Attiny85 and Attint13 share the same package and thus the same I/O pin config.
In the Above Pinout, we connect the VCC of Green LED to Pin 0 which is PB0 and the VCC of Red LED to Pin 1 which is PB1.

We use the same code as used in Arduino Nano but instead of Pin 2 and 3, we declare 0 and 1.

int pinsCount=2;             // declaring the integer variable 
pinsCountint pins[] = {0,1};          // declaring the array pins[]

void setup() 
{
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
}

BUT HOW TO PROGRAM AN ATTINY?

20200608_221758.jpg
IMG_20201026_201827.jpg

I have used this Arduino as an ISP programmer which I made last year. It's an Arduino nano that has its SPI Pins breakout for connecting Attiny85 or Attiny13A with it to flash the Attiny MCU. If you want to know how this setup works then definitely check out this post of mine.

https://www.instructables.com/Multiple-ATtiny8513A...

The above Setup is a Plug and play programmer, we put the Attiny on any 6 DIP Sockets.

By doing this, Attiny's SPI Pins get connected with the Arduino's SPI Pins. Before starting the flashing process, we need to install the board files for attiny13 first which can be downloaded from here- https://github.com/MCUdude/MicroCore

Install them and then proceed with this next step.

  • We open the Arduino IDE first.
  • We first select the right MCU which is attiny13 in our case and do not forget to choose the right com port.
  • then we select the right programmer which is in our case "Arduino as ISP"
  • then we hit on the Burn Bootloader option which will take a few seconds.
  • Now we go to the sketch menu and select the "Upload using Programmer" Option and BANG.

you have successfully uploaded a sketch to this Attiny13 MCU. You can do this process without this Custom Programmer. Just take any Arduino Board (best would be UNO or NANO) and flash it with Arduino as ISP sketch which can be found in the example menu.

After uploading the sketch to the Arduino board, we add a 1uF 16V Capacitor between Pin Reset and GND of Arduino board.

This Arduino board will now act as an ISP Programmer.

  • Now we start by connecting the VCC of the Arduino as ISP to the VCC of Attiny.
  • GND to GND
  • Reset to pin D10 (of Arduino Nano)
  • Mosi to pin D11 (of Arduino Nano)
  • Miso to D12 (of Arduino Nano)
  • and SCK to D13 (of Arduino Nano)

The flashing process will remain the same, we select the right MCU and burn the bootloader and then upload the sketch in it.

555 Timer IC Setup

555-timer-dual-led-flasher.gif
04 (24).gif
03 (23).gif

Now let's get back to the past and revisit an easy-to-make circuit with the infamous Mighty 555 Timer IC.

The 555 timer IC is a clock generator, which means it's a circuit that may be connected to a stable or a monostable multivibrator.

In easy words, it's a monolithic timing circuit that can produce timing pulses which 50 or 100% Duty cycle.

To set up a Bi Flasher circuit, I used the above-attached schematic and place everything on a breadboard.

As for the power source, we can supply voltage from 3V to 9V to this setup.

I'm using a 3.7V Lithium Cell in this case. Flash rate can be controlled by changing the value of the C1 Capacitor. use 22uF for a slow flash rate. using a 10uF Cap will increase the flash rate.

I've implemented this 555 Bi-Flasher circuit in two of my PCB Badge Projects which are these two.

https://www.instructables.com/Yet-Another-Badge-a-...

https://www.instructables.com/C-3PO-Blinky-Board/

CONCLUSION

IMG_20211114_171417.jpg

Both setups are working but which one was better? the Microcontroller setup or the timer ic one.

Sure this is a dumb question to ask, Attiny Setup is the winner here in terms of both portability and minimalism.
We only require a couple of components in the Attiny setup if compared with 8-9 components needed in the 555 timer IC Setup. Attiny13 Costs around 1$ and Timer IC could be purchased for 0.5$ which is a very low price tag but with timer IC we need to use a few more components that add cost and in the end, the cost of both setups is almost the same.

So in the END, it doesn't matter what you use, it all depends on what you want to make and how many LEDs you want to drive, use 555 timer ic for 1-2 LEDs and use Attiny13 for more complex projects like toggling a load when a sensor receive any reading or something.

Well, this is it for today guys. Check out my previous PCB Badge project that was based on 555 timer IC if you're a timer IC Enthusiast. And I'll be back with another project soon!