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
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Andy Clark's Blog Azure Sphere Secure IOT - Connecting Sensors
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Workshopshed
  • Date Created: 18 Nov 2018 12:14 AM Date Created
  • Views 555 views
  • Likes 2 likes
  • Comments 0 comments
  • azure sphere
  • iot
Related
Recommended

Azure Sphere Secure IOT - Connecting Sensors

Workshopshed
Workshopshed
18 Nov 2018

OptoSensor

As David Murphy mentions, a stepper motor solution needs to know where the arrow is pointing when the device starts up. Looking in the spares box, I saw I had a Omron EE-SY310 reflective sensor from an old tachometer project, I used the phone camera to test the IR LED was working. This device has an open collector output so it will pull a floating signal to ground.

imageimage

There does not seem to be any configurable pull-ups on the Azure Sphere so I added my own pull up resistor between O and V on the above diagram. The LED anode was wired to one GPIO via a current limiting resistor and the cathode to ground. The sensor output was connected to another GPIO. I used the second header so not to clash with my stepper motor wiring. The code was adapted from the blink, using the EPOLL timers which seems to be a Linux like way of handling timers.

 

See https://www.systutorials.com/docs/linux/man/2-epoll_ctl/

 

The sensor output was simply mirrored onto the red LED on the board so I could confirm it was working.

image

I need to solder in my pull-up and then create a way of mounting a the sensor next to the motor. I'll likely design something that can be 3D printed as I already have some of the designs from another project. Whilst I'm doing that I'll design an arrow to point the way too.

 

Once I've got a working motor with slotted sensor disk, I'll merge my opto-sensor code into my stepper code and add a "home" feature.

 

More on this weeks SDK and Device update

One of the things mentioned in the new features post is an external MCU update. This is a sample app that demonstrates uploading code to a Nordic nRF52 Development Kit over UART (bluetooth). The approach for this is to include the data for the external MCU as a "resource" in the code. This allows both the application code for the sphere and the external MCU to be deployed via the same mechanism. I'll look into how hard this is to do and see if it can be used for configuring the GNSS receiver. A lot of the code in the sample app seems to be specific to that Nordic dev board so I suspect my example could be a lot simpler.

 

Another thing mentioned is that the default the "Strict" option for the C which is why some of the code changed for blink. However there are also some changes around how the timers are coded so the APIs are in flux too. It's also possible to target some of the "Beta" interfaces which I suspect will be changing even more so I'll be avoiding those if I can.

 

Reviewing the board update process I do believe I got the expected outcome. The notes suggest that future updates will be simpler and automatic (assuming you are on the network).

 

Motor Mount

I've put together a design for a mounting plate for the motor and sensor using Fusion360. I'll also be creating a pointer and and reflector before printing them out.

image

There's a few issues with this initial design. I needed to trim back the holes for the mounting lugs as I'd undersized those. Also the tray for the sesor is not quite right so I'll dremel this one and reprint if necessary.

image

  • Sign in to reply
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