PocketMagic

PocketMagic

Where Technology meets magic


Android
53 Posts
BlackBerry
6 Posts
Electronics
84 Posts
Hardware
142 Posts
High Voltage
57 Posts
Image processing
5 Posts
iPhone
4 Posts
Linux
2 Posts
Nuclear
27 Posts
Optics
11 Posts
Photography
7 Posts
Photoshop
3 Posts
Research
21 Posts
Reviews
19 Posts
Robotics
9 Posts
Security
9 Posts
Software
90 Posts
Symbian
2 Posts
Tubes
23 Posts
Windows Mobile
11 Posts

Sponsored Links


   

Top Articles!


Single Chip Computer | 585 Views | Rate 41.79
Single Chip Computer
AVR SDCard FAT support with FatFS | 14660 Views | Rate 32.22
AVR SDCard FAT support with FatFS
3V to 400V regulated inverter for Geiger counters | 1463 Views | Rate 13.93
3V to 400V regulated inverter for Geiger counters
Electric Fence - 20KV pulses for perimeter defense | 11483 Views | Rate 9.99
Electric Fence - 20KV pulses for perimeter defense

   

News & Updates


2014-10-29, Statie de monitorizare a radiatiei de fond in Timisoara

2014-10-29, uRADMonitor - Online Radiation monitoring station

2014-10-17, Single Chip Computer

2014-07-23, High Voltage Power supply - 140KV

 

  

Coil Winding machine counter with Atmega8 and Reed relay


By Radu Motisan Posted on May 25th, 2013 , 2631 Views (Rate 5.01)



Ovidiu asked me to build a digital counter for his new project, a coil winding machine. Here is what I came up with:

Variant 1 : Atmega8 + Nokia 5110 LCD + 3V power supply

I am using an Atmega8-8PU (configured for 8MHz with external crystal), a Nokia 5110 lcd, and a transistor to handle the pulses from a reed relay. A 3.3V regulator provides the voltage for the entire circuit.
reed digital counter atmega2

Everything has been mounted on a test board, including the headers for: ISP programmer (USBAsp), the 5110 Nokia LCD, the power supply (5V in, fed to the 3.3V regulator), the Reed relay connector, the reset button connector and another 2 pins connector, used to read the polarity of coil winding machine's motor, so we know we either increment or decrement the counter.
reed_counter_atmega_1 reed_counter_atmega_2 reed_counter_atmega_3 reed_counter_atmega_4
There are a few connectors:
J1: is for the power supply. The circuit takes 5V, that get into the L7833 for 3.3V output used by the atmega8 uC and the LCD.
J2: is the LCD connector, going to the Nokia 5110LCD.
J3: goes to the reed relay. This is the place we generate pulses for the microcontroller to count.
J4: is the polarity connector. It must be connected in parallel on the coil winding machine's motor. It was designed for a 12V motor (but this can be changed by adjusting the voltage dividers formed by R3-R4 and R5-R6, so they take in the motor voltage, and output not more than 5V). If the motor is connected in normal polarity, we will read PD0 high, if the motor is in inverse polarity, we'll have PD1 high. This info is used in the code to either increment or decrement the counter.
J5: is just a simple momentary switch. When pressed, will reset the counter to zero.
ISP connector: is a 10 pin connector used with the USBAsp AVR programmer.

Circuit diagram:
digital counter reed switch circuit diagram

Fuse bits:
External 8MHz crystal. The settings are:



  1.  
  2. avrdude -p atmega8 -c usbasp -U lfuse:w:0xff:m -U hfuse:w:0xc9:m
  3.  

Source code:
You can download and use the source code, under the Apache license, here.





Variant 2 : Atmega8 + 2x16 HD44780 Character LCD + 5V power supply

Some of my readers asked for a custom variant, that uses a 2x16 HD44780 LCD (or a 1x16 smaller variant). These displays require a 5V voltage supply, so here is variant 2 of the digital counter, modified to support these requirements.

2x16 LCD Circuit Diagram:
digital counter reed switch circuit diagram with 2x16LCD HD44780_1_16_connector

Hex file, SCH and source code:
Can be downloaded here: atmega reed digital counter 2x16LCD



More on PocketMagic:

Google Tango Hackathon in Timisoara | 1253 Views | Rate 6.92
Google Tango Hackathon in Timisoara
How to set the AVR Fusebits | 4054 Views | Rate 6.77
How to set the AVR Fusebits
Atmega8 and Nokia 5110 LCD  | 3381 Views | Rate 5.92
Atmega8 and Nokia 5110 LCD
uRADMonitor - Online Radiation monitoring station | 4039 Views | Rate 5.46
uRADMonitor - Online Radiation monitoring station
Coil Winding machine counter with Atmega8 and Reed relay | 2631 Views | Rate 5.01
Coil Winding machine counter with Atmega8 and Reed relay
Building a robot – Make the robot follow you | 3123 Views | Rate 4.95
Building a robot – Make the robot follow you

9 Responses to “Coil Winding machine counter with Atmega8 and Reed relay”

  1. 1
    Jason:

    I am trying to understand something, you used a atmega8 that only has 28 pins and in your schematic it shows 32 pins. Ok I am not getting this, pin numbering you got going on here can you please email me with the needed info and how to change it to english.
    Thank you
    Email me at areyoukiddingme31@ymail.com with coil counter in subject line thank you

  2. 2
    Radu Motisan:

    That is because I included the SMD version of the Atmega8 in the SCH. So just use the 28 pins DIP Version instead.

  3. 3
    jason:

    OK, Thank you. Now can it be changed to English? It’s a great design by the way been working on something like this for a few months now, and seen this, it’s a great example thank you for sharing this.

  4. 4
    Radu Motisan:

    The source code has been provided at the bottom of the article, you simply need to change the texts and recompile the code. But if you need help, I can do it for you and simply post the .hex file here. What do you think?

  5. 5
    aregawi teklewoyni:

    i need the winding method with its assembly cod and interfacing ,please sent me through email :aregaw145@gmail.com

  6. 6
    aregawi teklewoyni:

    code for the winding machine

  7. 7
    Jason:

    Radu,
    Sorry that I haven’t gotten back with you on your answer been very busy . If you could please help me with this that would be great. I have built my coil winding machine using stepper motors, I have done what you said to do by changing the text and recompiling and something is just not right.
    Thank you
    Jason

  8. 8
    Ugo Crecco:

    Radu,

    How could one go about purchasing one of these units (if available)? Alternatively if not available for sale, is there a complete parts list available so I could build it? My experience in electronics is very limited.

    Thanks.

    Ugo
    Please respond to: ucrecco@shaw.ca

  9. 9
    Hans:

    Hi there,
    Very nice project, one thing (two actually), what schematic/pcb package is the 2x16LCD- version pcb designed and second could you please post the .hex- code for the controller? (…or if not too much trouble email it to me.)
    Thank you kindly.
    Hans

Thank you for commenting. Your comment won't show until approved, which can take some time.

Please copy the string iatjsQ to the field below: