Electromagnets & Arduino

Discussion in 'The Projects Forum' started by lagmonster, Jun 2, 2014.

  1. lagmonster

    Thread Starter New Member

    Jun 2, 2014
    5
    0
    I am attempting to begin a project based on controlling the strength of multiple electromagnets with an Arduino.

    I was wondering what Arduino board and other parts would be suitable to start building this project and making a move with it. Any help would be amazing!

    Thanks
     
  2. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    The choice of Microcontroller is based on things like the number of I/O pins you need, program size, memory requirements etc. You really need to start at the other end of the problem and work out how to control one electromagnet and then work up to multiple, which will help you choose a controller.

    What are you wanting to achieve by controlling the strength of multiple electromagnets?
     
  3. lagmonster

    Thread Starter New Member

    Jun 2, 2014
    5
    0
    I want to essentially create a magnetic equivalent of an lcd screen, so I am able to create shapes based on the magnetic strength.
     
  4. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    When you say "shapes" do you mean like a 3 dimensional surface? How many "pixels" will the screen have?
     
  5. lagmonster

    Thread Starter New Member

    Jun 2, 2014
    5
    0
    Ideally I would like to start with a 3 by 3 array of "pixels" that are flat.

    e.g

    O - Electromagnet

    O O O
    O O O
    O O O


    I would then have the ability to apply a varying strength to each of the magnets.
     
  6. Alberto

    Active Member

    Nov 7, 2008
    169
    36
    Since you need to controll the strenght of the single magnet and you have nine of them, you will need a MCU with nine indipendent pwm output, plus nine ADC to monitor the current supplied to each magnet


    Cheers

    Alberto
     
  7. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,387
    497
    I have never done anything with electromagnets.

    So you want to control the strength. What control scheme do you have in mind? One of the more obvious schemes is to vary the time that the magnet is ON and OFF. Usually, but not always, this sort of thing is accomplished using PWM.

    Another thing. Depending on the magnet... uC might not be able to provide enough voltage/current or both. So you would have uC connected to switching circuit (probably transistor in the Switch configuration, not complicated), switching circuit connected to the magnet.

    Bottom line: stop talking, start drawing block diagram.
     
  8. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    A place to start would be by Googling "Digital to Analog conversion" but beware you will get loads of results for "Analog to Digital" which is a different thing. I believe that only the Arduino Due has DAC and then only two channels so you would need some way of multiplexing those onto your nine magnets. Alternatively you could use external DACs and if you went that way you could use TWI (I2C) devices and address them off any Arduino - see this for an introduction - https://learn.adafruit.com/mcp4725-12-bit-dac-tutorial/overview
     
  9. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,387
    497
    I hope to God that they fixed Arduino Due DAC.

    But if they did not fix it. Then the DAC is SUPPOSED to provide 0-3.3 volts. IN REALITY it provides 0.5-2.75 volts. So you will never hit 0 volts and you will never hit the max of 3.3 volts.

    Due does have a "gazillion" io pins so you can use an external DAC chip.
     
  10. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    But like I said, an I2C DAC (or 9) only needs two pins and can be run of a much smaller and cheaper Arduino
     
  11. lagmonster

    Thread Starter New Member

    Jun 2, 2014
    5
    0
    And what other starting documents would you recommend before I start wiring up and playing with them?

    Would it benefit to buy a type of arduino that would be suitable to learn as I try to create this?
     
  12. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,770
    970
    You should start by attempting/learning the tutorials on the arduino site.
    Get a led to blink, then a button,etc.. walk before you run.
     
  13. lagmonster

    Thread Starter New Member

    Jun 2, 2014
    5
    0
    I am able to write some JavaScript so I just don't want to be hitting the next stage too fast. So want to have everything in front of me. What sort of Arduino do you advise buying? And is there a point in the starter kits?
     
  14. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,770
    970
    The starter kits will typically include all the other parts needed to build many of the starting tutorials. If you've got a bunch of parts already then there is really no point.

    Personally I'll just use an Arduino Mega for everything.. I keep a few on my desk at all times. But even the UNO is plenty for "most" projects. I don't keep track of the new ones out there with the 3.3v limits. Been wanting to get a 32 bit Chipkit or similar to try out..

    The arduino language is very simple to pick up IMO. Based on C and shouldn't be too hard if you already do some programming in any language. Its just that mentality of understanding how code works/flows that you get from knowing any programming languages.
     
Loading...