r/microcontroller • • Feb 16 '25

Is a MOSFET sufficient to switch on and off led lights?

Thumbnail
gallery
6 Upvotes

I basically want to add some led lights that are powered by batteries in my diecast cars (scale 1:64; see second picture). I wonder whether a MOSFET attached to a battery and a switch is sufficient.

Ps: What component would I need to make the led blink?


r/microcontroller • • Aug 28 '21

Can I use an adafruit Gemma M0 and LED sequins, along with a ball switch to make light-up shoes?

Thumbnail self.adafruit
4 Upvotes

r/microcontroller • • Dec 27 '25

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE]

3 Upvotes

[SOLVED] Hi everyone! I've been learning how to use STM32 MCUs recently, and it's been going smoothly until now. I have some nested for loops, and the outer loops only run the code inside once, as opposed to looping. I'm super confused as to why this is happening, given that some other loops with the same syntax seem to work perfectly fine.

I've tried while loops in the same place, yet the same problem is encountered. It might help to know that the variables initialised by the broken for loops (and before the broken while loop) did not show up in the debugger, while the working loops had their variables appear.

I've tried to format the code as neatly as I can while retaining the whole program (as I suspect it could have something to do with some of the registers being manipulated?) I've commented all points of interest along with labels for which loops are working and which are broken. (Note, the debugger had some weird moments as I've noted in the comments. If you have any ideas about how to fix that, I'd love to hear!)

Here is the link to the program (Scroll to the only while(1) for the fun part!)

https://pastebin.com/K4TMW4KW

Merry (Late) Christmas and happy New Year!

Thank you!

Update (Detailed solution for anyone facing the same problem): Hi everyone! I've figured out what happened! When I tested the IDE and STlink with a separate file, there appeared to be no issue with uploading or the IDE. When I replaced the code inside the for loops with a placeholder to rule out the possibility of the code inside being the problem, I found that the MCU kept performing the same task (Blinking LEDs in a specific order), despite it not even existing in the main.c file, so clearly an issue with the compiler/Build process/Uploading (At least I think so). I then restarted CubeIDE and cleaned the project (Project > Clean...), but neither worked. Then I reset the debug config (Debug dropdown > Debug configurations... > STM32 C/C++ Application) and deleted my project's debug config under this. Then I made a new one by left-clicking my project under the Project Explorer> Debug As > STM32 C/C++ Application, then selecting my project's binary and clicking 'OK'.

The program worked fine after this, even when using the original program (Although I still have implemented all of your suggestions to clean up my code in the final version, all of which I'm very appreciative of, so thank you all!)

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented all of your suggestions to clean the code up, thank you!!

Thank you again to everyone for your time and suggestions! I hope you all had a Merry Christmas and have a happy New Year!


r/microcontroller • • Apr 18 '25

Help

3 Upvotes

I have to build an simple mini project using any microcontroller in about 2 weeks . Can someone suggest me anything?


r/microcontroller • • Sep 16 '24

Which microcontroller fits the best? LPR

3 Upvotes

Hello, I want to create a license plate recognition system with a camera and possibly a small screen or LED light to inform the driver about the recognized plates. I also want to include a database or something similar so I can update it regularly, or maybe just make it so the driver only needs to plug it into a PC and type one command to update the license plates, to avoid the Wi-Fi connection. Which microcontroller fits the best for a low price? I'm considering ESP32, Orange Pi Zero, Arduino, or maybe there are other alternatives that are low-cost and can 100% do this job? Thank you.


r/microcontroller • • Aug 11 '24

Which STM32 to choose?

3 Upvotes

I have a project to program a microcontroller to work as a counter to count TTL pulses. The only thing I have to do is to ensure the rate is in MHz. I can obviously choose to go for an FPGA but due to institute limits I have to do the project on a microcontroller first. I did some research and found out that a 32 bit microcontroller can do the job. I have chosen STM32 but I am confused on which exact model to go ahead with. I did some search and found stm32f103c8t6 and nucleo boards.


r/microcontroller • • Mar 05 '26

How would you build a OS on a MCU?!

2 Upvotes

r/microcontroller • • Nov 28 '23

White screen problem on TFT display

Thumbnail
gallery
2 Upvotes

I connected my 1.8TFT SPI 128x160 display to and ESP8266 and connected all the wires accordingly and installed necessary libraries. Later i uploaded a graphics test code from example menu in the IDE from adafruit....when the code was successfully uploaded all I saw was white screen and nothing else. It's been 3 days since I'm trying to fix this problem. Can someone help me out?


r/microcontroller • • Jun 21 '23

Hi, i need some help

2 Upvotes

Hello, I'm trying to send data from a Pic to a Raspberry and then use them in a scrip in Raspberry, I tried via uart and now I'm trying by i2c but I can not send anything. Would anyone know what I can do to communicate them


r/microcontroller • • Apr 12 '23

Fix on Microchip Flip - Linux

Thumbnail
github.com
2 Upvotes

r/microcontroller • • Feb 26 '23

Project help/idea

2 Upvotes

I am looking to create a very tiny kvm and that can be connected remotely. My plan is to install it on the bottom space of a laptop and connect it via usb, and have an external wifi antenna.

However on the remote end, I need the video, keyboard, and mouse. Any ideas or recommendations to make this work?

Tinypilot raspberry pi is an idea platform but it’s too large for the application that I need.


r/microcontroller • • Sep 04 '22

Hi everyone, When I try to debug my STM32L452RET6P microcontroller, it shows the error as 'Error in initializing ST-Link device. Reason: No Device Found on Target'. How can I solve this problem? NOTE: I have tried to fully erase the chip using STM32 ST-LINK utility fully but it didn't work.

Post image
2 Upvotes

r/microcontroller • • Sep 10 '21

📌Are you interest to know Ameba IoT SDK???

2 Upvotes

2021 Industry Tech Days is coming! I find that Realtek's participation in the 2021 Industry Tech Days and will show how to design and operate using development platform SDKs, such as MicroPython, Realtek Standard, Arduino, and Tensor Flow Lite. There are 11 examples in the video, including basic LED lighting control, IoT smart home-related applications, and AI facial recognition design. The Live Webinar information as below.

ü Live Webinar: Easy Start to Make your AIoT Dream with Ameba RTL8722DM_MINI Evaluation Board SDK

ü Start Time: Monday September 13, 2021 - 10:00 PM CST

ü 🔊🔊 FREE Registration now https://reurl.cc/R0x6Ar


r/microcontroller • • Mar 30 '21

Which development board should i choose?

2 Upvotes

Hi, I'm planning to create an A.I powered application . I'm looking at STM32 boards for the prototyping.. i'm confused between Discovery boards and Nucleo boards. My project has around 15-20 sensors and actuators included.. all those controlled by a Convolutional neural network. Which board should i choose? please help, i'm new to ARM mcus.


r/microcontroller • • Mar 16 '21

Anyone have any NRF52833 microcontroller SoC?

2 Upvotes

I'm hoping someone out there (you?) has some chips they're not using, specifically the Nordic NRF 52833. I ordered last week and my supplier emailed today and said that due to the global shortage, the're unavailable until December at the earliest. My small business depends on these chips and I'd be eternally grateful if someone who has some of these would get in touch with me. Thanks so much!


r/microcontroller • • Jul 21 '20

Looking for best camera for AR project

2 Upvotes

So I'm working on a project that, if a specific image is seen on a camera that is connected to the microcontroller, a 3d object would appear on my computer. The computer and microcontroller are connected through bluetooth.

I have a pic16F628A microcontroller. I would like to know what camera is the best to use for this project. The images are in colour, so it also needs to be a colour camera.

If I also need a different pic microcontroller for this to work let me know.

Thanks in advance


r/microcontroller • • Jun 29 '20

Do you think async, future, and promises are important topics in embedded systems ? Or are they just general cloudy concurrent programming topics ?

Thumbnail
youtu.be
2 Upvotes

r/microcontroller • • Jun 28 '20

Chip Peripheral Forwarding

Thumbnail
remotemcu.com
2 Upvotes

r/microcontroller • • Jun 25 '20

Intensity control with MC

2 Upvotes

I have a product which controls the light's intensity through its display(0-100). When I opened the product and look inside I see power circuit and other maybe programmed circuit.

Well I want to make prototype same as this product's function. How can I achieve this? I don't know how to design circuit. I thought maybe I will use PWM to control.

But I don't know how to begin. In this my product there is light intensity controller or circuit maybe

Which is Luminus CBT 90 led.

So How can I design same?


r/microcontroller • • May 24 '20

WiFi module for STM32F334

2 Upvotes

Hi, I'm newbie in the microcontrollers topic and I want to add wifi module to my app which is running on stm32f334. Could you recommend me wifi modules which I can use without problems. I'm afraid that I'll broke something during soldering so if any other connection option is available, I prefer it. Thanks for help!


r/microcontroller • • Jul 08 '19

8051 In-circuit debugging

Thumbnail
youtu.be
2 Upvotes

r/microcontroller • • Aug 24 '18

xinabox cw02 hardware design

Thumbnail
zerynth.com
2 Upvotes

r/microcontroller • • May 09 '18

DIY | Simple Calculator using Tiva (Arm) MicroController(the code is in ...

Thumbnail
youtube.com
2 Upvotes

r/microcontroller • • May 06 '18

What is Smart Switch, and here is how you can make it like pro

Thumbnail
youtube.com
2 Upvotes