analog to digital using an audrino...

Discussion in 'Digital Circuit Design' started by Xjsport95, Dec 26, 2016.

is the audrino a better choice?

  1. Stay analog

    0 vote(s)
    0.0%
  2. Go digital

    100.0%
  1. Xjsport95

    Thread Starter New Member

    May 8, 2016
    5
    0
    so I was using a set of relays to control a linera actuator, it gets a single 12v+ pulse to make it go until it hits a limit switch and stop, when pulsed again it travels in the opposite direction until it hits the limit then stops... A friend told me an audrino would be a better set up, I ordered on and am completely lost... I took a class on c++ years ago and figured it would come back to me but its not. any help would be greatly appreciated... Thanks
     
  2. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    5,370
    2,028
    If that is the extent of your programming knowledge, there will be a learning curve. Until you can understand the simple example programs and can write your own "blink the LED" sketches, controlling your linear actuator won't be possible.

    If you do understand programming, the Arduino solution is easy but you'll still need to supplement it with an analog driver for the sctuator.

    Using a microcontroller is an excellent skill to have. Some will argue otherwise (there are two camps here that can't agree), but the Arduino is a good start

    So, try to understand the LED sample program and try to modify it so that it blinks a pattern. Then, modify it to detect a push button or switch and illuminate the on board LED. Or use an external LED. Basically, learn by taking baby steps.
     
  3. dannyf

    Well-Known Member

    Sep 13, 2015
    2,196
    422
    why would this require adc?
     
  4. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    5,370
    2,028
    Don't confuse the issue. Obviously if you read beyond the title, the TS is not talking about ADC. He believes he has an analog solution but someone has suggested that a digital solution is better.
     
  5. Xjsport95

    Thread Starter New Member

    May 8, 2016
    5
    0
    The system I have now works fine. I'm curious if the audrino would prove a better system... I know how the setup I have now works im just stuck on setting up the other one... if it works better that's great, if not I'll stay with what I have now... if the new one doesn't work how I want it to I'm not out much $, plus it wld give me a tool I can learn on
     
  6. OBW0549

    Distinguished Member

    Mar 2, 2015
    2,927
    2,690
    In what way is an Arduino-based system supposed to be "better" than what you've got now? What will it do that the present system will not? And do you actually need it to do those things?

    Keep in mind that an Arduino-based system is not going to do anything until you learn how to program it.
     
  7. andrewmm

    Senior Member

    Feb 25, 2011
    139
    26
    Have you installed the arduino tools ?
    They are on the arduino.cc web site.

    Have look here,

    https://www.arduino.cc/en/Guide/HomePage

    Arduino is a family of compatible processor boards, and an included tool set ( IDE)
    install the off line IDE from the options in the above link,

    First start is to get the arduino powered up, and the on board led should flash.
    this is the default program 'all' arduinos are sold with.
    lovingly called blinky.


    From the above link, you will get into the IDE.
    Arduino has a slightly strange language if you have C++ ,

    so a program to you and me is called a sketch, and the arduino IDE will be very forceful on its file / folder structure.

    You will see arduino code has two sections,
    the first one runs once on start up ,
    its where you put the pin names you want for what pins,
    start things like the serial link to talk to the computer et al.

    The second bit runs constantly in a loop,
    its where you put the actual code,

    so something like

    turn led on
    wait a bit
    turn led off
    wait a bit

    would run for ever, flashing the led on and off.

    The actual arduino code is

    // the loop routine runs over and over again forever:
    void loop() {
    digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(1000); // wait for a second
    digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
    delay(1000); // wait for a second
    }

    there are lots of built in examples and support on the web site,

    reading the adc and writing to the dacs is just abut as easy,
    with analogRead and analogWrite.

    get in and give it a go,

    As to why digital or analog.


    If a processor can do the job, at a price you want, go digital, it gives you many more options,
     
  8. dannyf

    Well-Known Member

    Sep 13, 2015
    2,196
    422
    the original solution is "digital", implemented in relays.

    as such, using ladder logic on a plc (avr) would be a natural extension of the original design.
     
  9. GopherT

    AAC Fanatic!

    Nov 23, 2012
    7,983
    6,786
    So, you want to invest time and equipment to improve something that works fine while risking that the system is down for some period of time to set up the arduino?

    Are you just thinking an arduino will be better just because it is not a relay? Or, do you have a strong desire to learn programming and microcontrollers with hopes of using arduinos in other applications where they are really going to improve something.
     
  10. andrewmm

    Senior Member

    Feb 25, 2011
    139
    26
    you missed the bit
    "If a processor can do the job, at a price you want, go digital, it gives you many more options"
     
  11. andrewmm

    Senior Member

    Feb 25, 2011
    139
    26
    Hows it going ?
     
Loading...