element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Not another Arduino or Pi question!! (Relax - I'm not that annoying, honest)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 7 replies
  • Answers 3 answers
  • Subscribers 662 subscribers
  • Views 565 views
  • Users 0 members are here
  • raspberry_pi
Related

Not another Arduino or Pi question!! (Relax - I'm not that annoying, honest)

the-dubster
the-dubster over 8 years ago

Before you all shout at me, I've done some digging, read similar questions on here and have actually made up my mind. This is really just to see if I made the best choice.

 

I've been digging around looking for a way to recreate a vehicle dashboard using Switec X27.168 steppers (nice low 5V and 20mA/coil with 315degree swing).

 

I initially looked down the route of the Laika Explorer but soon realised it was only capable of driving 1 stepper per board! Next I was looking at stepper driver boards for the Pi - I already have an old Model B lying around.

 

The more I looked and the more I read, the more I became convinced that the Microcontroller basis of the Arduino (Uno in particular) was the best option.

I also discovered that the steppers I'm using can be driven directly by the Uno - no HAT required (only 20mA/coil - source current is 40mA max according to specs); essentially if I protect the outputs with diodes then I'm golden (plus the Uno can drive 3 of them)!

 

The final nail in the coffin of trying to do it with a Pi was I found a nice resource of driver libraries for the motor I'm using - all for Arduino - and that does kinda help A LOT as I can learn what the code is doing and manipulate it instead of trying to figure out how to code it from scratch.

 

 

So, in summary, with the 6 available analogue inputs (I can use F/V convertors to turn the Revs / Speed into corresponding voltage levels - or maybe there is a way to use the frequency directly into Uno - I'll have to dig some more there), pre-made libraries and a proven application for exactly this, I'm hoping the decision I came to is the best one?

 

Any thoughts all? image

 

Anyone?

 

Regards

  • Sign in to reply
  • Cancel
  • shabaz
    0 shabaz over 8 years ago

    Hi Andrew,

     

    Using the Arduino for this sounds like it should work!

    You could use I2C for the comms between Pi and Arduino (with pull-ups to 3.3V, not 5V), some information on this is here:

    https://blog.adafruit.com/2014/02/21/connecting-an-arduino-to-a-raspberry-pi-using-i2c-raspberry_pi-piday-raspberrypi/

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • the-dubster
    0 the-dubster over 8 years ago in reply to shabaz

    Thanks shabaz I knew moving this 'question' around would finally get an answer.

     

    The extra info regarding linking it to the Pi could come in handy in the future, in the meantime I'm just waiting for my steppers to arrive from China - then it's time to experiment some!

     

    Regards and have a great weekend! image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jc2048
    0 jc2048 over 8 years ago

    According to the datasheet, the high output for the Atmel part on the Arduino will sit down to about 4.5V if you draw 20mA from it. So if your circuit is single-ended (coil down to ground), you'll be operating on 4.5V, not the 5V that you would think. [To be picky about it, the lower voltage will then reduce the current, so you'll probably end up with it balancing out at something like 4.6V and 18mA.] Might not matter, but it may have at least some effect on the rate at which you can step. (You're already at the low end of the voltage range of 5V-9V for the motor.)

     

    If you use the motor in a bridge (which you might have to, depending on how the coils are arranged), with an IO pin at each end of each coil, the other end that's being taken low to GND will rise up to about 0.5V sinking 20mA, so then you'll only have 4V across the coil. [Again, a little more, probably 4.2V and 16mA.] Doubt you will be able to swing it around as fast as was originally intended [without missing steps], but try it and see. As long as you protect the IO pins from going outside the rails, you're not going to do too much harm with a 260 ohm coil and the Ardino is a nice easy thing to experiment with (says me, never having used one).

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • the-dubster
    0 the-dubster over 8 years ago in reply to jc2048

    Thanks Jon, I actually bought the Uno compatible Kona 328 board from Orangepip - it set me back a whole £13.50 - (just under $18 USD) - so if I smoke it I'm not going to be remotely upset (well, not for long anyways)!!

     

    Swing speed isn't hugely critical, it's being used as both a Rev counter and Speedo, the rev counter will be the quicker changing signal and if I peg 7000 rpm @ 270 degrees then I can't imagine we'll get near the max 600 deg/sec rotation speed - especially if I stick with the Turbo Diesel engine I have - the 16V petrol unit may rev quicker but i'm not really bothered about it 'keeping up' when I 'free-rev' the engine, just whilst it's being driven on the road.

     

    Not sure where you got the motor voltage range 5V-9V info from, I've registered on the 'jukenswisstech' .com website (you can access their 'restricted' documentation) and all Tech Specs tabled are at coil voltage (Ub) of 5V, now I appreciate that 4.5-4.6V might be a bit low but not hugely. Where did you get your voltage range info from? What am I missing? image

     

    If it proves to be an issue then I'll look at a motor shield or similar. (This for instance)

     

    Thanks again and regards.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jc2048
    0 jc2048 over 8 years ago in reply to the-dubster

    I was looking at this (which I found by searching). Is that the same one?

     

    http://www.jukenswisstech.com/JSTFiles/downloads/2011/06/X27_Flyer_v1.3.pdf

     

    If it is the one, I was wrong about the voltage range [you'd think by my age I could read a datasheet properly, wouldn't you] - it's 5V typical, 9V max.

     

    It looks like a nice thing to play with.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • jc2048
    0 jc2048 over 8 years ago in reply to the-dubster

    That 'motor shield' you link to isn't a driver. It's the motor and eight diodes (for protecting the four IO pins) on a board ready to connect. So if it works for them connected to an Arduino, it'll work for you.

     

    This page has a link to a much better datasheet. It's got curves of the torque versus the voltage, so you can see what you lose when you move down to 4V rather than 5V.

     

    http://guy.carpenter.id.au/gaugette/resources/

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • the-dubster
    0 the-dubster over 8 years ago in reply to jc2048

    Jon, I know it's just a breakout board with protection diodes, my 'Shield or similar' comment was inaccurate, this and this more closely matched a 'driver or similar'. I did however read the reviews for it, and what do you know - this cropped up!

    "No problems driving the stepper although if I pushed the speed to quick it didn't move (yeah expected) so watch out for that."

     

    So yeah, basically your assessment was accurate!

     

    That flyer is for the same item, I just registered with the site to access the 'restricted' documents.

     

    Oddly enough I already have the link you mentioned, the Switec X25 Driver Library for Arduino is part of what swung me towards the Arduino choice, I didn't even spot the data sheets listed (just bookmarked the site) but the full Tech Spec docs I can now get access too - (really restricted they are . . . . ) - have the similar info (and I finally found the 'absolute maximum ratings' - 10V! keeping well away from that).

     

    The X27 seems an upgrade for the X25 too, so it'll hopefully perform better with the slight drop-off. TBH, for the price its definitely worth a go, if I fry stuff I learn, adapt and move on.

    When I finally build and test it I can see if it's up tot he job, if I need a driver - or even just a buffer - then I'll cross that bridge.

     

    Thanks very much for your input, its greatly appreciated and has given me much to think about!

     

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
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