Search This Blog

Powered by Blogger.

Translate

[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  

[TC] Ascent Engineering Mastermind Contest







Ascent is India's most widely circulated and read recruitment supplement. It is focused on Career Development, Human Resource Development, Employment and Job Opportunities. The supplement has 23 national editions, nearly 75 lakh+ readers, over 400+ companies advertising nearly 5000+ jobs every week. All the jobs published in the supplement are also posted online on www.itsmyascent.com.

Ascent Engineering Mastermind is India's biggest Inter Corporate Quiz for engineers which intends to bring together the brightest engineering minds in the country competing in a battle of wits. Teams of 2 participants each would be competing in the zonal rounds in Delhi, Mumbai, Bangalore and Pune and winning teams would be challenged in the finals in Mumbai.

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