Okay, so I'll preface this like I always do -- my answer here is my personal opinion and does not reflect what may actually happen. It takes 5 votes to close something and I would just be one. Likewise, it takes 5 to reopen something and I would just be one there too.
However, I will wager that this question as worded would be off-topic under the engineering close reason, which says:
This question appears to be about engineering, which is the application of scientific knowledge to construct a solution to solve a specific problem. As such, it is off topic for this site, which deals with the science, whether theoretical or experimental, of how the natural world works. For more information, see this meta post.
I think your question kind of hits the very definition of using physics to construct a solution to a very specific problem.
However, this is something that you could certainly ask about in the chat room and people might be willing to help there.
On further thought, you might actually be able to ask some engineering-like questions from this because it is used for a scientific experiment. I know it gets tricky to figure out what is engineering and what is experimental design. I still think that asking how to build the magnetic would be off-topic. But once you have a design in mind, asking things related to the construction as it pertains to the experiment might be okay. For instance, maybe questions about how to isolate the magnet from the sensors to prevent/eliminate interference would be okay. Or maybe... I dunno, I guess we would have to know what your actual experiment was like to know what kinds of questions come up. But if you can frame your question about building something where your experiment imposes unique constraints or challenges, it may be on topic again. So it's a fine line.
I'll close by saying that the best way to do this is to build an electromagnet. I did this back in high school physics -- I found a 2" iron bar about 2 feet long, hooked it up to a lathe so I could quickly wrap a ridiculous quantity of wire around it and then I went to every Radio Shack in a 50 mile radius of my house to buy up every single 12V lantern battery I could find. I didn't think ahead about how much heat it would generate and melted my first iron bar, but then I did it again and got my teacher to let me pump liquid nitrogen around the rod and we were able to lift about 500lbs. The magnet could have done more, but we weren't strong enough to hold up much more on the end of it and we didn't build a giant rig to deal with it.
So -- electromagnets. Go read up on those and I bet if you have specific questions about construction, the folks over at the Electrical Engineering SE may be interested in helping. And if you have questions about why or how they work, there's probably a dozen questions you could ask on here to help you with that bit.