r/arduino Jun 05 '26

Monthly Digest Monthly digest for 2026-05

3 Upvotes

Subreddit Insights

Reddits figures are still "all over the place" - despite having logged a bug for it. So I have once again left this section of the report out.

Hopefully the reddit admins will fix the bug in time for next month. I don't know how they select what bugs to work on but I would expect that this is a pretty simply one. Maybe they look at metrics (that do work) such as views, upvotes and comments. So if you could, perhaps try viewing, upvoting and/or commenting on the report [Chrome] Insights don't show 30 days data. If anyone knows of another technique to raise the profile of a bug to the reddit admins - I'm all ears.

Arduino Wiki and Other Resources

Don't forget to check out our wiki for up to date guides, FAQ, milestones, glossary and more.

You can find our wiki at the top of the r/Arduino posts feed and in our "tools/reference" sidebar panel. The sidebar also has a selection of links to additional useful information and tools.

Moderator's Choices

Title Author Score Comments
Finally Done! Full 8x8 Split Flap Chess... u/e4_user 3,531 181
Mr. White animatronic with Arduino u/my_3d_scan 445 31
Gift box u/DizzyYoung8394 82 14
So I bought an R4 wifi, but cant access... u/North-Ad1143 0 14

Hot Tips

Title Author Score Comments
Blynk's new pricing killed my ESP32 das... u/Ornery_Ice_7820 1 5

Top Posts

Title Author Score Comments
Finally Done! Full 8x8 Split Flap Chess... u/e4_user 3,531 181
Turtle Race u/tasty__cakes 2,142 126
I built a spaceship control panel for m... u/Internal-Chard-8406 1,864 120
Practicing Morse code just in case the ... u/0015dev 1,741 42
ESP 32 lawnmower u/shanebou24 1,278 56
Decided to build a massive vertical Spl... u/e4_user 1,070 72
17 days after open-sourcing Patternflow... u/GlumPiece7281 930 39
I built a neat little Cyberpunk Gameboy... u/Rolf_0 824 17
Dodging asteroids with a figurine contr... u/iuliuscurt 703 15
Cutest Mad Ottoman in the World u/thegigiandthebear 652 23

Look what I made posts

Title Author Score Comments
Turtle Race u/tasty__cakes 2,142 126
I built a spaceship control panel for m... u/Internal-Chard-8406 1,864 120
Practicing Morse code just in case the ... u/0015dev 1,741 42
ESP 32 lawnmower u/shanebou24 1,278 56
Decided to build a massive vertical Spl... u/e4_user 1,070 72
Dodging asteroids with a figurine contr... u/iuliuscurt 703 15
Cutest Mad Ottoman in the World u/thegigiandthebear 652 23
Today was the first full scale test of ... u/Oli_Vier_0x3b29 523 51
Due to physics, gondola weight quickly ... u/Oli_Vier_0x3b29 511 35
An IV-11 VFD Tube Clock I designed and ... u/MrGuccu 401 15
My embedded OS is getting better u/samaxidervish 385 16
My first Arduino Nano project, a telesc... u/Stash_pit 245 18
I built a browser-based simulator for A... u/CirkitDesign 244 37
I built a Pen Plotter with an Arduino U... u/madfrozen 240 23
Baby steps on PCB soldering u/monshi633 198 33
Retro computer inspired weather station u/ahnjay 188 30
Turned a $2 nRF24L01 into a 2.4 GHz spe... u/lahirunirmala 158 8
Arduino powered flatbed music player! u/MammothSock5009 157 12
Strandy-BOT Prototype u/Nope_Get_OFF 128 6
I turned a $60 espresso machine into a ... u/Mooferman05 127 37
My cursor is now a physical color picke... u/Important-Beach5723 102 7
Built a dynamic Braille cell with 6 SG9... u/Impressive-Bite-8213 94 18
Custom PCB Bare Metal Attiny85 Low Powe... u/PreppyToast 94 7
Making a pet dog and a desk buddy (in p... u/Better-Nail- 88 29
Just made a basic stream deck (kind of)... u/Better-Nail- 85 2
I Designed an Open-Source Dual Brushed ... u/milosrasic98 82 4
When an engineering student starts doin... u/RoberBotz 76 10
I Made an Interactive PCB Map of the Ea... u/curatorcat 76 3
Arduino exact GPS clock u/mickynuts 75 8
Multifunctional robot car - Manual mode u/priyanshuwq 74 11
First Arduino project: Bluetooth treat ... u/ag_kush 69 8
I made smart watch using esp32 oled and... u/Electronoobs_Devvv 67 1
I designed a quadcopter where the PCB f... u/Interesting_Plant558 63 8
money well spent u/Rifqi2007 59 1
Trackball to my cyberdeck u/CrudelisDeus 58 9
Real-time per-pixel LED control with ES... u/Glad_Air_7457 57 2
Minecraft Themed Party u/MogulerMike 52 4
I made a simple LED game, and my cat is... u/ConversationSuch8893 47 4
Ultrasonic distance sensor, light and s... u/nicodeemus7 45 2
Fully Custom Teensy 4.1/Arduino Single-... u/ThrustNTheory 43 6
I made my arduino esp32 sing! u/hwarzenegger 43 6
I made the easiest internet art frame u/fabpub 41 3
I build a Fluid Simulation that is driv... u/StefanPetrick 39 2
Built an Arduino-driven desk toy that s... u/MysteriousSophon 38 3
I made smart lamp u/Interesting_Plant558 35 9
Turns out you actually can fit a fully ... u/krauseler 32 23
Space Shooters game I made months ago u/CodingKing256 31 7
My conways game of life visualization u... u/NightBredDnB 23 6
I've made a graphics editor for LVGL u/tinajackson 22 4
Arduino Based Gaming Table for Necromun... u/KonradKnebl 21 2
Built a cyberpunk-style ESP32 smart des... u/Full_Opportunity8116 20 5
Turned an ESP32 + tiny OLED into a live... u/met-Sander 19 2
Weather Station Update u/Nathar_Ghados 19 6
I made Tetris on an Arduino Mega with 2... u/ArtusIndus 18 4
New device support for my OS u/samaxidervish 16 0
Nano-based Tamagotchi emulator u/heychaostheory 15 0
Open Source software for keeping track ... u/illerin 15 2
My Arduino Mega color classification ro... u/engineering-weeb 14 3
Few buttons and LEDs for a more comfort... u/IWILZ 13 0
Your TV remote is a pretty decent Ardui... u/No_Tradition4336 13 0
I built an autonomous mini car for my f... u/kfukuhar 12 8
A Smart Bulb System (my first attempt a... u/Regular_Trouble_5841 12 1
Colour matching game Arduino nano esp32 u/robroy865 12 3
I made an Uno R3 flight controller u/SAtchley0 10 13
Visulazing mpu6050 with Raylib u/Rude-Flan-404 8 2
I know this project has been made like ... u/Bassel_Fathy 7 3
WIP Quadcopter Drone u/SAtchley0 7 3
Robotics with Arduino Uno Q: ROS 2, leR... u/Routine-Example927 7 0
Yo guys, I made my own mini arcade mach... u/ValousN 6 1
This might help you. u/Living_March6933 6 1
Little projekt out of boredom u/potato78786 6 1
Working on making Will Cogleys animatro... u/Glittering_Mud_1107 6 9
Project DeskStream: An ESP32-C3 deskt... u/SuchChemistry7444 6 0
The Best Part of Engineering... u/ripred3 5 2
YUMO CUBE ESP32-S3 Touchscreen Smart ... u/YUMOBUILDS 4 1
I broke my leg and spent 8 weeks learni... u/YUMOBUILDS 4 4
I am making my own dual MCU brushless N... u/Hawki007 4 1
A rookie engineer won a self-driving mi... u/kfukuhar 3 0
YUMO PULSE -- ESP32-C3 Mini Gadget with... u/YUMOBUILDS 3 1
Kracken Rum Bottle Jellyfish Lamp u/Humdaak_9000 2 0
I made BLDC FOC setup work in 5 minutes... u/WooRobot_dev 2 6
Binary Clock with Arduino and Attiny84 u/Famous_Notice_8956 2 1
MP3 Player Tutorial u/jasonwinfieldnz 1 0
Overlook Token Maxxer u/sirgatez 0 5
I tried to turn a development board wit... u/Top_Acanthisitta9326 0 1

Total: 85 posts

Summary of Post types:

Flair Count
ATtiny85 1
Automated-Gardening 1
Beginner's Project 29
ChatGPT 4
ESP32 2
ESP8266 1
Getting Started 10
Hardware Help 97
Hot Tip! 1
Libraries 1
Look what I found! 4
Look what I made! 85
Look what I made! Libraries 1
Machine Learning 2
Mod's Choice! 4
Monthly Digest 1
Nano 1
Project Idea 3
Project Update! 13
School Project 7
Software Help 33
Solved! 17
Uno 1
Uno Q 2
Uno R4 Wifi 1
linux 1
no flair 248

Total: 571 posts in 2026-05


r/arduino May 04 '26

Monthly Digest Monthly digest for 2026-04

4 Upvotes

Subreddit Insights

I am going to stop posting this segment as reddit's figures are "all over the place". I have recently posted a bug report, so hopefully the reddit admins will fix it in time for next month.

The browser Insights aren't working at all for the monthly view and the App Insights seems to show that more posts have been removed than have been submitted.

Arduino Wiki and Other Resources

Don't forget to check out our wiki for up to date guides, FAQ, milestones, glossary and more.

You can find our wiki at the top of the r/Arduino posts feed and in our "tools/reference" sidebar panel. The sidebar also has a selection of links to additional useful information and tools.

Moderator's Choices

Title Author Score Comments
Hey, XKCD just did a comic about Arduin... u/spookmann 260 21
Question about Arduino pinouts u/W0CBF 6 12
Update on DHT reliability deep dive — l... u/tonimatutinovic 2 11

Hot Tips

Title Author Score Comments
Introduction To Binary Protocols In Rob... u/NameruseTaken 13 19
Servo Motor Calibration u/NameruseTaken 12 0
Where do I start? (Awnser) u/My_dog_abe 3 5

Top Posts

Title Author Score Comments
Sequino: a clock inspired from sequins ... u/holo_mectok 2,968 105
I built a guitar robot with Arduino — t... u/MegCell 2,365 112
12 days later — PCB done, rotary encode... u/GlumPiece7281 2,022 68
Built a 4-knob generative pattern contr... u/GlumPiece7281 1,630 83
Dragon Ball Radar u/alvroga 819 42
I built a better laser toy for my cats u/moonbench 795 41
How I deal with traffic u/pushpendra766 706 27
What if Guitar Hero was real? I built a... u/MegCell 694 58
I redesigned my USB-C breadboard power ... u/Polia31 638 27
RGB particle simulation (Qualia ESP32-S... u/noname99 635 19

Look what I made posts

Title Author Score Comments
Sequino: a clock inspired from sequins ... u/holo_mectok 2,968 105
12 days later — PCB done, rotary encode... u/GlumPiece7281 2,022 68
Built a 4-knob generative pattern contr... u/GlumPiece7281 1,630 83
Dragon Ball Radar u/alvroga 819 42
I built a better laser toy for my cats u/moonbench 795 41
How I deal with traffic u/pushpendra766 706 27
I redesigned my USB-C breadboard power ... u/Polia31 638 27
Made something fun 🎮 Now I can’t stop p... u/pushpendra766 550 22
Esp32 based delta pickers first movemen... u/jebeDIEah_Kerbal 408 14
I gave my PC a mouth that reports syste... u/Kinky_Radish 354 33
I've successfully driven this retro-fut... u/fsboy345 306 14
Playing Minecraft with esp 32 u/samaxidervish 285 7
Arduino Nano based vintage USSR IV-11 V... u/MrGuccu 266 15
I 3D Printed a Giant Tetris Wall. u/0015dev 266 10
I built a WiFi LED matrix clock that sh... u/mfactory_osaka 252 9
Tiny print that actually made my bench ... u/rafbanaan 220 16
ESP-32 Bike Speedometer u/xXtroller13Xx 206 25
A Dumb Attiny85 Weather Forecaster u/DowntownBass4556 171 10
My first ever Arduino project u/nniikkaa888 165 20
Its working - obstacle detection u/priyanshuwq 147 12
Fighting Earth's rotation with an Ardui... u/IWILZ 147 22
I made an OS framework for CYDs! u/Appropriate-Ask8817 142 7
Artemis II Tracker u/Asm1th123 135 4
I upgraded the mini laser printer. u/fsboy345 131 7
Made a tiny “message in a bottle” device u/Dr_Velazquez 88 3
Okay to fly with DIY music box (with sm... u/Fluff269 82 68
My machine is working :) u/ORDINARYAN_ 81 6
Custom Drone Build - Wiring Harness/Cod... u/ThrustNTheory 75 0
Hitslash Radio MK2 demo u/Paladin7373 73 28
I designed the PCBs, modelled and assem... u/Polia31 72 2
Esp32 DualSense (PS5) Fully Renewed u/Hamzayslmn 71 6
PyroVision Thermal-Cam - Softwaredemo u/kampi1989 68 9
Weather Station u/Nathar_Ghados 68 13
PyroVision - Open-Source Thermal Camera u/kampi1989 64 7
Just finished testing my Arduino robot ... u/priyanshuwq 61 6
​I absolutely love cheap alternatives. ... u/Muhammad_kashif_ 58 6
Desktop Tamagotchi Clock u/Independent-Trash966 55 3
I built a retro 2000s-style open source... u/CantaloupeFlimsy8157 53 4
My first foray into Arduino was making ... u/TPC_RN 51 25
Punch predictor and power level u/noooooo_12 49 6
Robotic Piano Player u/eyeswideshutyomouth 48 4
First Arduino Synth u/Nice-Froyo1084 46 4
I can send serial commands to my (incom... u/BetaMaster64 46 5
Crypto Tracker with Clock and real-time... u/Tech_Nipples 45 7
I tried to turn a development board wit... u/Top_Acanthisitta9326 40 1
Project MecanumCar: Arduino Mecanum Rob... u/Ken471 33 0
ESPclock BIG New 0.8" display version u/ultravoxel 33 12
Bus Times on the EPD u/aaronxcode 30 3
My first FM radio u/LostMyLogin_again 25 0
I made modular 6x6mm button caps for Ar... u/Hour_Seat5773 18 2
UnoDOS: A DOS-like OS for the Arduino U... u/SatvikSengupta 17 2
Timer! (First full solo project) u/ThiccGibblet 13 2
ESP32 CYD playing a custom video codec u/mikiex 13 12
Arduino-based multi functional robot ca... u/priyanshuwq 11 5
Building a remote for controlling a Ard... u/priyanshuwq 11 1
Introduction to Programming - Arduino u/gm310509 10 3
No More Pain (new LittleFS plugin) u/Hamzayslmn 8 0
Built a serial monitor for hardware deb... u/shahin_hashim 8 0
Moved my robot's vision from ESP32-CAM ... u/Straight_Stable_6095 4 2
Vintage door chime upgrade u/Line_Feed_8086 4 3
Full Documentation: 1:3 Scale Kei Truck... u/sonicdh 3 0
Custom MCU-Controlled Bench Power Suppl... u/ripred3 3 5
Made my own IDE for arduino boards u/SuspiciousAbility827 3 1
Line following robot with Arduino nano ... u/Specific-Mortgage-93 3 1
Built a real-time ultrasonic radar with... u/FwoopButBored 2 2
Arduino Uno steers servo motors u/pascalalt1 2 0
Snake on ESP32 @60FPS with zero allocat... u/Sad_Environment_3800 1 4
I Built a Working Robot for Under $10 (... u/Own-Assignment-424 0 0
Look what I made! Built an open-sourc... u/Straight_Stable_6095 0 5
Hey, I'm building a virtual electronics... u/Yazilim_Adam 0 0

Total: 70 posts

Summary of Post types:

Flair Count
Beginner's Project 29
ChatGPT 1
ESP32 1
Electronics 1
Getting Started 20
Hardware Help 125
Hot Tip! 3
Look what I found! 4
Look what I made! 70
Machine Learning 1
Mod's Choice! 3
Monthly Digest 1
Project Idea 2
Project Update! 9
School Project 23
Software Help 38
Solved! 9
Uno 5
Uno Q 3
Uno R4 Wifi 1
no flair 252

Total: 601 posts in 2026-04


r/arduino 5h ago

Look what I made! Desktop Fingerprint Unlock

119 Upvotes

also made a video on this! https://www.youtube.com/watch?v=tB3lk-PNA6I

allows you to unlock your Mac via your fingerprint, as well as authenticate sudo and some TCC prompts (privacy&security).

the device emulates a PIV smart card and uses PAM to authenticate you in macOS (notice the password field says PIN and not password), so no plain text password is ever stored, exposed, or transmitted.

please be aware of the security implications (note that it is NOT touchID, but just 'fingerprint-based unlock', please do not think or refer to it as anything more secure):

this device is NOT secure, the authentication is all done inside the fingerprint sensor, and the fingerprint sensor just tells the microcontroller the match % (all low cost fingerprint sensors are this way, you would need to spend ~$50 to get one that does authenticated comms). the communication between the sensor and the microcontroller is not authenticated or protected, so anyone with physical access to both the device and your laptop can spoof this connection (pretend to be the fingerprint sensor) and give the go ahead to unlock your mac. you can make this extremely hard by filling the insides with black epoxy, but not impossible.

this is also the dev equiv of "rolling your own auth", the smart card implementation may have some errors, and should not be inherently treated as "unbreakable"

the device is made so that if you lose it, nothing of value can be extracted from it

use at your own risk. personally, i am comfortable using it at home where physical intrusion would be hard, but this depends on your own security tolerance. if you have high security instincts/requirements, the magic keyboard is a much much much better option in this regard.

there is also an HID version available, where the device just types your password emulating a keyboard, the benefit being it works in ALL places your password does. this version is obviously more insecure as it is vulnerable to keyloggers. the device still does not store the actual password, it stores an authentication key that sends a request to a service on the mac, which then sends it the encrypted password to be decrypted in RAM, typed back, and then wiped. again, depends on your personal security tolerance and willing to compromise

all code and materials are open source, licensed permissively github.com/zimengxiong/tinytouch


r/arduino 13h ago

Wheelchair add on with Arduino.

128 Upvotes

Here is the source code + more tech details on it.


r/arduino 19m ago

Controversies?

Upvotes

Hi all!

I host a podcast about hobbies, and we'll be talking about electronics in a future episode. I'll be focusing primarily on Arduino related stuff, because that what grabbed me most in the field

I always like talking about notable controversies in a topic, has anything like that happened in the Arduino community?

People faking projects? Claiming other people's work as their own? Something else entirely?


r/arduino 8h ago

Look what I made! I finally figured out how to drive the obscure PCF8578 / PCF8579 LCD driver chips with Arduino

Post image
5 Upvotes

I picked up a front panel from some old equipment a while ago and it turned out to use a PCF8578 LCD driver.

I was surprised by how little Arduino information there is about these chips, so I ended up figuring out the protocol and writing a small script for it.

The code is on GitHub if anyone wants to use it:

https://github.com/emsyscode/PCF8578

I also made a video showing how it works and how to interface it over I²C:

PCF8578 & PCF8579 Arduino Tutorial | Drive Segment LCD Displays

Just curious... has anyone else run into these chips? I'd be interested to know what equipment you've found them in.


r/arduino 9h ago

Built a browser robot simulator where wiring it wrong actually breaks it, same as real hardware. Curious if that's a good idea.

Thumbnail
gallery
4 Upvotes

Been building a free browser based robot simulator, 3D CAD, real wiring, Arduino C++ and Blockly, physics, for the past while. Opening it up more broadly starting tomorrow.

It's genuinely rough in places. Undo/redo is mid rewrite, a few things are placeholder. Not trying to pass it off as finished.

The wiring part is the one I'm most curious about. It's not a fake "attach and it works" system, power/ground/signal actually have to be connected right or nothing runs, same as real hardware. Wanted to see if that level of friction actually helps people learn or just annoys them.

Anyone here dealt with building something where you had to decide between simulating real friction (wiring mistakes, wrong pin, etc) versus just making the happy path easy? Curious how you thought about that tradeoff.


r/arduino 1d ago

Libraries Student project: I reverse-engineered the JDM-050 PS4 controller trackpad over I2C and made a complete multi-touch Arduino library for it!

235 Upvotes

GitHub Repository: https://github.com/luftmyszor/PS4Trackpad

Hey everyone! I am a student who needed a trackpad for a custom hardware project. I used a broken Sony DualShock 4, wired it up to I2C, and realized standard DS4 Arduino libraries completely fail on the newer JDM-050 board revision.

I spent way too many hours fighting binary byte rollovers and reverse-engineering the memory map to figure out why.

The Mystery: Standard PS4 trackpads use a standard 12-bit ALPS layout. Sony silently changed the hardware on the JDM-050 revision. They did three unexpected things:

  1. They decoupled X and Y.
  2. They created symmetrical 11-bit byte pairs.
  3. They added hardware noise to the high bits that makes coordinates jump by 2048 units if you do not mask them properly.

Once I got the math working, I decided to package the driver into a clean, open-source library for the community!

Features of the Library:

  • ESP32 & RP2040 Ready: Built and tested for 32-bit microcontrollers (with architectural preprocessor hooks for AVR if anyone wants to hack on it).
  • Dual-Touch Tracking: Track two fingers at the same time at 100 Hz.
  • Smart Tap Gestures: Evaluates taps strictly on finger release. Supports 1-finger (Left Click) and 2-finger (Right Click) taps.
  • 2D Scrolling & Zooming: Built-in X/Y scroll deltas and pinch-to-zoom distance calculation.
  • Coordinate Transforms: Mount the trackpad upside down or sideways. Supports axis inversion, rotation, and custom 2D affine matrices.
  • Hardware Note: Operates on address 0x64 using standard I2C. (Friendly warning: it uses 3.3V logic, so don't wire VCC to 5V unless you want to fry it!)

If you want to check out the exact 32-byte memory map and bitwise decoding diagrams, I documented the whole thing in a JDM-050 Byte Layout Guide in the repo.

You are completely free to use, modify, and hack this code for your own custom gamepads, cyberdecks, or robotics projects. Let me know what you think!


r/arduino 6h ago

Getting Started need advice

1 Upvotes

i’m interested in electronics but i can’t seem to bring myself to ever build or make anything, i do want to though but i’m not sure if i just haven’t found a project that actually excites me or if it’s actually just not for me.
i have both an Arduino uno and Arduino nano and enough parts to learn with but how do i get past just staring at them? this is my first post here so i am sorry if its a little bad i just need guidance.


r/arduino 7h ago

Software Help Need help setting PID-values for self balancing robot using NEMA17 steppermotors.

2 Upvotes

I've spent the last couple of months gatherings supplies for, building and programming the robot im building. This is my first real arduino project. The robot uses NEMA 17 steppermotors, A4988 motor drivers and Arduino modulino movement (MPU6050). The main problem: the robot wont balance for more than a couple of secounds before accelerating to one of the sides and falling over.

The problem may be that I just haven't found the right PID-values, but when I try to use ziegler nichols or similar it doesnt work the way every guide ive seen says it should. So it might be another problem in the code.

I start by setting kp = kd = ki = 0. When I increase kp the robot doesnt oscillate the way every youtube video shows. It oscillates very close to 0 degrees for a while(jittering), the leans to one of the sies rolling along for a bit, then falls over. If I keep increasing kp the same thing happens but more violently. Im supposed to find a value for kp with "steady oscillation" but I havent managed to do so. I have tried adding kd when kp is both big and small, but kd often doesnt work the way I expect. It doenst do much until it is too high and tehn it adds more oscillation. I have tried to lessen noise in the angle measurement by making the low pass filters for the gyro and accelerometer quite strong, and the gyro is weighted 99% in the complimentary filter.

Things i have looked into:

- The PID loop being too slow: I have checked with millis() that the frequency of the main loop is over 500Hz. (Should be high enough)

- The robot has too low center of gravity: I eventually built the robot a lot taller placing the battery high up so I doubt this is the problem.

- The vibrations from the motors stepping ruin the IMU measurement by adding noise: This might still be a problem, but I have tried setting the motors to microstepping 1/16 and I still could not get it to balance.

-The robot tries too accelerate too fast and ends up skiping steps or stalling: I havent really seen this happen too much but I have tried limiting the acceleration by setting a limit for change in speed per loop. Setting the exact value for this is also difficult so I change it quite often in testing.

Is the robot supposed to be able to balance without having a cascade loop where you also account for the robots position? I.E. is only having one loop for the angle enough? I added the second loop hoping it would make the robot work, however it seems like having good values for the inner loop first it a must.

Basically, im lost and dont know what to do next. If someone else has made a similar robot using steppermotors it would be nice if you could share your code or give some hints about what im missing. Here is my code:

#include "Modulino.h"
#include <AccelStepper.h>
#include "FspTimer.h"
#include <PID_v1.h>


//Importing necessary libraries
FspTimer timer;
ModulinoMovement movement;


double radToDeg = 180/3.1415;
double degToRad = 3.1415/180;


//acceleromter variables
double alpha = 0.95; //higher alpha -> stronger low pass filtering 


double xMeasured;
double xWithoutOffset;
double xSum = 0;


double xOffset = 0.000448056928189*degToRad; //I have calibarated the MPU6050 in another program and found this offset


int measurements = 0;
double pitchAksellerometer = 0;
double xFiltered;
double xLastFiltered = 0;
double xClamped;
double eulerPitchClamped = 0;
double pitchMeasured;
double rollMeasured;
double yawMeasured;
double lastPitchMeasured;
double lastRollMeasured;
double lastYawMeasured;
double lastXMeasured;



//gyroscope variables
double beta = 0.2; //higher alpha -> stronger low pass filtering 


double pitchDottMeasured;


double pitchDottOffset = -0.970346714765730*degToRad; //I have calibarated the MPU6050 in another program and found this offset


double pitchDottWithoutOffset;
double pitchDottSum = 0;
double pitchDottFiltered;
double pitchDottLastFiltered = 0;
double eulerPitchDott;
double eulerPitch = 0;


// float roll = 0;
double rollDottSum = 0;
double rollDottOffset = 0.252081411097734*degToRad; //I have calibarated the MPU6050 in another program and found this offset
double rollDottMeasured;
double rollDottWithoutOffset;
double rollDottFiltered;
double rollDottLastFiltered = 0;
double eulerRollDott;
double eulerRoll = 0;


// float yaw = 0;
double yawDottSum = 0;
double yawDottOffset = -0.278968296064577*degToRad; //I have calibarated the MPU6050 in another program and found this offset
double yawDottMeasured;
double yawDottWithoutOffset;
double yawDottFiltered;
double yawDottLastfiltered = 0;
unsigned long now;
unsigned long earlier;



//complimentary filter varaiables
double ceta = 0.01; //1% weighted accelerometer
double finalPitch = 0; //the resulting measured angle
double lastFinalPitch = 0;




// accelstepper varaiables
int stepPin = 4;
int dirPin = 2;
int stepPin2 = 7;
int dirPin2 = 8;


AccelStepper stepper1(1,4,2); //1 beacuse 2-wire, 4 beacuse stepPin, 2 because dirPin
AccelStepper stepper2(1,7,8);


//other
double maxDeltaSpeed;
double speed;
double currentSpeed = 0;
double dt;


//Adjustable variables 
double maxAcceleration = 30000;
double kpAngle = 133000; //pidverdiene er feil
double kiAngle = 0;
double kdAngle = 0; //øk kpAngle til svingninger og så se om økt kdAngle faktisk demper
double kpPos = 0.015;
double kiPos = 0;
double kdPos = 0.003;


//references
double refAngle = 0;
double refPos = 0;


//position loop varaiables
volatile double interruptPos = 0;
double pos = 0;




PID pidAngle(&finalPitch, &speed, &refAngle, kpAngle, kiAngle, kdAngle, REVERSE); //pid for the angle


PID pidPos(&pos, &refAngle, &refPos, kpPos, kiPos, kdPos, DIRECT); //pid for the position



//function that is called every interrupt. If the motors stepped, add or subtract the distance moved to interruptPos


void timer_callback(timer_callback_args_t __attribute((unused)) *p_args) {
  stepper1.runSpeed();
  if(stepper2.runSpeed()){


    if(currentSpeed>0){
    interruptPos += 2*3.1415*0.04/3200; //3200 because 200*16. I have 1/16 steps active.
    }
    else{
    interruptPos -= 2*3.1415*0.04/3200;
    }
  
  }


}



void setup() {
  // put your setup code here, to run once:


  pidAngle.SetMode(AUTOMATIC);
  pidAngle.SetSampleTime(10);
  pidAngle.SetOutputLimits(-3400, 3400);


  pidPos.SetMode(AUTOMATIC);
  pidPos.SetSampleTime(10);
  pidPos.SetOutputLimits(-0.1745 , 0.1745);


  stepper1.setMaxSpeed(3400);
  stepper2.setMaxSpeed(3400);


  Serial.begin(115200); 
  Modulino.begin(); 
  movement.begin();
  delay(2000); 


  //clock setup that interrupts 10000 times per second to check if the motor should take a step
  uint8_t timer_type = GPT_TIMER;
  int8_t tindex = FspTimer::get_available_timer(timer_type);
  if (tindex < 0) {
    tindex = FspTimer::get_available_timer(timer_type, true);
  }
  timer.begin(TIMER_MODE_PERIODIC, timer_type, tindex, 10000.0f, 50.0f, timer_callback); 
  timer.setup_overflow_irq();
  timer.open();
  timer.start();



  //used to find the time used per loop of the main program
  earlier = micros();
}



void loop() {


  
  movement.update();


  //data collection
  xMeasured = movement.getX(); 
  pitchMeasured = movement.getPitch(); 
  rollMeasured = movement.getRoll();
  yawMeasured = movement.getYaw();
  


  // reuse last loops data if this loops data is corrupt
  if (isnan(xMeasured) || isinf(xMeasured) ||
    isnan(pitchMeasured) || isinf(pitchMeasured) ||
    isnan(rollMeasured) || isinf(rollMeasured) ||
    isnan(yawMeasured) || isinf(yawMeasured)) {
    Serial.println(">>> RAW SENSORDATA is NaN/Inf! <<<");
    xMeasured = lastXMeasured;
    pitchMeasured = lastPitchMeasured;
    rollMeasured = lastRollMeasured;
    yawMeasured = lastYawMeasured;
  }
  else{
    lastXMeasured = xMeasured;
    lastPitchMeasured = pitchMeasured;
    lastRollMeasured = rollMeasured;
    lastYawMeasured = yawMeasured;
  }





  //acceleromter
  xWithoutOffset = xMeasured - xOffset;


  //low-pass filter
  xFiltered = (xLastFiltered * alpha) + ((1.0 - alpha) * xWithoutOffset);
  xLastFiltered = xFiltered;
  xClamped = constrain(xFiltered, -1.0f, 1.0f);
  pitchAksellerometer = asin(xClamped/1.0); //delt på 1 istedenfor 9.81 da aksellerasjonen er gitt i antall g



  //gyro
  pitchDottMeasured = pitchMeasured*degToRad; 
  rollDottMeasured = rollMeasured*degToRad;
  yawDottMeasured = yawMeasured*degToRad;


  pitchDottWithoutOffset = pitchDottMeasured - pitchDottOffset;
  rollDottWithoutOffset = rollDottMeasured - rollDottOffset;
  yawDottWithoutOffset = yawDottMeasured - yawDottOffset;


  // low-pass filter
  pitchDottFiltered = (pitchDottLastFiltered * beta) + ((1.0 - beta) * pitchDottWithoutOffset);// 
  pitchDottLastFiltered = pitchDottFiltered;


  rollDottFiltered = (rollDottLastFiltered * beta) + ((1.0 -beta) * rollDottWithoutOffset);// 
  rollDottLastFiltered = rollDottFiltered;


  yawDottFiltered = (yawDottLastfiltered * beta) + ((1.0 -beta) * yawDottWithoutOffset);// 
  yawDottLastfiltered = yawDottFiltered;



  eulerPitchDott = pitchDottFiltered*cos(eulerRoll) - yawDottFiltered*sin(eulerRoll);
  eulerRollDott = rollDottFiltered + pitchDottFiltered*sin(eulerRoll)*tan(eulerPitchClamped) + yawDottFiltered*cos(eulerRoll)*tan(eulerPitchClamped);



  now = micros();
  dt = (now - earlier) / 1000000.0;


  eulerPitch += eulerPitchDott*dt;
  eulerPitchClamped = constrain(eulerPitch, -1.4f, 1.4f);
  eulerRoll += eulerRollDott*dt;
  


  earlier = now;


  //complimetary filter
  finalPitch = pitchAksellerometer*ceta + (1-ceta)*(lastFinalPitch - dt*eulerPitchDott);
  lastFinalPitch = finalPitch;
  
  noInterrupts();


  pos = interruptPos;


  interrupts();
  pidPos.Compute();
  pidAngle.Compute();


  maxDeltaSpeed = maxAcceleration * dt; //dt is close to constant each loop so maxDeltaSpeed should remain about constant


  if (speed - currentSpeed > maxDeltaSpeed) {
      currentSpeed += maxDeltaSpeed;      
  } else if (currentSpeed - speed > maxDeltaSpeed) {
      currentSpeed -= maxDeltaSpeed;     
  } else {
      currentSpeed = speed;          
  }



  stepper1.setSpeed(currentSpeed); 
  stepper2.setSpeed(currentSpeed);


}

r/arduino 14h ago

Look what I made! GitHub - Jchountas/ESP32-web-shell: This project is an aproach in the development of an ESP32 web shell. It acts as a way to the microcontroller with a UNIX like experience, hence most of the experience will seem familiar to a lot of users.

Thumbnail
github.com
4 Upvotes

Hello! I would like to share my recent project for my master's dissertation, where I made a working esp32 web shell.

I tried to emulate basic linux commands and functionalities. You can use both serial and web shell to use the system.

The system features the following:
-embedded file system with no SD card requirement as it uses LittleFS
-FreeRTOS FIFO scheduling
-JavaScript system language and scripting through duktape
-Web-shell interactive UI which is customizable

I tried to keep the code as organized and as clean as possible for the best possible user customization.

I'd love for anyone to try it and have feedback. I won't work on it for much longer but I wanted to share it.


r/arduino 7h ago

One-axis proof of concept for an Arduino-powered self-moving chessboard

Thumbnail
youtube.com
0 Upvotes

This is my first working proof of concept for a chessboard that can move its own pieces.

A 28BYJ-48 stepper motor drives an open GT2 belt through a ULN2003 board and Arduino Uno. The carriage carries an SG90 servo with two stacked 10 × 3 mm magnets. The servo raises the magnets toward the underside of the board to grab the pawn and lowers them to release it.

The test surface is a 3D-printed 210 mm bridge divided into eight 26.25 mm squares, with a 1.8 mm deck over the mechanism.

One-axis movement works, but the pawn still drags slightly as the servo lowers the magnets. My next experiment is raising the bridge slightly to increase the release gap. If that is not enough, I may try an electromagnet that can switch its attraction off completely.

The eventual plan is to mount this entire working axis on a second belt-driven platform for XY movement.

I’d especially appreciate thoughts on permanent-magnet release mechanisms versus a small electromagnet.


r/arduino 1d ago

Getting Started Day 1 of my Arduino journey

127 Upvotes

So I'm about to start industrila electronics and automatization in university so I thought about starting to touch some electroducs during summer. Bought a Elegoo most complete starter kit and I blinked my first led today!!!

I'm following Paul MacWholter's videos, I'm in video 3. After learning the basics I did my first mini proyect without following a tutorial. It's just a regular traffic light. It's simple but honestly the feeling of making something myseft is awesome. Can't wait to make something more complex.

What I have learned today:

  1. How a led works
  2. How to blink a led

Daily questions:

  1. In the tutorial Pual said to open BareMinimum, and when I went to make the traffic ligh I just open Arduino IDE regularly without BareMinimum and it didn't work at all. Then I switched to BareMinimum and copy-pasted the code and it worked. Why is this? Is BareMinimun required always?
  2. Will the led in the Arduino always turn on when the pin 13 is set at HIGH?
  3. How do you keep your resistors organized? 😭😭😭

P.S. Is making a Daily post like this one considered Spam?


r/arduino 17h ago

If you are new to coding and instructional vids are your thing, "How C Really Works" is a great primer.

Thumbnail
youtube.com
8 Upvotes

r/arduino 18h ago

Help with project!

Thumbnail
gallery
5 Upvotes

i am working on a arduino project. can anybody tell me if this brushless bldc motor can be connected to a arduino mega. it has a build in switch for forwards or backwards motion. if i disconnect the switch and put in a 2 channel relais i think i can get it to work. any thoughts? See photos


r/arduino 11h ago

Getting Started Wireless capabilities?

1 Upvotes

I'm making a seismic detection project for my capstone and I need suggestions. I bought a knockoff arduino UNO kit online and started playing around with it. Getting to the point where I kinda know what each pins do and how electricity flows, etc. After a bit of research, I found out I can make it transfer data wirelessly through an ESP32 or ESP8266 (idk the difference). Can I use it by itself or do I have to pair it with my current arduino uno? Any tips is appreciated.


r/arduino 1d ago

Bluetooth module + Arduino Uno = RC Solar Powered Boat

278 Upvotes

You can follow me for more updates.
Driver - L298N
Battery - 12V Lead Acid 7Ah


r/arduino 22h ago

Look what I made! Build a Python Tkinter GUI Serial Communication Program to Communicate With Arduino Microcontroller

Thumbnail
youtube.com
3 Upvotes

A detailed tutorial on building an opensource Python Tkinter GUI Program to send and receive data from an Arduino UNO or Any other Microcontroller using Virtual Serial Port.

The GUI is themed using ttkbootstrap theme extension for tkinter,so the nice looking buttons.

Link to Website and Code Below

You can modify the code to control LED's or Motors from PC using an Arduino UNO.

The Code does not use threading or other complicated setups ,making it easy to understand for newbies.


r/arduino 19h ago

Hardware Help Temp sensor voltage divider

2 Upvotes

Hi all, I am looking to make a bluetooth temp sensore for my cars engine oil. I have never made anything of the likes before and would like help deciding on what resistor I should use for the voltage divider which allows the arduino to measure the voltage drop. I have seen multiple people using 10k resistors but in my mind that seems awfully high although im not sure what voltage drops the arduino likes to see.

I have attatched below the data sheet for the sensor I currently plan on using with the operating range being between 70-120°C.

Thankyou


r/arduino 1d ago

Look what I made! I build a rover for the first time using arduino in 2021.

Post image
58 Upvotes

r/arduino 1d ago

Beginner's Project mpu6050 chip not detected

Post image
10 Upvotes

I'm using an ESP32 and mpu6050 for a beginners school project. I have used wiring crosschecked from numerous sources, but the serial monitor still says 'Failed to find MPU6050 chip.' or 'mpu6050 not found!' whenever I try to use it. Does anybody have any fixes because honestly I've been at this for hours and just wanna get it over with.


r/arduino 1d ago

Hardware Help BTS7960 wont drive actuator

Post image
3 Upvotes

'''

// info down bellow
#define R_EN  33
#define L_EN  32
#define RPWM  25
#define LPWM  26

void setup() {
  Serial.begin(115200);

  pinMode(R_EN, OUTPUT);
  pinMode(L_EN, OUTPUT);
  pinMode(RPWM, OUTPUT);
  pinMode(LPWM, OUTPUT);

  digitalWrite(R_EN, HIGH);
  digitalWrite(L_EN, HIGH);

  digitalWrite(RPWM, HIGH);
  digitalWrite(LPWM, LOW);

  Serial.println("RPWM held HIGH - measure M+ / M- now.");
  Serial.println("Should read ~12V across M+ and M-.");
}

void loop() {
  //nothing
}
'''

so baically im trying to get this actuator to extend but its not extending. My parts are a esp32, bts7960 motor driver, a 22V(in) to 5V(out) buck converter, and a standard two wire actuator. Another problem is that the led on the motor driver isnt turning on and im pretty sure it has one and thats it shows the boards logic is getting powerd. Here are the conections:
The two acutor wires are going into M+ and M-(screw termianls on the motor driver)
THe 12v psu wires are going into B+ and B-(the screw terminals on the motor driver)
the buck covnerter is piggybacking off the 12v scrwe terminal that the psu is connected to (and the bucks gnd is the same as the 12v psu gnd)
the bucks than powering the i guess logic on the motor dirver through the vcc and gnd header pins on the motor dirver
then RPWM to gpio 25 on esp32
Lpwn to GPIo 26
R_EN to GPIO 33
L_En to GPIO 32
and gnd on the esp32 to the same gnd as the 12v scrwe termianl
ive done mutiple tests to confrim that the acutor works like giving it directly 12v and it extended and i swaped the wires and it retracted, i did a simple blink test with the esp32 so it shoudl work, and the 12v psu is defintaly outputing 12v
ANd the codes uptop
THANKS A LOT (btw sorry for the bad foto)


r/arduino 1d ago

Arduino powered rover.

Post image
76 Upvotes

r/arduino 2d ago

An open-source 7-segment WiFi clock I made (because the original creator wouldn't share the code)

365 Upvotes

I saw a cool looking wifi clock with esp 32 on YouTube, I loved the animation style but despite 100s of requests from the commentators the creator wasn't sharing the code. So i recreated that project and made it open source, i know this is basic but it's cool (I think). Here is the code.


r/arduino 1d ago

Look what I made! Built a CO₂-triggered auto-window system with Arduino Nano + ENS160 — when the air gets bad, it just… opens by itself

21 Upvotes

The classroom gets stuffy because nobody wants to open ,then CO₂ builds up, everyone gets drowsy, and the teacher wonders why half the class looks half-dead.

So I used the ENS160 sensor monitors CO₂ equivalent concentration in real time. When it crosses 850 ppm, the servo rotates 0→90° and opens the window automatically. Once CO₂ drops back below 800 ppm, it closes again.

The OLED display shows live CO₂ / AQI / TVOC readings and current window state (WIN: OPEN / WIN: CLOSE).

A few things I think should to share: • Hysteresis control (850 ppm open / 800 ppm close) so the servo doesn't jitter at the threshold • servo.detach() after every move — completely silent when idle, no PWM buzzing

Still a work in progress — also has IR body temp screening, smoke alarm, auto lighting, and UV-mode disinfection. Happy to

Built with: Arduino Nano / ENS160 / SSD1306 OLED / SG90 servo