Best specific Microcontroller for a serial production

Thread Starter

d4d0m3n

Joined Sep 24, 2023
30
I already went through some articles, but they are either old or too general, to give me the answer I am looking for. I need to ask for your help guys.

I am a beginner in programming, however I decided to throw myself into it and learn it from scratch.

Goal is to develop something like a Nintendo Wii motion controller (or PlayStation Move controller, Razer Hydra, or similar). So I need a microcontroller which will:

  • be able to read gyroscope and accelerometer
  • with input from gyro. and accelerom. drive a vibrator (motor through mosfet)
  • have 3 buttons for functions like calibration
  • preferably have bluetooth or wifi support (which I don't need now, but who knows about the future)
  • be powered with up to 5V max
  • simulate logic like a android app, something that reads gyroscope and accelerometer - like g force meter, and give a response on a certain values ( g force meter: https://apkcombo.com/g-force/net.drize.g_force )

Microcontroller would be intended for serial production. In the beginning the gadget will be standalone, isolated for communication with other devices. So it won't even have any wifi or bluetooth or any other external connection.

For the reference, how nintendo Wii looks inside:

What are your recommendations:

  • Where to start learning?
  • What microcontroller to choose?
 

nsaspook

Joined Aug 27, 2009
12,796
You do realize this is sort of an advanced project idea. You've got a long way to go before making something like that from scratch as a beginner in programming (unless you just copy the hardware and software from somebody else) if scratch means designing and creating the hardware and software.
https://forum.allaboutcircuits.com/threads/pic32mk-mc-qei-example.150351/post-1560795
https://forum.allaboutcircuits.com/...tter-for-this-application.193257/post-1823342

  • Where to start learning? That all depends on your capabilities and resources. Schools, online courses, etc ....
  • What microcontroller to choose? I'd pick something easy to program with lots of user support if I was a beginner.
 

Thread Starter

d4d0m3n

Joined Sep 24, 2023
30
I am an electrical engineer after secondary school education, however I never dived into MCU programming. Later I did some action script (adobe flash) video animation programing during high school education, as a multimedia engineer. So I have some basics in programming and electronic designing. However, I know this step wont be easy and I have a lot to learn.

" (unless you just copy the hardware and software from somebody else) "
I am open to use what is "freeware" and ready to use in this case.

" I'd pick something easy to program with lots of user support if I was a beginner. "
Please give me some guidance.

Thank you for your time. Tomorrow I will go over the forum threads you posted.
 

nsaspook

Joined Aug 27, 2009
12,796
I am an electrical engineer after secondary school education, however I never dived into MCU programming. Later I did some action script (adobe flash) video animation programing during high school education, as a multimedia engineer. So I have some basics in programming and electronic designing. However, I know this step wont be easy and I have a lot to learn.

" (unless you just copy the hardware and software from somebody else) "
I am open to use what is "freeware" and ready to use in this case.

" I'd pick something easy to program with lots of user support if I was a beginner. "
Please give me some guidance.

Thank you for your time. Tomorrow I will go over the forum threads you posted.
There are two paths here for 'best', the training path and the production path. You can safely forget the production (an optimized hardware and software design like mine) path IMO for a long while. For a training path the Arduino is hard to beat if you need to gain experience on how the hardware and software interface to make a usable system.
 

Thread Starter

d4d0m3n

Joined Sep 24, 2023
30
There are two paths here for 'best', the training path and the production path. You can safely forget the production (an optimized hardware and software design like mine) path IMO for a long while. For a training path the Arduino is hard to beat if you need to gain experience on how the hardware and software interface to make a usable system.
I see. Maybe you are right. I'm the kind of person who thinks should do everything by himself. "forget the production path IMO for a long while", I can't (not this time), as it is always delaying things in my life. And I'm just finding out, this is the reason I never succeed. I am always delaying things by investing time in "studying", and when I finish studying it is already too late. Stubborn people like me are wasting life with studying 24/7, while others are partying.
Enough of these personal stuff.

Let's say I make a schematic with rules. It contains a USB-C charging unit, low battery detector, your part (what you just showed me), and the loads. No Bluetooth or anything like it. Would you be willing to help me out?
 

nsaspook

Joined Aug 27, 2009
12,796
I see. Maybe you are right. I'm the kind of person who thinks should do everything by himself. "forget the production path IMO for a long while", I can't (not this time), as it is always delaying things in my life. And I'm just finding out, this is the reason I never succeed. I am always delaying things by investing time in "studying", and when I finish studying it is already too late. Stubborn people like me are wasting life with studying 24/7, while others are partying.
Enough of these personal stuff.

Let's say I make a schematic with rules. It contains a USB-C charging unit, low battery detector, your part (what you just showed me), and the loads. No Bluetooth or anything like it. Would you be willing to help me out?
It can help you with suggestions and give links but I won't build or design anything for you. If you can't take the time to learn the basics, you won't be able to understand what I'm doing.
 

Thread Starter

d4d0m3n

Joined Sep 24, 2023
30
It can help you with suggestions and give links but I won't build or design anything for you. If you can't take the time to learn the basics, you won't be able to understand what I'm doing.
Ok, that's good enough. Thank you for today, it means a lot to me.
 

Thread Starter

d4d0m3n

Joined Sep 24, 2023
30
It can help you with suggestions and give links but I won't build or design anything for you. If you can't take the time to learn the basics, you won't be able to understand what I'm doing.
Good evening Maestro,

I went through some information, and found out it might be good that I plan incorporating upgrades for the future. Especially when already sold on the market, bugs and errors can be annihilated only via upgrades. This means the microcontroller should be flash based, so that the firmware could be upgraded via USB-C or Wifi?

I just did a quick draft of the schematic. To have some orientation. Left side is a charging unit, far right the load. Mystery is in between:

circuitIMUpic.png

I lined out low bat. indicator, as this would probably be better off done by MCU.

Then I drafter out first rules:
1. Goal is to go with the 3.7V source, using a lithium battery with integrated BCS.
2. Charged by USB-C
3. A 3.7V DC motor will be used for a load. Exactly the same as it is in Nintendo Wii
4. The motor is driven like a monostable multivibrator. So it has ONLY ONE function. When a certain value is reached on accelero-gyro, the motor will activate for a second and shut off. It will then wait until it is triggered again.

I gave birth to some question today:

LSM9DS1 as a sensory unit is more than great, however, it's expensive when considering serial production costs. What about 3-axis, something like MPU6050? I believe 3-axis will be sufficient for this case.

Since I also don't need a "perceive" module, nor do I need an integrated graphic display, this simplifies the project quite a lot, don't you think?

All that being said, is PIC32MK0512MCJ064 still the way to go, or do I look for something cheaper? I mean, it has everything I need, but it looks like a beast - meant for more complex operations.

If I decide to go with this MCU, I have to purchase a MICROCHIP DT100113 unit, right? Is there something else? Which programming software is freeware and user friendly enough for a beginner?

Should I also buy an oscilloscope for testing? I already did some tests on the motor with a mercury switch and a ball switch. Just to see how it reacts. But I don't own an oscilloscope, I borrowed it.

Can you please direct me to the basics I need to master first.
 

nsaspook

Joined Aug 27, 2009
12,796
I wouldn't use my IMU demo (not designed with cost or manufacturing considerations) as your reference design as I've never said what controller to use other than something simple with good community support. A 6DOF sensor will work (for sensor fusion) so the MPU6050 is OK but is EOL and obsolete for new designs.
https://invensense.tdk.com/products/motion-tracking/6-axis/mpu-6050/
You can get the MPU6050 pretty cheaply and there is Arduino support for IMU projects. I would start looking in the Arduino world for a prototype build system.
https://www.amazon.com/Stemedu-Accelerometer-Module丨GY-521-Gyroscope-Acceleration丨16/dp/B07PY38BCB

Something a bit more current.
https://www.mouser.com/ProductDetail/TDK-InvenSense/ICM-42670-P?qs=iLbezkQI%2BsgK8sMF5V7fQQ==
https://www.arduino.cc/reference/en/libraries/icm42670p/

https://invensense.tdk.com/products/motion-tracking/6-axis/
 
Last edited:

Thread Starter

d4d0m3n

Joined Sep 24, 2023
30
I wouldn't use my IMU demo (not designed with cost or manufacturing considerations) as your reference design as I've never said what controller to use other than something simple with good community support. A 6DOF sensor will work (for sensor fusion) so the MPU6050 is OK but is EOL and obsolete for new designs.
https://invensense.tdk.com/products/motion-tracking/6-axis/mpu-6050/
You can get the MPU6050 pretty cheaply and there is Arduino support for IMU projects. I would start looking in the Arduino world for a prototype build system.
I love the idea of icm42670p, though not much can be found about it.

There are plenty tutorials on mpu6050: https://howtomechatronics.com/tutor...mpu6050-accelerometer-and-gyroscope-tutorial/

However, using EOL chip would be a waste of time.

Can you rate approx. how much time would it take me to re-program the code from the upper tutorial, to adjust it for ICM42670p?
 

nsaspook

Joined Aug 27, 2009
12,796
Can you rate approx. how much time would it take me to re-program the code from the upper tutorial, to adjust it for ICM42670p?
No idea, I've not looked at the code or datasheets but the Arduino library API should be very similar for both devices. Start with the mpu6050 example to get your feet wet, as IMO ,it will take you a while to build anything usable on your own.
I think you have really no idea of what it will take to build what you want into a usable product.
 

Thread Starter

d4d0m3n

Joined Sep 24, 2023
30
I think you have really no idea of what it will take to build what you want into a usable product.
haha, aren't you supposed to encourage me? I mean, as my mentor you should at least kick my ass

Just joking. Don't worry, I will never forget the people who helped me (unless I caught early dementia). I'm 34 years old and I'm a fast learner. However, my brain is more right hemisphere oriented, which is why I was always a better designer than programmer. So I really don't worry about 3D prototype design as I'm great at it, but programming a microcontroller is another chapter.

Today I went through a session with CHAT GPT, who told me it can reprogram code for me (mpu6050 to ICM42670p), and here is the proof:
2023-10-30 173832.png


I then introduced some rules and project requirements, which brought the following answer:

2023-10-30 183520.png

Now I will ask for your help to decide what to choose. My take is Espressif ESP32, but what would I know.

I would like to order it tomorrow.
 

nsaspook

Joined Aug 27, 2009
12,796
I just want to bring you back to earth on what can be done in the short term.
Asking CHATGPT to design this means trouble in the future IMO, good luck.
 
Last edited:
Top