element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Andy Clark's Blog Coil Winder
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Workshopshed
  • Date Created: 23 Apr 2022 2:55 PM Date Created
  • Views 7112 views
  • Likes 15 likes
  • Comments 6 comments
  • 7segmentdisplaych
  • 3D Printing
  • magnetics
  • 7segmentdisplaysch
  • coil
Related
Recommended

Coil Winder

Workshopshed
Workshopshed
23 Apr 2022

So that I could wind 6 identical coils, I needed some way of counting the turns. So I made a simple addon to my milling machine. This consisted of a few 3D printed parts. Firstly a cam that could be bolted onto the milling machine spindle. And also a bracket that allowed a large "micro" switch to be added.

A cam that can be clamped to a  L shaped bracket with holes

The microswitch was connected to a Seeeduino XIAO, a simple Arduino compatible microcontroller which was in turn connected to a MAX7219 based 7 segment display module.

The code that does the counting uses an interrupt to record the state change of the switch and a time based debouncing logic.

#include "LedControl.h" // MAX7219 Led display driver
LedControl lc=LedControl(9,8,7,1);

volatile int i = 0;   
int counter = 0;

// the following variables are unsigned longs because the time, measured in
// milliseconds, will quickly become a bigger number than can be stored in an int.
unsigned long lastDebounceTime = 0;  // the last time the output pin was toggled
unsigned long debounceDelay = 250;    // the debounce time; increase if the output flickers

void setup()                                                      
{
  pinMode(2, INPUT_PULLUP);
  pinMode(LED_BUILTIN, OUTPUT);

  attachInterrupt(digitalPinToInterrupt(2),buttonISR,FALLING);  
  lastDebounceTime = millis();

  lc.shutdown(0,false);
  lc.setIntensity(0,8);
  lc.clearDisplay(0);

}

void loop()                                                      
{  
  displayLed();
  processButton();
  displayCount();
}

void displayLed() {
  int output = digitalRead(2);
  digitalWrite(LED_BUILTIN,output);
}

void displayCount() {
    lc.setDigit(0,3,(int)counter/1000,false);
    lc.setDigit(0,2,((int)counter/100*100-(int)counter/1000*1000)/100,false);
    lc.setDigit(0,1,((int)counter/10*10-(int)counter/100*100)/10,false);
    lc.setDigit(0,0,counter-(int)counter/10*10,false);
}

void processButton() {
  if (i != 0) { 
      if ((millis() - lastDebounceTime) > debounceDelay) {
          counter++;
          lastDebounceTime = millis();
      }
      i = 0;
    }
}

void buttonISR()  //ISR function excutes when push button at pinD2 is pressed
{                    
    i++;
}

To wind the coils, a coil former was fitted to a Dremel sanding drum holder and clamped into the chuck of the mill. A spool of copper wire was mounted on a wooden spindle clamped in the vice and then the end was fixed to the former using tape. The mill was then set to a very low speed. After a successful run, I then had to do it all over again as I'd forgotten to leave the end of the wire sticking out so that it could be connected.

Note that it would be dangerous to operate this at higher speeds.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 3 years ago +2
    Nice counter :) Guitar pickup I guess? I have the exact same mill.. how are you finding it? I've had mine for 8 years now, never had issues with it, one of the best tool purchases I've ever made I…
  • genebren
    genebren over 3 years ago +1
    Very cool! Years ago, I did a very similar thing for my lathe, except I did not have a 3D printer and I used a mechanical counter. What are the coils for? Building something interesting?
Parents
  • Workshopshed
    Workshopshed over 3 years ago

    This was why I was making coils

    community.element14.com/.../episode-552---magical-potion-bottle-rack

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Workshopshed
    Workshopshed over 3 years ago

    This was why I was making coils

    community.element14.com/.../episode-552---magical-potion-bottle-rack

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube