4 Replies Latest reply on Aug 23, 2019 9:20 AM by colporteur

    Motor Stuff

    engineguy20

      i actually have 2 questions here.

       

      1.) Has anyone used a NanoPi M4? what was your experience and how does it compare to the RP3 and RP4 (if you've used the new RP4)?

       

      2.) I'm working on building a small solenoid (from scratch) that i would like to try to control with an RP. I know the very basics of coding and writing programs and circuitry, and could definitely use some pointers/help to make this happen.

           Does anyone know where i could go to download or search through some libraries to use to help me along the way? maybe someone knows of or has code they could share?
          
           I have a basic idea of how the circuit will look or should be built, but i don't want to burnout any valuable equipment, is there a wire diagram to follow and use to figure out how to put this together using analog and digital capable

           Hal Effect Sensors hooked up to an RP? The Hal Effect sensor will be used to track the position of the magnet in the solenoid. the circuit below is what i have in mind... I know it doesn't make a lot of sense just yet, but its a place to start.

           my first specific question is what would i attach the Hall Effect sensors to next? eventually they need to make it somewhere to an RP, but i'm sure there's more that needs to be put in place in between.

           this is a broad question that probably requires much more detail and defined parameters, but i'm learning as i go here so if you ask me a question about the project i can give better details.


           Any tips/thoughts/suggestions are much appreciated!

        • Re: Motor Stuff
          shabaz

          Hi Adam,

           

          There's information on how to attach one sensor to the Pi here: https://www.raspberrypi-spy.co.uk/2015/09/how-to-use-a-hall-effect-sensor-with-the-raspberry-pi/

          and how to read it using Python. Connecting up four of them is similar, and the 3.3V and 0V (GND) connections on each one will be tied together respectively, and the output pin on each one will go to a different pin on the Pi. But better to start with just one sensor in isolation, get the code reading it, and then expand to four of them, otherwise it makes troubleshooting hard.

          I'm not sure what the intent of the code is, but you'll be able to read the sensor state using the Pi, and print it to the screen, control some other output, etc. Regarding the project, I don't know if you can generate much power in this way, because not much flux is being cut by the wires if the magnet is outside like this. You may need to experiment. There's some good stuff to read here (this is a starting point, that website has many areas to read: AC Motors and Generators  )

          Regarding Pi or NanoPi, if you're starting off, it would be better to pick a board which has a lot of support. The Pi's much better in this respect I think (at least on this website, I've not seen any articles on NanoPi). For choice between Pi 3 or 4, there's likely no difference for your application. Both are quite powerful. I have a Pi 4, but I still use a Pi 3 for many tests. If there's little cost difference from where you're purchasing, then you may as well go for the Pi 4. The Pi 4 needs a USB C power supply and (if you're connecting it to a TV or monitor) a micro HDMI cable. It's possible to use it remotely (from a PC), in which case you don't need the micro HDMI cable.

          There's some getting started stuff for Pi here (some refers to Pi 3, but it is applicable to the Pi 4 too):

          Getting Started with the Raspberry Pi 4 Computer

          Before You Start Coding the Pi

          Accessing and Controlling the Pi

          Working with the Pi: Getting Online, I/O and Command Lines

          Raspberry Pi Projects   (these are organized by beginner, intermediate and advanced)

          https://www.raspberrypi.org/magpi/

          5 of 5 people found this helpful
            • Re: Motor Stuff
              engineguy20

              thanks for the response shabaz!

               

              the magnet will be inside the solenoids, i just didn't have a want to indicate that on the drawing. and the intent of the project is to use the Hall Effect sensors to determine the position of the magnet within the solenoid/s.

              I've been told that the HE sensors are pretty accurate, so i thought i would give it a shot. Good point on starting with one sensor and figuring out the code for that before jumping over to 4, i'll start there. and thanks for

              the additional material to look up.

               

              in reguards to the NanoPi M4, that's a separate project, i just wanted to know if anyone has used it and what they thought.

            • Re: Motor Stuff
              colporteur

              Maybe it is to early in the morning and I'm not fully awake but what is the difference between a solenoid and a relay?

               

              This leads to the question, why build a solenoid?

               

              The questions are not designed or intended to be funny.

              Sean