Micro-controllers for Hobby Projects and Education

The expEYES is developed around a micro-controller. You need a micro-controller development system to do such projects. MicroHOPE is just meant for that. It is a A micro-controller development board for ATmega32 micro-controller, having the following features:

  • Programmable through USB port (through Parallel Port also)
  • Powered by USB
  • Program development using AVR-GCC compiler & the C library
  • Edit, compile and upload programs using an IDE (contributed by Vimal Joseph)
  • Ready-made functions to access the uC features
  • 32 kB Flash, 1 kB EEPROM, 2 kB RAM
  • 10 bit 8 channel ADC
  • 16 bit Timer/Counter

The Hardware and the IDE are shown below. The output on the LCD display is done by the program displayed inside the editor window. You just  have to click on the Compile and Upload buttons. The include file "pmdk_lcd.c" has functions to handle the LCD display connected to the micro-controller. Similar include files are available for using the ADC, Timer/Counter and the RS232 port of the micro-controller, reducing your efforts to get started.

Getting started on Ubuntu:

Install gcc-avr , avr-libc and avrdude from the Ubuntu repository. Download and install microHope.deb. The include files and the examples shown below will appear inside /etc/skel/avr-examples. Copy this directory to you home directory and start Applications->Science->microHOPE, to get the IDE shown in the figure.

Include Files

Example Programs.

Developing Programs that can Communicate to the PC

The program echo.c can be used as a starting point to develop programs communicating to PC. After uploading echo.c to microHOPE, you can run echo.py on the PC to test the communication. You can modify this program to send some other information from the micro-controller instead of echoing the character.

Implementation

Programs can be uploaded to the program memory of the micro-controller using the SPI interface, through the PC parallel port. To do program development through USB port, a bootloader program is pre-loaded in to the program memory.

The bootloader is prepared as per the instructions from Here.  by Jeffrey Antony & Pramode C E

The bootloader is programmed using the parallel port using the command.

$ avrdude -c dapa -patmega32 -U flash:w:ATmegaBOOT_168_atmega32.hex

The fuses are set by:

$ avrdude -c dapa -patmega32 -U lfuse:w:0xff:m -U hfuse:w:0xda:m

Verification done by:

$avrdude -b 19200 -P /dev/ttyUSB0 -pm32 -c stk500v1 -n

Program uploading through USB port is done by ( you may use the GUI)

$avrdude -b 19200 -P /dev/ttyUSB0 -pm32 -c stk500v1 -U flash:w:mycode.hex

Hardware

You can make the PCB from these Gerber files.

Ajith Kumar

ajith at iuac.res.in

 

Infrared Receiver (jithinbp at gmail.com)

recv.c  , tested on microHOPE will receive single bytes sent by irsend1(),  on Infrared Diode connected to SQR1  .

USBASP programmer

Download Zip file from http://www.fischl.de/usbasp/

From /usbasp.2011-05-28/bin/firmware/  extract The atmega8 hex file and upload it to an ATMEGA8 using an existing programmer.

Wire the following schematic

(to be completed)

 

 

 

 

 

 

Comments

jithin's picture

Author:jithinbp

A Display using a row of 8 LEDS that rapidly change patterns as you wave it through the air giving the
impression of an display with 8xX resolution .. X depends on how far you wave it , usually around 50 or so.

The program in this instance merely repeats the characters T & A in a loop and, waving the board around shows you TATATA.... 
no switch was used in order to synchronise their appearance.

Labelled parts
https://picasaweb.google.com/lh/photo/0OEO7wKsynOclnw8NyfMnw?feat=direct...

How it works 

Displaying a character, say A.

'A' on an 8x8 grid looks like

  1 2 3 4 5 6 7 8
1       X X      
2     X     X    
4     X     X    
8   X X     X X  
16   X X X X X X  
32   X X     X X  
64 X X         X X
128 X             X



the first column lists the bit values that represent each LED. The marked LEDs in each column need to be lighted rapidly one column
after the other in order to make an A appear as you wave the entire LED column in the air.
WHEN PORTB=128+64, the bottom two LEDS glow , next, PORTB=64+32+16+8, LEDS 4,5,6,7 glow and so on
so if i were to store the values for A in an array it would look like

uint8_t ca[]={128+64,64+32+16+8,32+16+8+4+2,17,17,32+16+8+4+2,8+16+32+64,128+64};

and a loop execution of the elements of this array in quick succession,
 
uint8_t x;
for(x=0;x<8;x++)
 {
 PORTB=ca[x];
 delay(340);
 }
PORTB=0;
delay(1000);
}

the following program was loaded onto an atmega32 with a boot loader preloaded . It displays 'JITHIN'.

//display.c

 

 
#include "pmdk_lcd.c"
#include "pmdk_adc.c"
void showchar(uint8_t c[])
{
uint8_t x;
for(x=0;x<8;x++)
 {
 PORTB=c[x];
 delay(340);
 }
PORTB=0;
delay(1000);
}
 
main()
{
uint8_t ca[]={128+64,64+32+16,16+8+4,19,19,16+8+4,16+32+64,128+64};
uint8_t ct[]={1,1,1,255,255,1,1,1};
uint8_t cj[]={128+64+1,128+1,128+1,128+1,255,1,1,1};
uint8_t ci[]={0,0,129,255,255,129,0,0};
uint8_t ch[]={255,255,24,24,24,24,255,255};
uint8_t cn[]={255,3,14,24,16+32,64+32,64+128,255};
uint8_t cv[]={1+2,2+4+8,16+8+4,19,19,16+8+4,2+4+8,1+64};
 
 
 
uint8_t x;
DDRB=255;
 
DDRD=0;
PORTD=255;
 
for(;;)
{
if(PIND!=255)
   {
delay(2000);
showchar(cj);
showchar(ci);
showchar(ct);
showchar(ch);
showchar(ci);
showchar(cn);
delay(8000);
 
    }
 
 
}
 
}
 
An alternative arrangement would be to have a rotating mirror and keep the LED row in front of it..  the mirror must have an input trigger
and you can easily view your text in the mirror... this is better since the angular velocity of the mirror can be kept fairly
constant thus giving you a maintained aspect ratio.
 
P.S. in case any of you chaps manage to improve upon the mirror arrangement by replacing LEDs with lasers, thus
making a laser projector, please let me know at jithinbp at gmail.com.
[edit] projector's already been made.. !
 
That's all folks!!
:-D
jithin's picture

Objective:

Eavesdrop on conversations in a target room more than 20 metres away depending on laser intensity and reflectivity of surface used.

Principle:

The windows of a room pick up sound waves inside and vibrate accordingly.
We bounce a laser beam off the vibrating surface, and the reflected beam naturally will fluctuate according to 
the vibrations on the reflecting surface.
We capture the reflected beam on a phototransistor and amplify the fluctuating voltage output 50 times and listen
to the signal using a pair of headphones .  :-D
Here's an image with a rough idea..

I used a speaker covered with foil because I lacked the resources to tackle electrical noise when amplifying
the much weaker but clearer vibrations from a window.

The phototransistor is pulled up to 5 volts via a 22k resistor. based on incident light intensity, the voltage output
varies from 0 to 5volts, but fluctuation observed is only around +-( 0.2)volts . 
Since only the fluctuations concern us, we remove the DC component by passing the output through a capacitor.
The filtered fluctuations ( +- 0.2 V range) are amplified 50 times and fed to a headphone. 
You can wire an op-amp to amplify it. I used expEYES amplifier section.

A more detailed pic:

That's all folks !!!!
Happy eavesdropping..
:-D