Search This Blog

Powered by Blogger.

Translate

[TC] Clock Using 8 Seven Segment LED displays


The 8 times seven segments display induced me making this clock device. The design principle is: show the wiring and the electronics!
After testing with the Arduino and a breadboard I decided to make some examples on PCB. Also the scripting went on and on and on, making all kinds of variations and fun. This has made this instructable quite big! Also, this instructable invites you to explore further...

Day of Month - Hour - Minutes - Seconds
Because there are 4 positions I decided to show day of the month, hour, minutes seconds. Generally I can still remember the month I live in. The seconds makes the thing "alive". But because most of these clocks show month, day, hour, and minutes and blink with a semicolon, the displays still feels a bit "strange": sometimes people say: the hour is wrong, because they mistake the first two digits as "hour", not as day of the month.

The main problem is not showing the time, but doing the interfacing: doing settings on two buttons available are always a bit clumsy.

The challenge for me is to do more with the display then just showing time: making as much of the alphabet and words appear on the screen as possible or play with some nice patterns.



Step 1: Testing setup


Programming the ATmega328 is done on the Arduino. (Later on this programmed chip is plugged into the PCB.)

Testing is done as close to the Arduino as possible with the modules either connected to the Arduino, or using a breadboard. Although I know this myself and write it here, again I went too quickly making the PCB's and inserting the chips. So discovering a flaw or adding to the possibilities I had to change the chips over and over again. My advice (to myself) is to test longer using the Arduino and breadboard!

In the picture you see the basic connections, for the two timer modules.
Later there are two push buttons added connected to PINS 8 and 9. And if you like dimming then an LDR is connected (paired with a resistor) to PIN 14 (A0). These basic connections are (of course) the same for the PCB's in later steps of this instructable.

Since I have two time devices, one with an ds1302 and one with a ds1307, the connections with the timer module may differ. Also there are two scripts in the repository, depending on your time module, because ds1307 uses I2C and ds1302 uses a 3 wire connection.

Step 2: Electronic components














The component list is rather reduced, since most of the wiring is already done on the modules.

Arduino

The usual, with a breadboard and some jumper wires this is great prototyping. For the time pieces I reduced to a stand alone Atmega chip.

Stand alone atmega328.
For the "barebones" PCB later on. I added a cap for the voltage suspecting that powering it up was giving a problem with the timer module. See step: "Your Own PCB instead of Arduino" for components on the PCB:
Atmega328
holder for this chip
100micro F cap
2 resistors 1K
2 pushbuttons for the settings
female connectors with 5 PINs.
connector for the power cable
extra:
LDR for dimming, together with a 2 K resistor

display (8 seven segment number displays)
http://dx.com/p/8x-led-display-digital-tube-module...
This display communicates with 3 wires (plus voltage and GND) with the arduino. I have used the usual POV structure, using the timer interrupt to provide each number display very fast pretending to have written to all the displays. (See code.)
This display started of this project!

time keeping chip / timer module
I had a ds1307 from dx.com:
dx.com/p/i2c-rtc-ds1307-24c32-real-time-clock-module-for-arduino-blue-149493
at $2.99
This chips communicates using I2C rpotocole, using the PINs A5 and A6 as SDA and SCL.
The code is pretty standard.
http://learn.adafruit.com/ds1307-real-time-clock-b...

I also bought a ds1302 from dx.com:
http://learn.adafruit.com/ds1307-real-time-clock-b...
at $2.40, the cheapest!
This chip needs another script using a 3-wire interface.
I found example code here:
http://playground.arduino.cc/Main/DS1302

Later on you can consider adding other sensors yourself...

Step 3: Tools and download

Making the PCB requires a soldering device.
Programming is done using a laptop with Arduino environment.
Of course, you need some normal tools like pincher, cutter, for doing the wires.

Downloads: scripts
https://github.com/contrechoc/clock
There are different scripts:

  • basic clock scripts for ds1307 and ds1302
  • knight rider script, where the comma goes left and right (ds1307)
  • a script with words coming in from the right and the left side (ds1307)
  • a script for words going up and down (ds1307)
  • a script which combines these up and down words words with the time from the clock (ds1307)
The scripts change from the basic to the more complicated due to demands on the arrays holding the words and the time. A bit of pointers to char arrays was unavoidable.
You can further develope other possibilities or improve on script efficiency. Also, for the lovers of framework like scripting there are enormous improvements to achieve! Go ahead!

Step 4: Your Own PCB instead of Arduino













If you want to advance from the Arduino to your own contraption you have to make a PCB.
You have to solder the ATMega328 holder, the resonator (or crystal) and connections for the display and the timer module. After that, the buttons and the LDR.

This PCB is not totaly bare bones: because you program using the Arduino you need an oscillator or a crystal on your board to be able to let the Atmega328 function. Changing the fuses is possible, but then you change the max speed of the ATmega328 from 16 to 8 MHz, which might alter the way the clock functions.

The way you do this is "free". It depends on your thoughts where to put the components and how you want to make the dispay float in space or on the PCB.

Step 5: The adaptor for your own PCB

c35.jpg
















Very practical: if you have your own board, so you have to power it - it is a stand alone.

You could try with a lipo, but then you still have to make your script saving as much energy as possible, still you have the display of LED's eating the Watts away. So this set up (in contrast with the purple gadget clock later in this instructable with a LCD display) needs an adaptor. In fact you ahve many adapters lying around, chargers of mobile phones etc. Look at the specs and if this is 5V it is ok.
The USB adaptor is nice - you have to hack a USB cable:
http://www.instructables.com/id/Hack-that-holy-USB...
but also older adaptor/chargers will do. Pratical problem is the wires: if these are too thick the wires tend to pull your clock from the table.
You can either connect the wires directly to the PCB, or use a plug, The plug solution is nicer, more versitile.

A "dangerous" solution is buying a cheap power supply of 5V at dx.com: (4 dollar)
http://dx.com/p/power-supply-switch-module-green-8...

From the design concept (show the electronics as it is) having an open power supply is consistent, but you have two open wires from the mains - this is a risk!

With the blue foam stuff (see image) it is possible to insert the dangerous part of this open adaptor; half way solution.

Step 6: Basic Scripts

The script is where the complexity enters.

Normal clock indication:


The script can be divided into a few main parts:
1. Talking to the timer module, using protocoles like I2C
2. Talking to the display
3. Interaction, setting hour, minutes, days in month
4. add-ons, like an LDR to regulate the brightness, maybe a temperature sensor
5. funny things, like patterns and text

1. Talking to the timer module
The protocoles can be found on the internet.
In the scripts I have used a protocole for the DS1307 and another for the DS1302. You can use the example scripts as black boxes. You have to understand the format of the data coming out or going into these black boxes.
So the DS1307 uses the DateTime format of the RTC.lib. For the DS1302 you have a struct (C programming thing) with different kinds of formats for the same data.

2. Talking to the display
I did a "talking to the timer module" and transferred the data in the DateTime variable to an array "myNumber". This array was used to transfer the digits two by two to the display.

so:

DateTime now = rtc.now();
    myNumber[2] = now.hour()/10;
    myNumber[3] = now.hour()%10;
    myNumber[0] = now.day()/10;
    myNumber[1] = now.day()%10;
    myNumber[4] = now.minute()/10;
    myNumber[5] = now.minute() % 10;
    myNumber[6] = now.second()/10;
    myNumber[7] = now.second() % 10;
You see I have to separate the tens and the ones, using the modulo and the division operators.
(For the ds1302 I had to do the same trick, but using the rtc struct.)

Then I used a timer to get the number digits to the display one by one, but so fast that your eye sees these digits all at the same time:
setting up the timer:



  noInterrupts();           // disable all interrupts
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1  = 0;
  OCR1A = 5; //10 - 200    // compare match register 16MHz/256/2Hz
  TCCR1B |= (1 << WGM12);   // CTC mode
  TCCR1B |= (1 << CS12);    // 256 prescaler 
  TIMSK1 |= (1 << OCIE1A);  // enable timer compare interrupt
  interrupts();             // enable all interrupts
In the timer routine I transfer the digits:


ISR(TIMER1_COMPA_vect)          // timer compare interrupt service routine {

  ledCounter++;// counting from 0 to 7

  ledCounter = (ledCounter)%8;
  digitalWrite(slaveSelectPin,LOW);

  SPI.transfer(1<<(ledCounter));
  unsigned char num = myNumber[ledCounter];//getting the array member 

  letterTransfer(num); //using the coding and doing the transfer

  digitalWrite(slaveSelectPin,HIGH); 

}


Step 7: Interaction and some other ideas

After the basics we have a display that tells the time.
We have two script parts left:
3. Interaction, setting hour, minutes, days in month
4. add-ons, like an LDR to regulate the brightness, maybe a temperature sensor
5. funny effects or text

3. Interaction, setting hour, minutes, days in month
The interaction is necessary to set the time, when starting up without an Arduino. Or when the time is running not accurately anymore.

We need two buttons, one for going into the setting mode, and the other for changing the digits.

I decided to add two bigger push buttons. Simply connect the buttons to GND and through a 10K resistor to a PIN and do a pull up on that PIN:

  pinMode ( 8,INPUT_PULLUP);
  pinMode ( 9,INPUT_PULLUP);
or do it the old way:
  pinMode ( 8,OUTPUT);
  digitalWrite(8, HIGH);
  pinMode ( 9,OUTPUT);<br>  digitalWrite(9, HIGH);
(I was later thinking of something more fancy:
use a magnet and a Hall sensor for instance. Maybe for clock design version 3?)


4. add-ons, like an LDR to regulate the brightness, maybe a temperature sensor
The display is rather bright during the night. I used an LDR to regulate the brightness. The brightness can be regulated setting the speed of the timer. This is done by giving OCR1A another value.
So I connected a resistor and an LDR to analog PIN A0 and created some steps of brightness.
(GND - LDR - PIN 14 - RESISTOR 2K - GND)



//dimming or brightening 
   if ( tCounter%100 == 0 ) { //do not check every loop but only once in a while
      int hhh = analogRead(0)/4;
      if ( hhh < 150 ) hhh = 0; 
      else if ( hhh < 175 ) hhh = 10;
      else if ( hhh < 200 ) hhh = 20; 
      else if ( hhh < 250 ) hhh = 50;
// do the dimming by way of the frequency of the interrupt
      noInterrupts();
      OCR1A = 10 + hhh ;
      interrupts();
5. funny effects or text
This is where you can make a difference with the more "normal" clocks.
Insert text now and then:
From the right or the left some words appear randomly, like hello, ciao, ...
To do this you need a lot of array shifting. You need pointers because this Arduino script is based on C.


I also tested adding a moving comma with another timer, timer0

  TCCR0A = 0;
  TCCR0B = 0;
  TCNT0  = 0;
  OCR0A = 50;            // compare match register 16MHz/256/2Hz
  TCCR0B |= (1 << WGM02);   // CTC mode
  TCCR0B |= (1 << CS01);    // 256 prescaler 
  TIMSK0 |= (1 << OCIE0A);  // enable timer compare interrupt
Together with a second array, we can alternate or even play at the same time the two arrays.

Step 8: FUN Design on display

Where can I make a difference with the normal clocks?

Knight rider

One of the first ideas was to add a "knight rider" effect, playing with the comma:
But this was considered not relaxed...

(The comma of the knightrider is done using a second array, with one comma sign and the rest "empty". With a second timer this array is inserted at the same time as the first array of time digits. So in the knight rider script you find two timers.)

You could add funny text or transitions.

The second idea was adding words - coming in from the sides, or from the top and the bottom.

The coding of the segment display:
Without the comma you have 124 possibilities. 2^7

/*
   -*-       0000 0001
   *-*  0010 0000  0000 0010
   -*-       0100 0000
   *-*  0001 0000  0000 0100
   -*-       0000 1000
   comma:              1000 0000
*/
With the 7 digits number display you cannot make the whole alphabet, but you can make pretty much all the letters. It's clumsy but funny.
Here you have the code, maybe you can find even more creative solutions and complete the alphabet! (I am proposing to use for an m three horizontal strokes: the MI in Japanese ミ and for the N two horizontal strokes: the NI in Japanese: ニ.
But I am afraid not everybody in Europe will recognize this, eg BEAミ as my name :-)

A lot of words are already possible like: HELLO HOUSE PLUS CIAO STAR ...
PEACE is also possible (hurrah!)

As long as we don't have a one digit solution for V, we have a big problem: LOVE...is not possible!
(But we as Dutch people have an advantage there: LOVE = LIEFDE in Dutch, and this last word is indeed possible :-)

Interesting, there is even a wikipedia entree about this:
http://en.wikipedia.org/wiki/Seven-segment_display...


Or effects like funny patterns (under circles, upper circles, a dotted line around the display.

here is my coding table, maybe you can still improve!

//numbers
  if ( num == 1 )  SPI.transfer(255 - B00000110);//1
  if ( num == 2 )  SPI.transfer(255 - B01011011);//2
  if ( num == 3 )  SPI.transfer(255 - B01001111);//3
  if ( num == 4 )  SPI.transfer(255 - B01100110);//4
  if ( num == 5 )  SPI.transfer(255 - B01101101);//5
  if ( num == 6 )  SPI.transfer(255 - B01111101);//6
  if ( num == 7 )  SPI.transfer(255 - B00000111);//7 
  if ( num == 8 )  SPI.transfer(255 - B01111111);//8
  if ( num == 9 )  SPI.transfer(255 - B01101111);//9
  if ( num == 0 )  SPI.transfer(255 - B00111111);//0
  //comma
  if ( num == 10 )  SPI.transfer(255 -B10000000);//comma
  //some letters
  if ( num == 11 )  newNum =  B01110111;//A
  if ( num == 12 )  newNum =  B01111111;//B like 8
  if ( num == 13 )  newNum =  B00111001;//C
  if ( num == 14 )  newNum =  B01011110;//D small like 6 without upper stroke
  if ( num == 15 )  newNum =  B01111001;//E
  if ( num == 16 )  newNum =  B01110001;//F
  if ( num == 17 )  newNum =  B01101111;//small G like 9
  if ( num == 18 )  newNum =  B01110110;//H
  if ( num == 19 )  newNum =  B00000110;//I like 1
  if ( num == 20 )  newNum =  B00011110;//J
  // K?
  if ( num == 21 )  newNum =  B00111000;//L
  //M -- the m as two digits does not really convince me
  //N
  if ( num == 22 )  newNum =  B00111111;//O like 0
  if ( num == 23 )  newNum =  B01110011;//P 
  if ( num == 24 )  newNum =  B10111111;//Q like 0.
  //R
  if ( num == 25 )  newNum =  B01101101;//S like 5
  if ( num == 26 )  newNum =  B01111000;//t small
  if ( num == 27 )  newNum =  B00111110;//U
  //V
  //W
  //X
  //Y ...something like a 9 is possible, mirrored? It does not look too good
  //Z

  //special signs
    if ( num == 40 )  newNum =  B01011100;//under circle
    if ( num == 41 )  newNum =  B01100011;//upper circle
    if ( num == 42 )  newNum =  B00000000;//empty
    if ( num == 43 )  newNum =  B10001000;//for a .-.-.-.-.-.-.-. line 

    //square sequence
    if ( num == 44 )  newNum =  B00001100; // under + side under right
    if ( num == 45 )  newNum =  B01000010; //middle side upper right
    if ( num == 46 )  newNum =  B00000011;
    if ( num == 47 )  newNum =  B01000100;

Step 9: Design of the object




I like "Minimal design", where you can see the components. That is why I made this bare bones atmega and the stick in display and timer module.

You start with a PCB.
Add the ATmega328 and solder the necessary wires for GND and Voltage. (You could add a resonator.)
Add the caps if you like to the GND and Voltage coming in.

I added the parts for connecting the display and the timer module. (For the ds1307 and the ds1302 the PIN connection is different.)
You add and connect the two pushbuttons. (Pull up PIN and button connect with a 1K resistor.)
You add and connect the LDR. (GND - LDR - PIN - Resistor 2K - V)

Standing upright 1.
For this I first used a piece of MDF or wood. It is easy to put the PCB into the saw line in the wood. Instead of wood you can also make a "foot" using a piece of metal.

Standing upright 2.
With colored pieces of polyester (or whatever it is exactly) you get a more exciting effect (I think). You can easily stick the PCB in it using a knife. I thought it would tumble, but the setup remain stable.

Of course, you should experiment with your own customized base!

Adapter
Is the adapter part of the electronic components or part of the design? Do we show or hide the adapter?

Step 10: Alternatives

Other kind of Displays
Alternatives are the Liquid Crustal displays, or even the graphical screens:
http://www.instructables.com/id/LCD-Magic/

Another clock which runs out of the box is this sequence of LED matrix blocks:
http://dx.com/p/jy-mcu-3208-lattice-clock-ht1632c-...


Gadgets
You know clocks!
They are everywhere...The purple one is one of my favorites, it has 4 functions, even a temperature sensor. It works one year, two years on its batteries (great work saving energy!). It costs only 1.30 euro's or something.

Why make one yourself?
If electronic clocks are soo cheap?
For the fun?
For the experience?
For admiring the cleverness of the solutions for soo little money?
For trying to add something yourself, either more design or more fancy sillyness?

Probably because all of this!

Step 11: Further Improvements (or more complications)









When you have words and transitions between time and words, you can add other data, like temperature.
For temperature you can use a sensor like
The next thing which could be interesting is air pressure.

But also pollution can be measured and displayed.

On the other hand data from sensors becomes much more interesting with a graphical display, or uploading the data to for instance COSM.

Uploading requires a connection to the internet. This can be done having a set of RF12 transceivers and for instance a Raspberry Pie which is connected to your router.

So, starting with a rather simple segmented display you make a clock and ends up wiring your home together making it self tracking!


Source:

http://www.instructables.com/id/In-your-own-time/?ALLSTEPS

[TC] Arduino Video Game for the Neighbourhood update 2014





My house/office has a store window and I try to make use of it as much as possible. I had some projections etc. in there before, but now I wanted to make something interactive. We have a lot of loitering youth and many people passing by. To appeal to a wide audience, I thought it would be nice to make an old fashion arcade box like thing.
It’s now on the street for one day and people really seem to like it. Age or background doesn’t make a difference.
To make it a little bit more challenging,  I thought it would be fun to try to run the hole thing on an Arduino without an external computer. Just to see how much power it actually has. And while I was at it, I decided to try to make everything myself. So I also made my own led screen, with his own “display driver” and display list, a 8-bit sound library, and of course the game itself.
The only thing I didn’t make was the background music for the game, that was composed by the lovely Annegreet Sledsens: Thanks sweety!  You can hear it in the video.
The led screen is very bright which made it very hard to film and photograph with my cheap camera. Even after some photoshopping, I couldn’t  make it look as good as in real life. So if you’re in the neighbourhood (Antwerp Belgium, Provinciestraat 60, behind the Zoo), feel free to come check it out and play a game with the locals!
Here the video and some more pics:



The Game



I needed something that would appeal to a large audience (the people in my street) and something was fun to play .
So I took the good old gaming cliché, where the world gets invaded by aliens and you have to fight your way to the end boss, save the world and the human race . With my minimal resolution of 16*90 pixels, I didn’t have much other choice than making it pixel-art style.

The game has 3 modes, a single-player and a multiplayer brawling/fighting the aliens mode, and an extra fighting mode where the 2 players can battle with each other.
Every mode has just one level, but since it is just a casual “play on your way to work” kind of game, I thought it would be more then ok.
some screen-shots:

The game-mode selection:

Two players fighting the the final boss:

The girl kicking the boys ass in fighting mode:

Game over!


Development



To make the development easy and fast, I cross developed the game as a Cinder c++ app  and an Arduino app, that way i didn’t had to upload the whole thing on an Arduino every time I wanted to test something.

I didn’t use any external memory, so I had to store everything on the Arduino.  I made a small app that generates c++ classes from bitmaps with some gamma correction for the led screen. I used indexed colours to save some of that precious SRAM. For driving the leds, I modified the Adafruit neopixel lib, to support alpha-blending and make it a little bit faster for my specific case.
I don’t really have much experience with generating sound and music. So the 8-bit sound was quite challenging. I’m happy with the result, but my oscilloscope broke during development of a more advanced sound lib, so its quite simple for now. But I really enjoyed  myself working on the sound aspect. I have a feeling that my next project is going to be something sound/music related ;)
I’m not going to elaborate too much on the rest of the code. But you’re free to check the source code yourself  (warning: its messy).
The full source code and game assets on Github (Code-> MIT, Assets-> CC attribution)

The Hardware



Like I said, I made my own led display.

I used strips of  WS2812 LEDs, those are individually-addressable RGB LEDs. The lay in a 16*90 grid (=1440 leds)
I added a laser cut raster over the leds to make the pixels square and put a layer of plexi to diffuse the light some more.

Beneath the leds is the main Arduino Due and the power source. This is the Arduino that drives the display and runs the game. Those leds suck a lot of power , so I had to add a 60A 5V power supply.

The screen/main arduino is connected with the arcade box through a simple tx-rx serial line, which was fast enough to send the button commands.
the arcade box is just some painted MDF with a steel frame inside, and a steel plate on-top (it has to be a little bit solid if i leave it outside ;) )
The Arduino in the arcade box generates the sound and music and handles the raw button/joystick input.


If your interested,  the full “schematic” of the project:
Its pretty straight forward.: Pulldowns for the buttons and joystick, the led connections and a pot for the screen brightness and a tx-rx line between the two Arduinos.
on top of that there is a DC coupling for the speaker which is connected to the Arduino DAC . But I still have to put some kind of amplifier between the arduino and the speakers. The sound is hard to hear because of the street noise.



[TC] Water Level Indicator with Alarm using 8051 Micro controller (AT89C51)

This article illustrates the construction and working of a liquid/water level indicator. Such an indicator is used in tanks to indicate the level of liquids and alert us when the tank is full. So by this circuit we can monitor the various levels of the tank and can avoid spillage of water and also we can configure our supplies according to the various levels of tank. Such module or circuit can be installed in big buildings where manual monitor of tanks is difficult and its indicator can be placed at some centralized place.





This water level indicator circuit works on the principle that water conducts electricity. A wire connected to VCC and four other wires are dipped in tank at different levels namely quarter, half, three-fourth, full and their output are taken on pins P3.0, P3.1, P3.2, P3.3 via a transistor BC547. Port P2 is connected to data pins of LCD and P1.0, P1.1, P1.2 are respectively connected to RS, RW, and EN pins of LCD.

Initially when the tank is empty LCD will show the message VACANT. As the tank starts filling up wire at different levels get some positive voltage, due to conducting nature of water. This voltage is then fed to their corresponding pins on controller. When level reaches to quarter level, LCD displays the messageQUARTER. On further rise of level, HALF and 3/4 QUARTER are displayed on LCD. When tank gets full LCD shows the message FULL CLOSE TAP. A buzzer is also provided to produce a alert the user when the tank gets filled. This buzzer can be made off by pressing the switch connected between pin 15 of controller and VCC.
Circuit Diagram :



CODE
// Program to make a Liquid level indicator using LCD
#include<reg51.h>
sbit rs=P1^0; //register select pin
sbit rw=P1^1; //read/write pin
sbit e=P1^2; //enable pin
sbit quat=P3^0; //pin connected to quater level of tank
sbit half=P3^1; //pin connected to half level of tank
sbit quat_3=P3^2; //pin connected to three -fourth level of tank
sbit full=P3^3; //pin connected to full level of tank
sbit spkr_on=P3^4;  
sbit spkr_off=P3^5; // pin to off speaker

void delay(int k) //delay function
{
int i,j;
for(i=0;i<k;i++)
  for(j=0;j<1275;j++);
}

void write(int j) //write function
{
rs=1;  //selecting command register
rw=0;  //selecting to write
P2=j;  //putting value on the pins
e=1;  //strobe the enable pin
delay(1);
e=0;
return;
}

void cmd(int j)  //command function
{
P2=j;  //put the value on pins
rs=0;  //selecting command register
rw=0;  //selecting to write
e=1;  //strobe enable pin
delay(1);
e=0;
return;
}

void puts(char *a) //puts function to print a string
{
unsigned int p=0;
for(;a[p]!=0;p++)
write(a[p]);
}

void lcd_init(void) // function to initialise the LCD
{
cmd(0x38); //setting 8-bit interface, 2 lines, 5*7 Pixels
delay(1);
cmd(0x0e); //turning on underline visible cursor
delay(1);     
cmd(0x01); //clearing screen
cmd(0x80); //moving cursor to the begining of line 1 of LCD
}

void main()
{
quat=half=quat_3=full=spkr_off=1; //configuring as input pins
quat=half=quat_3=full=spkr_off=0; //lowering input pins
spkr_on=1;    // making speaker on pin high,as it works on negative logic
while(1)
{
  while(quat==0&&half==0&&quat_3==0&&full==0&&spkr_off==0)   //condition when tank is empty
  {
   lcd_init();        // initialising LCD
   puts("VACANT");       //printing VACANT on lcd
  }
  while(quat==1&&half==0&&quat_3==0&&full==0&&spkr_off==0)	//condition when tank is quater
  {
   lcd_init();
   puts("QUATER");      //printing QUATER on lcd
  }
  while(quat==1&&half==1&&quat_3==0&&full==0&&spkr_off==0)	//condition when tank is half
  {
   lcd_init();     
   puts("HALF");      //printing HALF on lcd
  }
  while(quat==1&&half==1&&quat_3==1&&full==0&&spkr_off==0)	//condition when tank is three-fourth
  {
   lcd_init();
   puts("3/4 FULL");     //printing 3/4 FULL on lcd
  }
  while(quat==1&&half==1&&quat_3==1&&full==1&&spkr_off==0)	//condition when tank is full
  {
   lcd_init();
   puts("FULL;CLOSE TAP");     //printing FULL;CLOSE TAP on lcd
   spkr_on=0;// Enabling speaker
  }
  while(quat==1&&half==1&&quat_3==1&&full==1&&spkr_on==0&&spkr_off==1)//enabling high speaker_off pin
  {
   spkr_on=1;//disabling speaker
  }
}
}


[TC] Bicycle Theft Guard

This antitheft device for bicycles is inexpensive and can be constructed easily using a few components.

At the heart of the circuit is a wheel rotation detector, realised using a DC micro motor. For the purpose, you can use the micromotor (spindle motor) of a discarded local CD deck mechanism. With a little skill and patience, you can easily attach a small metallic pulley covered with a rubber washer to the motor spindle. Thereafter, fix the unit in the back wheel of the cycle, like the existing dynamo assembly.






Power supply switch S1 should be kept ‘on’ when you are using this bicycle guard. When it is flipped towards ‘on’ position, the circuit gets power from the miniature 12V battery. Now LED1 lights up and resistor R4 limits the LED current. Next, the monostable built around IC1, which is CMOS version of timer LM555, is powered through a low-current, fixed-voltage regulator IC2 (78L05).

Initially, when the bicycle is standing still, the monostable output at pin 3 of IC1 is low and the circuit is in idle state. In the event of a theft attempt, forward or reverse rotation of the DC motor induces a small voltage at its DC input terminals and the internal LED of 4-pin DIP AC input isolator optocoupler IC3 (PS2505-1 or PC814) glows. As a result, the internal transistor of IC3 conducts and pin 2 of IC1 is pulled low by the optocoupler and the monostable built around IC1 is triggered.

The output at pin 3 of IC1 now drives piezobuzzer-driver transistor T1 via resistor R3 and the buzzer starts sounding to alert you. In this circuit, the buzzer remains ‘on’ for around two minutes. You can change this time by changing the values of resistor R2 and capacitor C1.

Zener diodes ZD1 and ZD2 (each 5.1V) act as a protector for optocoupler IC3. The costly GP12V/27A battery is used here due to its compact size and reliability. 12V active buzzers with high-pitched tone output may be used with this circuit. These are readily available in the market.

Note. The specific optocoupler is used here deliberately, instead of a bridge rectifier, to increase the circuit’s detection sensitivity. Never replace the same with a DC optocoupler



Source : http://electronicsforu.com/

[TC] Building an analog meter clock with Atmel and Adafruit


“We wanted to design a microcontroller board that was small enough to fit into any project – and low cost enough to use without hesitation,” Adafruit’s Limor Fried (aka LadyAda) explained. “[It is] perfect for when you don’t want to give up your expensive dev-board and you aren’t willing to take apart the project you worked so hard to design.”
Although the Trinket launched in September, the ATtiny85-powered Trinket has already tipped up in a number of projects including a sound-reactive color LED organ, IR control device, Tap Tempo and a temperature/humidity sensor. Today, we’ll be talking about building a Trinket-powered analog meter clock. As Adafruit’s Mike Barela notes, the Trinket is a perfect fit for clock projects, as the platform is small and easy to hide behind a larger display.
“Clocks don’t need a lot of logic, this example only has maybe 20 lines of code, [while] adding a digital display via I2C is possible using seven segment or character-based displays (with the library code posted for other projects),” Barela wrote in a detailed tutorial on the subject. ”This [specific] project interfaces Trinket to the the Adafruit DS1307 real-time clock (RTC) breakout board to form a clock. But in a twist, the display is done using two analog meters. One for hours, one for minutes.”
According to Barela, the Trinket is capable of outputting to a meter without digital to analog converters.
“Trinket has pulse width modulation (PWM) on three of its pins. The meter uses a moving coil inductance movement, acting to average the indication of current flowing through it,” he continued.
“If you have narrow pulses, the average voltage it sees is lower, thus the current is lower for the fixed resistance attached to it. For wide pulses, the meter sees nearly the supply voltage and will stay around the full scale. This circuit varies the pulse width sent to the meters proportional to the hour of the day and the minutes after the hour.”
For two meters, says Barela, two of the three PWM pins on Trinket will be used (the third is also an I2C pin connected to the clock module). Although there are many ways to display the finished product, Adafruit decided to go with the meters “free-floating” in a colorful box, rather than a cabinet or plexiglass display.
To kick off the project, Barela recommends Makers first unpack their Trinket. Those using a breadboard or Perma-Proto board will want to solder on the (provided) header pins. After unpacking the DS1307 kit and building the circuit, Makers are instructed to modify the Arduino IDE to work with Trinket by adding the hardware definition file, the avrdude.conf file – while changing the ld.exe program from the 2008 dated version to the 2009 dated version and installing the driver for USBtinyISP appropriate to your operating system.
“To prepare the Trinket for other programs, you will want to first load the Trinket Blink sketch into the Arduino software then load it onto the Trinket to verify everything works well. You must press the hardware reset button on the Trinket then quickly press upload in the Arduino software to upload a sketch,” Barela added. “If you get an error, try the reset-upload process again. If you continually cannot load the blink sketch, check to make sure the Trinket is connected (without any wires connected to pins #3 and #4) and the Arduino IDE software has all the required changes.”'


Source: http://atmelcorporation.wordpress.com/2013/10/18/building-an-analog-meter-clock-with-atmel-and-adafruit/

[TC] "Biocrats BharatOvation 2013" Organised By University Of Pune on 10th and 11th Dec, 2013.



Objectives of Event:

  • Creation of a platform in India for visionary Innovators, Industrial Houses, Venture Capitalists, Angle investors, Govt. policy makers, Scientists and Technocrats to discuss innovations, especially aimed at the bottom of the pyramid, with regards to funding and further technology development possibilities.
  • Provide a unique platform to grass-root innovators to showcase their innovations to masses and directly tap into market and potential customers.
  • Ensure that the deserving innovations are taken up by leading industrial houses for further development and commercialization.
  • Showcase capability of Indians to 'innovate under constrains'.
  • Promote, gather and felicitate 'out-of-box' ideas from masses
  • Generate new scientific ideas and concepts relevant for the common people
  • Sensitize, encourage & initiate the process of innovative thinking amongst common people



Submit Your Idea athttp://ii.unipune.ac.in/site/join?0%5BshowRegForm%5D=0


[TC] Circuit for Over-Voltage Protection

Over-voltage protection circuits are used to protect voltage-sensitive loads. Voltage transients may occur due to a number of reasons such as transformer switching, load switching, and short/open circuit in rectifier and regulator circuit. Such transients can affect proper functioning of an electronic circuit or even damage it. Hence it is necessary to use an over-voltage protection circuit to protect expensive loads against all the sources of voltage transients.



In electronics engineering, where over-voltage protection experiment is included in the syllabus, the present circuit can be used to very effectively demonstrate the effect to students.

Circuit and working


Fig. 1 shows the demo circuit for over-voltage protection. It is built around a rectifier comprising four 1N4007 diodes (D1 through D4), 10V voltage regulator IC 7810 (IC1), SCR 2P4M (SCR1), transistor BC548 (T1) and a few other components. SCR1 is used as a protective component. 

Fig. 1: Demo circuit for over-voltage protection

If voltage exceeds beyond the withstanding voltage capacity of the device that needs to be protected (6V bulb here), the circuit disconnects the device from supply. To demonstrate this, potmeter VR1 connected across regulator IC1 is used to increase the voltage at the output of regulator IC1. When the output voltage of IC1 increases, voltage at the base of transistor T1 also increases, which triggers SCR1 through resistor R6. Once SCR1 triggers, fuse blows and disconnects the power supply from the device.



For demo, set VR1 at the maximum limit (say, 1k) and switch on the circuit. Using a digital multimeter, measure the output at CON3. It should be around 10.3 V. Now reduce VR1 resistance in steps. At around 800 Ω, the multimeter reads 10.9 V. Reduce the resistance further until SCR1 fires. Experimentally, it was found that at around 680 Ω, the SCR turns on after receiving a triggering pulse and a heavy current passes through the fuse wire. Due to this, the fuse wire blows and the load disconnects from the supply.


Construction and testing


An actual-size, single-side PCB of the demo circuit for over-voltage protection is shown in Fig. 2 and its component layout in Fig. 3. After assembling the circuit on PCB, enclose it in a suitable box.




Fig. 2: An actual-size, single-side PCB of the demo circuit for over-voltage
protection



Fig. 3: Component layout for the PCB
Download: http://www.electronicsforu.com/electronicsforu/circuitarchives/my_documents/my_files/C24_overvoltage.zip


To test the circuit for proper functioning, switch on S1 and measure the input voltage (230V AC) between TP2 and TP3. Also verify the output of IC1 as 10 V at TP1 with respect to TP0. Check voltage variation at the base of transistor T1 corresponding to change in the resistance value of VR1.  


Source : http://electronicsforu.com/
Authors : Milind M. Sutar, Dr J.L. Bhosale and Prof. P.B. Joshi  

Page Rank

google pagerank

Write For Us

Submit a Guest Post

Find us on Facebook

Categories

555 Timer IC 7 segment Display 8051 Project AC Circuits Adafruit Alarms Amplifier Circuits Analog Circuits android Arduino arm processor Assembly Languange Atmel Atom Size Audio Circuits augmented reality Automotive Circuits avr Battery Circuits Bicycle Gurad bluetooth Cable TV Circuits Cambridge University Camera Technology Circuit Boards Clipping And Clamping Circuits Clocking And Timer Circuits Computing contact lens Contact Us Form Contests Controller Circuit Conversion Circuits Counter Circuits Digital Electronics diy circuits Downloads EFY EFYTimes Electronic Books Electronic Components Electronic Locks And Keys Engineering Fan Circuits Filter Circuits Fire Alarm free Frequency Fun And Game Circuits future Google Hack n Mod Ham Radio Circuits heart rate monitoring High Voltage Circuits Home Circuits IC Guide ieee Industrial Circuits Infrared Instructables Inventions ipad lcd Led Circuits Light Related Lighting Circuits Medical Circuits Meter Clocks Microcontrollers Microprocessors Mini Projects modules Movie maker NatGeo Navigation Notice Optical Fiber PC Circuits PCB Boards Physics pnp transistor Power Supplies Printing Projects Programmer Project Ideas Projectors Protection circuits Proximity Detectors Radar Radio Circuits Radio Transmitters Raspberry Raspberry Pie Remote Circuits Retis Lab RFID Robot Cars Robotics Science Science Alert Security And Safety Sensor Circuits Servo Motors Smallest Smartwatches sms Software solar cell sound application Spectram Switch Technology News Telephone Related Television Related Test And Measurement Circuits Thermal Projects Tone generator circuits Touch Screen Tutorials Wearables Wi-Fi Wireless
Like us on Facebook
Follow us on Twitter
Recommend us on Google Plus
Subscribe me on RSS