So my daughter, HS senior, is doing a project for STEM in school. Essentially the team want to build a device with a slope that can be used to measure the slip resistance of various materials on the incline. The incline needs to be able to reproducibility move to preset inclines (measured in degrees or percent of slope)
She asked me to help with the hardware as I have some experience with Pi's and Arduinos. Now let me say I would call myself an enthusiastic beginner!
So here is what I was thinking.
Use a linear actuator to move the incline to set positions. I bought an eco worthy 12v 2 inch stroke one off Amazon.
Use an Arduino to control with either a motor controller like the l298N or relays.
Run it via a 12v volt lead acid battery for transportation convenience.
Ideally use an app to set the preset inclines. I have bought a bluetooth HM10 BLE module
So up to now I have assembled the parts and I can get the Arduino via the L298N to move the actuator in or out. I have not tried the relays yet but I am assuming that would work also. I have setup the BLE module and that also seems to work on a rudimentary level.
What I am stuck on is how do I get the presets to work. I have looked at all sorts of tutorials and I can't figure it out. I assumed some simple function for timing the movement, i.e. set the pin high or low for X amount of time, I realize I will have to figure out the time for each preset? Also some information seems to indicate this is best with PWM signals, which I cant follow at all?
Also the relay I picked up has 8 channels, can I not wire the actuator to it and set every relay to a predetermined time? So relay 1 would always bring the actuator to full retraction, then relay 2 to a set limit, relay 3 to a set limit etc...
I think the relay method is attractive, if possible, because then the iphone app would need me to just send a signal for one relay?
Hope someone can point me in the right direction. Thanks in advance.
I have ordered a book on coding and a parts kit foe testing stuff.
Time alone is always going to be difficult to get you to a given angle as conditions may vary, motor can be slower or whatever
to get to a specific angle you could have a quadrature rotary encoder on the hinge of the incline and a end course switch so that you know when you are at say 0°.
alternatively you can use a Digital Accelerometer like the ADXL345 to measure the angle
Could I use the ADXL345 to control the actuator? So instruct the actuator to move and then stop when it gets a signal from the ADXL345 that's at the right incline position?
sure as long as you've calibrated the ADXL345 so that it knows where it is, then you could ask your actuator to start moving and track the angle with the ADXL345 or an inclinometer which will send the STOP order to the actuator
Thanks, I see I have a to of home work to do! I will start to build the components out in a few weeks off on vacation next week, But can do some homework when I am away.
@Delta_G's point is that all your posting include a lot if "I need", not "we need"... so the whole conversation feels like you are building the incline and the arduino code for her and that was his point.
This? Actuator
If you had bought an actuator with built in stroke length feedback (usually a linear potentiometer), you would be halfway home,but...
Seems like an awfully powerful (330lbs) and expensive actuator, how heavy is the platform?