I am planning on building a motorcycle telemetry setup. Hoping to measure speed graphed over time, rpm graphed over time, accelerometer/gyro/gps, tire temp sensors, control 2 servo motors that will be paralleled so basically controlling 1, with future plans of measuring braking pressure. I am a newbie to the world of arduino and was curious if this is even possible to do with the arduino.
Thanks for the time.
EDIT 1/30/23 - TLDR Currently using a Mega REV3 and hope I don't use to much space for this project. I have copied and modified non contact IR sensor program and now working on implementing it physically. Will probably need an I2C extender for sensors. Looks like I can only add 6 sensors at 5v or it'll go boom to soon.
Sensors are now 2 mlx90614 IR non contact temp (potentially 3), 1 VL53L0X Distance ToF (potentially 2), GPS (unordered), Accelerometer/Gyro multi axis (lean angle, G forces, and hopefully servo control). Could be forgetting something as I do not have my notes in front of me but I will have the sensors in front of me and will be testing ToF and IR sensors by 1/31/23.
EDIT 2/1/23 - I now have an Arduino Nano & Mega and have been testing configurations. I have learned the software and downloaded many libraries.
I have on hand an IR temp sensor (MLX9064), ToF distance sensor (VL53L0), a 6 axis accel/gyro (MPU 6040), an sd card unit, 3.3v to 5v converter, and a relay. I have ran programs on the Temp, ToF, and 6 axis accel/gyro. All are working but are working individually and not in series. Next goal is to add all 3 working together at same time. Then I have to see if I can make my relay open and close from one of my inputs (relay is used to supply voltage from Motorcycle battery to 18650 batteries when ignition is off to keep batteries charges and to keep motorcycle electronics from interfering with analog comms.
Out Your post, maybe possible, but not sure if You will pull it through.
Please read the topic "How to get the best out of this forum" and act accordingly.
I have no plans and no current idea on how to transmit data. most likely store data on motorcycle.
Data is acquired in mostly real time. Delays aren't critical but information increments in .1 seconds would be a goal. Only thing that's time critical is servo motor output but that part is the easiest part to do with my current knowledge. Unknown data per second. RPM would be 4 pulses a second I believe which I would have to translate into RPM.
On what's receiving the data I do not know. Would it be easier to run a Raspberry Pi and have it do all? Raspberry's don't like real time from my knowledge though. I could always store the info on a Pi though.
I am in brainstorming phase. Currently 3d printing parts for the project and now I have started the electronics side. I have nothing purchases except a Raspberry Pi zero w and an arduino uno.
It does look like most code can be copied and modified slightly to work for what I want though.
The term telemetry implies wireless transmission of data. If you are storing data on board, the term would be data logging.
You could log the data to a SD card. Then it is easy to pull the card and insert it into a reader on a PC for analysis and presentation.
10 samples a second to SD is possible.
Will you want time stamps on the data? How accurate will the sample rate need to be?
I know nothing of Raspberry Pi. An Uno is OK for development, but a Nano or Pro Micro would be better for something mounted on a bike. Other choices could be one of the Teensie boards. There are many othes to choose from.
That is quite an undertaking for a newbie. Do you have experience in automotive/motor bike electronics? Automotive is one of the worse electronic environments to work in. I understand motorcycles are not much better. I also recommend posting at least a preliminary annotated schematic of your circuit showing all connections including power, ground, power supplies etc.
Sorry about the word mix ups. All the motorcyclists call it telemetry. Also it makes sense why they say data logging because in MotoGP the team has the data in basically real time in the pits. So yes I will be data logging with the occasional output.
I would prefer time stamps on the data not a deal breaker though. Sample rate could have easily be + or - 5% with basically zero problem.
I know very little when it comes to the boards capabilities. I just bought the uno and the pi because I like to tinker. I've had them both since 2019 and yet to do something with them. I am also completely ok with purchasing almost anything I'd need to finish this as most stuff is relatively cheap and I'd like to have a prototype by sometime in May.
I have tons of experience with automotive and motorcycle electronics. I am currently rebuilding a Fiero and completely redid the wiring harness ground up. Also I have had to repair my motorcycle harness multiple times. I am an industrial electrician and robotics by trade currently working in CNC environment.
I will gladly post schematics when I make them. Should be relatively soon hopefully. I need to learn all the power requirements. I could draw something VERY rudimentary tomorrow at work but won't have voltages. Worst case scenario Id run a small inverter to power 5 or 3.3 volts off the battery (most likely 5v because servo's). Also I believe my sensors run off of 5v and could possibly use this assuming its clean enough voltage. Any problems with power cycles?
So far plan on using these servos. I will be seeing if these will work tomorrow.
Getting clean well regulated power in an automotive or motorcycle environment can be challenging. Much has been written about that on this forum and some time taken with the search function would be well spent.
Much appreciated. That's where I'll be in the meantime then.
To many arduino models! I think I'm going to purchase a nano ble sense if available and power it from the Vin with 2 14500 as they are small. this will mostly guarantee clean voltage and the arduino will not suck enough power in 30 min. If need be I can run 18650 or 21700 depending on needs. Will start with 14500 unless someone says otherwise. Then I can install a protection device and when motorcycle is off It can charge the arduino batteries from the motorcycle main battery with a relay that shuts off charging when key switch is on.
Now I'm reading that powering through the Vin is also asking for trouble.
Would a lipo 3.7 to 3v3 converter give any better results than just running a linear convertor off my 5v power supply on my ecu?
Does anybody see a problem with this?
Picking up 2 nanos off a buddy tomorrow 1 is 5v power and other is 3.3v power. I'll be testing on my motorcycle to see what works first hand until more knowledgeable people chime in (like those that already have). I'll most likely be buying various components as I would like fail fast and not get hung up on $25 dollars worth of gadgetry.
What is your vision for getting sensor data? Does this bike have an OBD port or CAN bus from which you're taking data from existing sensors, is it going to be add-on sensors, or some combination?
If it were me, I'd start with the Raspberry Pi, at least for prototyping, until I ran into a problem that it doesn't readily address. It's just easier to develop in a less resource constrained environment, but this presumes familiarity with the platform relevant development tools. I doubt your real-time requirements in this case are particularly stringent, but it would be easy enough to add a supplementary Arduino-like processor if necessary.
That's awesome! I might build exactly that then modify in future exactly like your suggestion. That would speed things up drastically. Thanks for the link.
@MrMark Sensor data will be mostly add-on sensors probably all add on sensors. Real time requirements are only stringent for the servo motors. They need to act as quickly as possible.
That means that the code that you write must be non-blocking code so that the code can be responsive. Non-blocking code cannot use functions like the delay() or while or for loops that take much time to execute. Here are some non-blocking timing tutorials: Blink without delay(). Beginner's guide to millis(). Several things at a time.
Thank you very much for the tutorials. I have just started the basic tutorials as of yesterday. Having the link above will help out and the rest is trial by fire. I will practice these tutorials to understand why. I'm familiar with robot and PLC programming so the fact that python is interpreted really helps.
@2112 servos are going to be active aero, wings in front that rotate based on gyro and braking input.
Use a Garmin smart watch (I use for flying airplanes).
It works also for running, driving bikes...
Nice is: it shows me my travel (flight) path on a map. Do you want to code all this yourself (and using Google maps just to draw path which needs license and a separate topic how to use the API).
I need to be able to control a servo which is why its so complicated. The servo will be controlled via gyro/accel module for active aero. I have zero proof that the active aero will provide a benefit but I still want to accomplish my goal.
I will research Garmin watch but I don't believe it'll be capable of doing what I want. Still a simple and effective solution for most things so I will keep it in mind.
What is "aero"?
When you have to control a servo - OK, good question where to get the sensor data to do so.
For measuring "RPM", you might think also to connect to an ODB plug (a connector in cars/motorcycles to read engine data, errors, often as a CAN bus).
And for location - you would need anyway a GPS module (can be done via UART).
A pretty complex project - but why not? Reasonable.
Good luck and happy coding.