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
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino Uno + Raspberry Pi + workout stepper.
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 15 replies
  • Subscribers 392 subscribers
  • Views 1368 views
  • Users 0 members are here
  • raspberrypi
  • arduino
Related

Arduino Uno + Raspberry Pi + workout stepper.

dtsartsanis
dtsartsanis over 10 years ago

Hi everybody this is a very simple project i just finished.

 

For this project i used an Arduino UNO, a Raspberry PI model B, a couple of leds and a workout stepper. Usually workout steppers have small displays and you have to look down to see the progress of your workout. In my project i managed to remove the old display, connected to Arduino UNO as a simple switch. Then UNO is running the sketch through the Raspberry and using Pyserial, Bottle.py and Arduino-Serial-to-Browser so we can have our stepps to our browser.

 

Raspberry PI is using the latest raspbian image and after we fully update and upgrade it, we have to install the Arduino IDE. i preferred to install the latest one 1.6.0 which works fine.We dont have to install pyserial because it is already installed, but we have to install Bootle.py (see here Bottle: Python Web Framework — Bottle 0.13-dev documentation ) and Arduino-Serial-to-Browser from here https://github.com/whichlight/Arduino-Serial-to-Browser .

 

We start by uploading the sketch to UNO, then we open a terminal and we run the Arduino-Serial-to-Browser.py and finally we can open a browser and we type http:/127.0.0.1:8080.

 

The Arduino also have 5 leds. 4 for our step progress and one blinking for every two steps because the sketch counts 1 step for every 2 physical steps.in the delay time i noticed that if you set 500 ms then we have 1 step for every 1 physical step.

 

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

Attachments:
arduino_stepper_counter_leds.ino.zip
  • Sign in to reply
  • Cancel

Top Replies

  • gadget.iom
    gadget.iom over 10 years ago in reply to clem57 +2
    Well according to his code the Green lights every 2 steps, the other 4 light up sequentially at 500, 1000, 1500, 2000 steps. They all cycle in order above 2100 steps.
  • gadget.iom
    gadget.iom over 10 years ago +1
    Nice work! You could simplify your setup and look at arduino-ethernet bridges and host the web page on the UNO.
  • clem57
    clem57 over 10 years ago +1
    dtsartsanis I like the way you used the Raspberry Pi with Arduino. Especially Arduino-Serial-to-Browser software gem. The combination of Arduino Uno with Raspberry Pi looks to be equivalent to Arduino…
  • gadget.iom
    gadget.iom over 10 years ago

    Nice work! image

     

    You could simplify your setup and look at arduino-ethernet bridges and host the web page on the UNO.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • dtsartsanis
    dtsartsanis over 10 years ago in reply to gadget.iom

    I wanted to create something like a media/fitness center. Now with the new Raspberry Pi 2 you can watch your favorite youtube videos or check your emails during your workout.But i dont have a Raspberry Pi 2 so i made it for the model B. But still works image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • gadget.iom
    gadget.iom over 10 years ago in reply to dtsartsanis

    Good stuff. image

     

    Looking forward to seeing the project progress.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 10 years ago

    dtsartsanis

      I like the way you used the Raspberry Pi with Arduino. Especially Arduino-Serial-to-Browser software gem. The combination of Arduino Uno with Raspberry Pi looks to be equivalent to Arduino Yun except the power of the Pi is more than Linux on the Yun! How much storage did the sketch use on Uno including libraries?

    Thanks,

    Clem

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • dtsartsanis
    dtsartsanis over 10 years ago in reply to clem57

    Sketch uses 3.294 bytes (10%) of program storage space. Maximum is 32.256 bytes.

    Global variables use 202 bytes (9%) of dynamic memory, leaving 1.846 bytes for local variables. Maximum is 2.048 bytes.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 10 years ago in reply to dtsartsanis

    Thank you for the quick reply!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • dtsartsanis
    dtsartsanis over 10 years ago

    Just managed to embed a youtube video to the html file

     

    Open with a text editor the index.html file at the Arduino-Serial-to-Browser folder and at the top add the following lines

     

    <html>

    <body>

      <object data="http://www.youtube.com/embed/W7qWa52k-nE"-->you can add here the video of your preference.

      width="560" height="315"></object>

    </body>

    </html>

     

    Then run the program and you are ready.

     

    *i forgot to plug in the audio jack to the Raspberry Pi and you cant hear any sound, but it plays fine and also this is with a wifi connection which is also fine for the model B.

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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 10 years ago in reply to dtsartsanis

    dtsartsanis

        Fantastic way to exercise and watch the Ben Heck show.image

    Clem

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • dtsartsanis
    dtsartsanis over 10 years ago in reply to clem57

    You can also use the above project with the Raspberry Pi A or A+ but the content of the serial port will be displayed at the terminal and we can save them also to a text file. We know that the Raspberry Pi A/A+ have only 256 memory so it would be very difficult to use the browser.

     

    Start a new txt file and add the code from the attached file and then saved it as a python file with a .py extension.

    Load the sketch to Arduino, next open a terminal and cd to the folder that you have saved the above file. Run the file with sudo python and your .py file.

    Your steps then will be displayed to your terminal and at the same time a file will be created in the same folder with your .py file, called templog.txt with your steps.

     

    If you see the code there are the below lines

     

    port.setDTR(False)

    port.flushInput()

    port.setDTR(True)

     

    these are important and if you remove them you will see your content displayed with \r\n at the end.So these 3 lines actually "cleaning" the serial from these characters.

     

    In situation where u want to save data from arduino's serial port  in a pc u can still use a very handy program called Cooltherm and can be found here Roger Meier's Freeware

    But in situation like the Raspberry Pi where u cannot  run x86 programs the above way is a good solution.

    U can also use the above code to save data from a temperature sensor connected to a Raspberry Pi (you will have to remove first the 3 lines above) and then insert the data from the .txt file to a LibreOffice file.

    Attachments:
    serial_port_data_logging.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dtsartsanis
    dtsartsanis over 10 years ago

    This is how u connect the stepper to the Arduino and the led's connections.

     

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • 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