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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
Robotics
  • Technologies
  • More
Robotics
Forum What hardware should I start with..??
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Robotics to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 17 replies
  • Subscribers 63 subscribers
  • Views 1474 views
  • Users 0 members are here
  • sensors
  • maturity
Related

What hardware should I start with..??

Former Member
Former Member over 11 years ago

I manufacture a small part in a garage on my property and have for many years.

I have made as many mechanical tools as is practical.

I now need to begin building digitally controlled robots.

My thought was the following...

I could build a very complex robotic system from two types of controlled motors.

Linear actuator with encoder ring or other sensor I do not know about

and a gear step motor also with position sensors.

 

I have python installed on my pc in a virtual OS and have been doing tutorials.

So far I am having no problems understanding code or the way in which a step motor is controlled.

 

Question:

Is raspberry pi starter kit with gert board the way to get my self acquainted with digital motor control and building working robots.?

Any one who is in the know I sure would appericate a little guidance.

Adam R.

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 11 years ago

    Hi hersey..., i am making a project in which i have to interface accelerometer

    sensor, GPS modem and GPRS modem with Raspberry pi. can i write the

    above devices interface coading in C language. is it ok, with the

    hardware.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • iagorubio
    0 iagorubio over 11 years ago in reply to Former Member

    hrpreet,

     

    As a rule of thumb, yes raspberry can control through the C language, sensors such as an accelerometer, a GPS, and a GPRS modem - and pretty much everything as the whole kernel is written in C.

     

    But you need to tell us what interfaces are using the devices you want to connect.

     

    If the GPS and the GPRS are connected through USB - the easiest way - you can easily control them through a USB-to-serial port, just opening the port as a file and reading the NMEA data - GPS - or using AT commands - GPRS.

     

    The accelerometer, can be an UART, I2C, SPI ... and yes you should be able to control any of those through the GPIO pins, but to be able to do them without a level switcher depends greatly in the voltage levels supported by your sensor - the Raspberry GPIO are 3.3 volts.

     

    So there is pretty much no information in your post to let people help you, as you are not even pointing to what kind of sensors you are talking about.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • iagorubio
    0 iagorubio over 11 years ago in reply to Former Member

    hrpreet,

     

    As a rule of thumb, yes raspberry can control through the C language, sensors such as an accelerometer, a GPS, and a GPRS modem - and pretty much everything as the whole kernel is written in C.

     

    But you need to tell us what interfaces are using the devices you want to connect.

     

    If the GPS and the GPRS are connected through USB - the easiest way - you can easily control them through a USB-to-serial port, just opening the port as a file and reading the NMEA data - GPS - or using AT commands - GPRS.

     

    The accelerometer, can be an UART, I2C, SPI ... and yes you should be able to control any of those through the GPIO pins, but to be able to do them without a level switcher depends greatly in the voltage levels supported by your sensor - the Raspberry GPIO are 3.3 volts.

     

    So there is pretty much no information in your post to let people help you, as you are not even pointing to what kind of sensors you are talking about.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Former Member
    0 Former Member over 11 years ago in reply to iagorubio

    Hi,

         Im going to interface accelerometer, GPS, GSM module to Raspeberry Pi through USB only. Im getting trouble in the Coding... I need your help in the coding to interface all this device to Rpi.

         If the coding is in C or C++ that would be very help full for me.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • iagorubio
    0 iagorubio over 11 years ago in reply to Former Member

    You should at least post what devices you are using.

     

    There is no way to help if we don't know what you are interfacing with.

     

    Usually those USB devices open USB-to-serial port.

     

    The GPRS modem is driven by AT commands, in the documentation of your device should come what AT commands it supports.

     

    The GPS data use to be in NMEA format, this is a open C library to read NMEA streams http://nmea.sourceforge.net/

     

    About the accelerometer I have no idea, I have only used I2C accelerometers.

     

    You should check if your raspberry opens the devices com port and recognizes them. Just plug one and use the "dmesg" command to see the kernel output.

     

    If it says something about /dev/ttyACM0 or /dev/ttyUSB0 - that's 0 or 1 or 2 ... - then your device is recognized and the USB to serial port created.

     

    You can use the "cat" command as root and is some garbage or text is spilled to the console, there is output from the device.

     

    To read from it usually just involves to open the port as a file.

     

    FILE* fd;

    int char;

     

    fd = fopen("/dev/ttyACM0", "rw");

     

    if( !fd ){

         return 0; // error cant read com port

    }

     

    while( (char = fgetc(fd)) != EOF ){

         // you have output in "char"

        // do whatever you need with it

    }

     

    If your raspberry don't opens the port you should check first if the physical connection is working with the "lsusb" command. This should output the device name if the kernel can detect it on the usb hub:

     

    Example output is:

     

    $ lsusb

    [iago@ironforge ~]$ lsusb

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    Bus 002 Device 036: ID 0424:2504 Standard Microsystems Corp. USB 2.0 Hub

    Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse

    Bus 007 Device 002: ID 413c:2005 Dell Computer Corp. RT7D50 Keyboard

     

    If it's recognized but not mounted as a usb to serial port first and foremost check the documentation of your device. If it is not a serial device and you have the protocol data you can use libusb to interface with it.

     

    If it's a serial device you may have to do an udev rule to have the dev entry made for you, from the idVendor, idProduct and serial number of your device from the kernel output.

     

    Anyway, it would be much much better to start a new thread so people who knows about those issues can help you, than to keep writing on this one where people just see it's about something completely unrelated. If the title matches the content of the thread is much easier to get people involved in it.

    • 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