I am currently working on a project in which I intend to use accelerometers or IMU’s (whichever is best) attached to the arms of a pendulum in order to receive a stream of data, which is taken from tracking the movement of the arms of the pendulum. I then wish to use this data in order to modulate sounds I have created in ableton via either pure data or Max MSP.
So, as I am relatively new to all this, I could do with some help choosing the right accelerometers for the job.
Ideally this needs to be wireless as I feel the wires may get tangled with the movement of the arms.
Unfortunately we don’t carry any wireless accelerometers or IMUs, but we do have quit a few wired ones. I think for your application just an accelerometer would probably work just fine.
Thanks, if I was to have a couple of the accelerometers would I need another redboard for each extra one, or would they be able to run from the same one if serving similar functions?
if I was to have a couple of the accelerometers would I need another redboard for each extra one, or would they be able to run from the same one if serving similar functions?
It depends on the type of accelerometer you're using how it's done, but generally yes, you can use more than one on the same RedBoard/Arduino. It would take changes to the code to add more than one though.
also, Could you give me an insight into what sort of methods there are to make the accelerometer wireless?
One way to go wireless is to use a Raspberry Pi ZeroW, the remote feature of pigpio to bridge to the board serial of an Arduino board. This allows serial over a LAN connection (or I2C, SPI). I have done I2C, serial and PWM whis way.
I am a mechanic not a programmer but I do have functioning code I will share.
if I was to have a couple of the accelerometers would I need another redboard for each extra one, or would they be able to run from the same one if serving similar functions?
It depends on the type of accelerometer you're using how it's done, but generally yes, you can use more than one on the same RedBoard/Arduino. It would take changes to the code to add more than one though.
also, Could you give me an insight into what sort of methods there are to make the accelerometer wireless?
You could use a [microcontroller that has a radio built in, or you could add a [radio or even [Bluetooth to an existing micro controller. Keep in mind that adding parts will require you to do some electronics construction and will also require you to write your own software to make everything work. Unfortunately it’s not as easy as just plugging things together and having everything just work.
[/quote]
tech-mech:
One way to go wireless is to use a Raspberry Pi ZeroW, the remote feature of pigpio to bridge to the board serial of an Arduino board. This allows serial over a LAN connection (or I2C, SPI). I have done I2C, serial and PWM whis way.
I am a mechanic not a programmer but I do have functioning code I will share.
Dale
Thanks, I’ll look into it. If you could share the functioning code that would be great.
This is Python 3 serial communication test code. If I remember correctly the Python pigpio module will run on Windows and Mac as long as the target is a Raspberry Pi. On the Raspberry Pi you need to run sudo pigpiod from a command prompt.
'''
# Serial test by Dale Bartel
# In terminal on remote execute sudo pigpiod
# Comment out either local or remote
# Uncomment an ipAdrs to use remote
'''
import pigpio
ipAdrs = ('XXX.XXX.XXX.XXX') # Use a real IP address
port = 8888 # 8888 is default
pi = pigpio.pi(ipAdrs, port) # For remote use
#pi = pigpio.pi() # For local use
# Define the communication port
#tty_port = '/dev/ttyS0' # For mini UART, boards with Bluetooth
tty_port = '/dev/ttyAMA0' # For PL011, boards without Bluetooth
baud_rate = 115200
com_port = pi.serial_open(tty_port, baud_rate) # Create pigpio UART port
# Loop
try:
while True:
dataRdy = pi.serial_data_available(com_port)
if dataRdy > 0:
(byteCnt , byteArray) = pi.serial_read(com_port, dataRdy)
receivedString = str(byteArray, encoding = 'utf-8', )
print(receivedString)
inputString = input('> ')
pi.serial_write(com_port, inputString)
except KeyboardInterrupt: # Keyboard CTRL c, Shut down serial and close
pi.serial_close(com_port)
pi.stop()