2 axis stepper motor control

This two axis stepper motor control system uses attiny2313 microcontroller. And it utilities the l298 dual h bridge power ic in multiwatt 15 package. The code is easy to write. Dual power supply for the microcontroller and l298 allows for increased isolation. The circuit must use a transformer for the proper galvanic isolation. This is a crude circuit as it needs some filter capacitors to reduce the voltage and current spikes.  

Shadiuno A Open-source electronic prototyping platform

Why limit yourself to the realm of arduino’s here is a new open-source electronic prototyping platform for the tinkers out there. It uses every thing open source. It is so open source you make your own. excpet for the chips.

Designed exclusively for the atmega16 and atmega32.

It can even be used with ardiuno.

You can use usbasp or usbtiny programmer.

Industrial Automation Using Internet of Things

The system will automatically monitor the industrial applications and generate alerts/alarms or take intelligent decisions using concept of IOT. The monitoring and controlling of the industrial automation is done through atmega32 microcontroller. The communication through the internet is done with the help of ESP8266 module. All the sensor data is collected and sent to the web server which processes and analyzes the data and sends a controlling response to the device for control action. The device receives the response and decodes the response message and control the stepper motor. Automation through IoT can help to get rid of the short distance communication.

Project Image
Project Image

Website is designed in php language. Ascii based data base was created. Graph can be generated from the previously stored values using php.

OM led sign board pcb

Here is the schematic and pcb layout of OM symbol.

Custom single layer pcb artwork

Resistor : 330ohm
Resistor Lead spacing: 0.4 inch
Resister power : 1/2watt or 1/4 watt 

LED lead spacing : 0.1 inch

Copper Trace
Silk Screen Layout
3D Rendering

One Axis Stepper Motor Control

I was thinking of building a CNC machine. But because of lack of fund i can only design. This crude design does the job. 

There is a high heat dissipation from both the voltage regulators. So a big heat sink must be used. Otherwise there is a high probability of thermal runaway.

Test Code

#define F_CPU 1000000
* GccApplication1.c
* Created: 8/27/2018 4:18:20 PM
* Author : abhay
#include <avr/io.h>
#include <util/delay.h>
int main(void)
DDRB = 0xff;
/* Replace with your application code */
while (1)
PORTB = 0x09;
PORTB = 0x0c;
PORTB = 0x06;
PORTB = 0x03;

PCB Fabrication

Well after you have built your circuit. You need to realize that circuit to test or deploy. 

Single Layer Non-Commercial PCB Fabrication Process Sequence

  • Make Your Schematic in any EDA tool like KiCad, Eagle, Express PCB, Proteous.
    Note: These EDA tools are not inter compatible with each other so make sure to use the appropriate tools
  • Make the PCB Layout using EDA tools.
  • Now there are two type of output
    1. Graphic output (PDF, JPEG, BMP, SVG)
    2. CNC text output file or Gerber files
  • After you made you PCB layout. The base file consist of copper layer and silk layer.
    Copper Layer: This where all your traces (connecting wires) reside.
    Silk layer: This layer consist of the graphic layout. It for the accessibility of the user for easy insertion and Post production annotations. You can avoid this if want.
  • Two methods of etching
    1. Tonner transfer : In this method the plastic tonner of the laser printer is transfered to the PCB by the application of heat. 
    Heat can be applied by using the Laminator or the cloth iron.

    2. Photoresist method : This is an old method. It produce neat result but it takes a lot of step for understanding. 
    Three steps of photo resist development.
    a. Apply photoresist film
    b. Apply Mask
    c. expose the film under UV light : This can be done by placing the copper clad board into bright sunlight for a brief period of about 10 minute(try a test pcb for the correct exposure time) or you can place the board under a UV LAMP
    d. develop the photoresit by submerging the board into a solution of a sodium carbonate (1 gm of sodium carbonate into 500ml of water)
    e. etch the board by submerging the board into any one of the following solution.
     1. ferric chloride (dissolve ferric chloride into 200ml-300ml water till it becomes saturated)
    2. Muriactic Acid Solution (muriatic acid solution)
        (Old name for HCL)
    3. Copper sulfate + sulfuric acid
    4. Nitric Acid
    5. Hydrochloric acid + hydrogen peroxide
    f. rinse the board in water.
    g. photoresist removal : submerge in sodium hydroxide solution
    h. rinse the board in water.

Rewriting lfuse and hfuse of Atmel Atmega series

Atmel Atmega micro controller if set correctly will work fine. But when you tinker with its setting. Things get out of control. One such problem is when you set the wrong fuse setting of the device to use the external crystal oscillator.

  1. Connect the microcontroller with the USBASP programmer
  2. Open the command prompt 
  3. write the command
    avrdude -c usbasp -p m32 -t
  4. This will open a terminal where you will write
    read lfuse
  5. Note down the settings
  6. Then write 
    read hfuse
  7. Calculate the correct fuse setting and then write
    avrdude -c usbasp -p m32 -U lfuse:w:0xe1:m -U hfuse:w:0x99:m


These setting specified in the above post is incorrect. 
Calculate the fuse setting in advance
Also remember the JTAG pin will also be set correctly
Never Change SPI setting without reading document. Changing this setting will result in non-functioning of SPI and the programming can only be done with manufacturer programmer. 

The above said procedure is verfied on the follwing micrcontrollers:

  • ATMEGA16
  • ATMEGA32

Custom LED Display

From very long time I was thinking of making a custom LED Board. But i was reluctant to make it. Because of the calculation of current and voltage. It is a simple Ohm law follower with the addition of heat exchange equation taken into account. 

Temperature Controlled Relay

This circuit uses very basic components. The use of mm74c922 integrated circuit makes it different from other. This hardware based scanning makes the code really simple. 

The use of Atmega16 can be avoided but this allows for complex coding structure to be stored. Due to cost associated with the micro controller. 

External crystals are avoided as the device will be used for low frequency of up to 100 Hz. Which can be used easily be handled by the internal clock. The deviation of clock timing should be taken into account when programming.

Schematic of Temperature controlled relay

The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly-proportional to the Centigrade temperature

Variable Voltage Power Supply

I was searching for a variable voltage power supply which can be used in multitude of situations. Ranging from testing to deployment in the final circuit design. It is not hard to find various IC, which does regulation. 

One such integrated circuit is LM317

LM317T Variable Voltage Power Supply
Lm317T PCB layout
Lm317T PCB bottom Copper