Hi,
I am trying to make a bottom bracket rotary torque sensor for my cycle. Inspired by YouTube videos my design is,
Generate a low current 1khz AC signal using Arduino
Feed the output to a stationary (primary) coil mounted in the bottom bracket over the rotating shaft
Have a (secondary) coil fixed onto the rotating shaft with a strain gauge attached to the shat and connected as load to the rotary coil.
Measure the input voltage changes at the stationary coil .
The idea is that when AC signal/voltage is applied to the primary stationary coil that is coupled to the rotary secondary coil with strain gauge (resistance) would give a fixed voltage.
When torque is applied the resistance of the strain gauge would change varing the secondary load resulting in change in primary coil voltage.
I need to generate and also measure the voltage at the same time. Is it possible with one Arduino? Any example code for easy reference?
Do you have a strain gauge in mind that you can do some preliminary tests with? Measure how much the resistance changes with movement. You need to be sure the resistance changes will be enough for your project to succeed!
Some Arduinos have a digital to analog converter, A.D, and they can generate a sine wave. however, you proposed project includes a TRANSFORMER, which is a magnetic device using CURRENT changes to change the magnetic field. Any Arduino cannot supply enough power in a generated sine wave to make such a transformer operate.
What is used in your video to generate the sine wave? You could still use that to generate the sine wave and use sensors to monitor the sine wave voltage/current using an Arduino.
I just need the Arduino to generate 2 to 2.5 v peak to peak or maybe just 0 to 5v square wave ac signal with current capacity of around 20-30mA. Say ac voltage is reading 2 volt in the input of the primary coil with the strain gauge as load in the secondary. When torque is applied the resistance (load) changes , changing the 2 volts reading to more or less than 2 volts. The videos doesn't give complete details.
Well, accept the fact that an Arduino cannot generate any AC. A square wave signal will need to be amplified to generate the required current. By the way, what is the resistance of the coil that will get the sine/square wave?
The coil will be made by me as needed. The resistance can be as high as needed or if the limit is reached the frequency can be increased so the current drain is reduced.The resistance of the coil etc are secondary things.
What is important to know can Arduino generate a square wave that can provide around 30mA and at the same time measure the voltage of the square wave.
This discussion is going no where! If the Arduino generates a square wave is will be ZERO volts when low and will be either 5 volts or 3.3 volts when high. Nothing in between! Nothing to measure.
Yes, it can. 30mA is within the temporary 40mA current limit. Measuring the generated voltage does not show any new information, the voltage will be a full Vcc (3.3V or 5V) swing. But the actual current may be of some interest, related to the load on the secondary (rotating) coil.
AC current on a complex (inductive...) load is flowing forth and back. But you are right, the peak current flow can have any phase angle with respect to the voltage. Some analog peak hold circuit is suggested for picking the true peak current.
Thanks for taking the time to see the videos. Sorry but maybe you missed the word "Inspired" in my main post. If strain gauge produces miniscule variation, I can use a whetstone bridge configuration.