r/arduino • • 2d ago

Hardware Help Stuck figuring out how to power a WS2811 LED strip

5 Upvotes

I wanted to create some custom programs for a 100 WS2811 LED strip, which is 5V with a max current of ~6A. I understand I need to have a proper supply to prevent overheating but struggling to find a good solution without having to solder.

My understanding is that if I had some 5V 6A power supply plugged into the wall, I need to get that into the LED strip. I have to deal with bare wires to power it I thought about connecting those to a screw terminal adapter on the supply but most I see specify that they limit the current to 5A (not sure if true). Then, however I power the Arduino it needs to share a ground with the power supply for the LEDs. If the Arduino used a different supply, would that just be as simple as connecting the ground through a breadboard? Not sure if those wires are meant for this much current.

Is my understanding correct, and would that screw terminal adapter actually limit anything? Ideally I would have some magical supply that can connect to the bare wires and the Arduino's 5v usb input and ground pin somehow. In practice it is confusing me.


r/arduino • • 2d ago

ESP32 Halo — A Modern, Open-Source Desk Lamp for Your Cozy Moments

Thumbnail
gallery
51 Upvotes

A little light can make a workspace feel more welcoming.

Halo is a compact, rechargeable RGB desk lamp designed to bring ambient lighting and a touch of colour to your everyday spaces.

Built around the Waveshare ESP32-C3 Mini, Halo combines custom Arduino firmware, RGB lighting, rechargeable power and a custom 3D-printed enclosure in one compact design.

Inside the System

Embedded & Lighting

  • Waveshare ESP32-C3 Mini as the central controller
  • Custom Arduino firmware using FastLED
  • Ultra-slim 2.7 mm Waveshare RGB LED strip
  • Automatic ROYGBIV colour cycling with five-second intervals

Power & Electronics

  • Rechargeable 18650 Li-ion battery
  • USB Type-C charging
  • Compact, portable electronics assembly

Mechanical Design

  • Custom enclosure designed in Autodesk Fusion 360
  • Four-part 3D-printed assembly
  • Circular diffuser for soft, uniform illumination

Designed to Be Built

Halo is a fully documented project, with its firmware, CAD models, STL files, circuit diagrams and build instructions available for makers to explore and build themselves.

The idea is simple: make a thoughtfully designed desk lamp that anyone can build, customize and make their own.

Explore Halo

I'd love to hear your feedback, especially on the firmware, LED control and possible improvements.


r/arduino • • 3d ago

Look what I made! "You only build things for our son" - wife

Post image
92 Upvotes

Well here is a robot for my daughter. PINK ROBOT. This is an ESP32 based (running ESP-Home) NFC music robot for my daughter.

Her favorite color is pink.

So far this is my cleanest robot to date.

Couple interesting things about this project

- I made the body print without supports (upside down) So all of the cutouts for the electronics have chamfers and self-support. Certain parts have clamps, or screwed in from the back.

- I really wanted to make my own buttons, so I bought this pile of MX key switches and printed my own cap. I'm most proud of this part tbh. It feels and sounds great

- There is no audio on the robot itself, it's all streamed from ESP-Home. So it's super easy to manage from my phone, add new music to cards etc.

- B/c its HA, I can see data on how much she plays which song

- This was built with spare parts I had lying around. So it's an older ESP32, older amp, dupont wires, breakout boards. You might call it messy, but compared some of the other stuff I've done, I'm happy with it. And there is NO rattle at all when I shake it.

Hardware list

ESP32 DevKit V1 (ESP-WROOM-32, micro-USB, no PSRAM)
ESP32 30-pin screw-terminal adapter board, 63 × 66 mm
RC522 board
MAX98357A I2S amp breakout
Speaker (Amazon B07GJ4GH67, 2-pack)
USB-C Boost (Amazon B09YD5C9QC, 10-pack).
3000 mAh 1S LiPo
Diode
Capacitor
NFC Cards


r/arduino • • 2d ago

An Arduino game exercise that separates input events, movement, and rendering

2 Upvotes

I’m building a small Arduino-based ESP32-S3 handheld. I’ve been turning its test sketches into exercises. One that worked on the wired prototype is Enemy Wave: move a ship and deal with enemies that appear at timed intervals. The photo is from the bench run.

The exercise separates three things beginners can otherwise mix together in loop():

• Input events versus state. Use a pressed event for an action that should happen once, such as flipping a setting. Use held or the analog stick value for movement that continues every update. If you use the held state for a toggle, it can flip every frame.

• Simulation versus rendering. Update positions and collisions first, then draw the entire scene and present the frame. The handheld uses a 320×240 RGB565 sprite in PSRAM, about 150 KiB. That lets the lesson draw into memory without interleaving game rules with panel transfers.

• Spawn interval versus movement speed. First change just the interval and play both versions. Then restore it and change just the movement speed. This gives a beginner two different ways to make the game harder and a reproducible way to trace the result back to one variable. If porting to another board, make the spawn timer use elapsed time rather than frame count so a slower display does not change it.

For anyone teaching Arduino with a game: where do you introduce elapsed-time updates? I’m considering keeping an explicitly fixed update rate in the first exercise and introducing a millis()-based timer in the second so beginners can observe the difference.


r/arduino • • 1d ago

Amateur security system experiment

0 Upvotes

I'm trying to make an experimental security system. It must:

  • Operate continuously on battery power for over 5 years until someone triggers the alarm
  • Power a laser and receiver continuously.
  • Have at least 1k of SRAM that I can store values in.

What device should I use that is basically ready made? I don't want to go through PCB design and all that. Is there some sort of Arduino they already sell that does this, or a SUPER simple chip that you just solder a battery onto and you're good to go?


r/arduino • • 2d ago

Calibrating a PSP thumbstick on ESP32 Arduino: unequal travel, center drift, and a circular dead zone

1 Upvotes

The analog stick in my Arduino-based handheld didn’t return to the same raw ADC count every time. A fixed center of 2048 would have been wrong even before considering the drift.

Bench readings (12-bit ADC counts, rounded): X ≈ 777 / 1585 / 2831 and Y ≈ 829 / 1900 / 3247, listed as minimum / center / maximum. The positive and negative spans differ on both axes. With the stick released, the center can shift by about 100 counts against short-term noise of roughly ±10–20 counts.

The useful normalization is piecewise: subtract the calibrated center, then divide by the measured travel from center to the endpoint on that side. For X that’s 808 counts left and 1,246 right. This makes the full movement on each side reach the same output scale instead of making one direction slower in a game.

On the prototype I average 16 samples, smooth the result, and apply a 15% circular dead zone after normalizing both axes. A circular dead zone tests the vector magnitude rather than suppressing X and Y independently. I only let the estimated center adapt slowly while the stick is in the idle region; otherwise a held input can get reinterpreted as neutral.

An easy exercise is to log the raw counts and normalized coordinates while tracing a circle. Watch the resulting trajectory before and after the piecewise scaling. If the corners still feel asymmetric, the log lets you see whether it is the stick’s physical gate, the calibration, or the dead-zone transform.


r/arduino • • 3d ago

Whats the best way to solder these tiny things

Post image
54 Upvotes

Im trying to solder wires onto it and i swear its impossible


r/arduino • • 2d ago

Look what I made! My first arduino project: Plasma orb + Arduino uno R4

3 Upvotes

Arduino controls the ball by draining it's ground via FET, while mobile companion allows using the ball for notifications, visualize the sound and create and play custom patterns. I call it heresy detector.


r/arduino • • 2d ago

Beginner's Project Joystick programming/parts

4 Upvotes

I have yet to start the project, but I’m trying to get as much information as possible before I spend any money on it. I’m looking to design and code a pair of joysticks to use as controllers for my pc. The issues I’m running into is a reliable cheap Hall effect sensor for the main x/y axis of the joystick. My current idea is to use ps5 or steam deck replacement joysticks but I don’t know how the programming aspect of that works or if it would work at all, I’d just like some insight on if anyone has used and programed standalone controller joysticks.
Edit: to clarify I’m looking to essentially recreate the thrustmaster farmstick, just more budget friendly and customized.


r/arduino • • 2d ago

School Project Arduino Meditation Biofeedback – Which Sensors Should I Use?

2 Upvotes

Hi everyone!

I want to build an acoustic biofeedback system for meditation.

The idea is that the more deeply I meditate, the more consistent the sound becomes. When I lose focus, the sound gets quieter, gently reminding me to return to my meditation.

I was thinking about using a breathing sensor to measure my breathing patterns as an indicator of my meditation state.

Does anyone have experience with this or recommendations for suitable sensors?

Looking forward to your tips!


r/arduino • • 3d ago

Getting Started Best Starter Kit Around 30$?

6 Upvotes

I’m a beginner, I’ve been looking at the Elegoo basic starter kit for the Uno r3. is this good enough or do I need to upgrade to the super starter kit for the best experience? What other suggestions do you have and what would be the best option at this price range?


r/arduino • • 3d ago

Look what I made! I built a sample deck, voice changer and bluetooth receiver with the UNO Q!

33 Upvotes
Sample deck in-situ
Sample Deck Closeup

This is a project I built for a party recently. It uses an Arduino UNO Q, a Media Carrier for Audio output, and a bunch of Modulino modules (buttons, knob, pixels, distance).
The main features are:

  • Plug in a microphone and get live voice FX (echo, reverb, HP/LP Filter, robot, radio, bitcrusher, pitch)
  • 18 sample buttons with 4 tabs, 72 sample slots overall
  • Upload samples and change settings via a web UI hosted on a local wifi hotspot (scan the QR code to connect)
  • Record samples via the microphone
  • Connect to it over bluetooth to play music
  • Apply live FX to bluetooth audio and sample audio
  • Live Theramin FX mode that changes audio pitch based on how far your hand is from the distance sensor!

Full writeup and all the files needed to build it here: https://projecthub.arduino.cc/jbruges/humdrum-a-modular-sampler-and-voice-changer-with-the-arduino-uno-q-dda250


r/arduino • • 4d ago

Look what I made! Micro servo robot arm

98 Upvotes

It's a tiny ~120mm 4dof robot arm powered by 4 mg90's, 1 sg90 and an Arduino Nano ESP32.

I spent all my free time in the past few weeks modelling and remodelling robot arms in freecad, learning as I go. The first few designs didn't look very nice, it was too heavy or I just couldn't get everything to fit in my length/weight constraints. I finally decided to just model the most rudimentary arm I could finish — no wire management, no smooth flowing anesthetics like some of the robot arms I've seen on the internet... Just reach the finish line and make it move.

I quite like it now, and I think I'll keep working on it and see how that goes. It's open source too github (very incomplete)


r/arduino • • 4d ago

Look what I made! I made this Cocktail Machine with Arduino

Thumbnail
youtu.be
29 Upvotes

I hope you like it!


r/arduino • • 3d ago

Software Help Having trouble displaying a bitmap with u8g2 and ST7920

6 Upvotes

I'm using the programs that convert a pixel drawing into the array for the bitmap and using drawXMBP to display it.

It displays but there are always two pixels cut off the side. This is supposed to be 10 pixels wide, but it is 8. But the height is correct. I ave tried changing the canvas size but no difference. Always displays incorrectly:

const unsigned char wifiFull[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8C, 0x40,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

if (signalStrength < -1)
{
  u8g2.setFontMode(1);
  u8g2.setBitmapMode(1);
  u8g2.drawXBMP(0, 0, 128, 64, wifiFull);
}

It's just a small icon in the corner. Instead of being 10 pixels wide, two pixel colums are truncated on the left, no matter where I put the bitmap. I cant work it out. I've done this before with no problem.

Suggestions?


r/arduino • • 4d ago

Hardware Help LED and resistor

Post image
25 Upvotes

Does it look like it's in the right place?
Red LED
Long leg A10
Short leg A15
330Ω resistor B5 to B10
Red wire Arduino D13 to A5
Brown wire B15 to the 12th hole on the negative

Green LED
Long leg E25
Short leg E28
resistor E20 to D25
Green wire Arduino D12 to D20
Black wire D28 to the 10th hole on the negative


r/arduino • • 4d ago

Hardware Help Any idea why my lock isn’t working in this L298N module?

Post image
10 Upvotes

Im sorry in advance, Im way out of my depth here, im just an X-ray student that had to build some type of circuit related to xray physics for a project due this Thursday.

Im having a hard time getting my lock to move. The pushbutton works, the batteries work, and I can feel the spring inside the lock moving when I press the push button. However the lock doesn’t depress on its own without putting pressure on it first. It only needs light pressure, such as lightly holding a finger on top of it while you press the push button. I thought it could be a problem with the lock, so I bought a new one, but it works even worse. So I bought two more locks of different brands, and these don’t even move at all. So then I thought maybe the circuit needs more power? I plugged an additional 9V battery in, but that still didn’t work.

I have 2 9V batteries, a 12V/1A pushbutton, and a 12V/.43A battery attached. I also tried a 12V/.83A battery.
Any help is greatly appreciated. TIA!


r/arduino • • 4d ago

Getting RPM data out of these cheap 12v fan by using it single phase hall effect latch

Thumbnail
gallery
26 Upvotes

This is a pretty simple process if you have mess with them before, do beware that some have sealed hole.

Just connect the 2nd or the 3th pin to the your MCU digital pin, and make sure to use high value resistor like 1M ohm or somthing, my arduino crash if i connect it raw, and your may too, even death is possible.

I wasnt able to find that fan hall effect latch data sheat, but i figure they are the same anyway.

My fan hall effect latch, output high at 180 and 360, so the my code divide it by 2.

Doing some coding and thats it.

I did check it accuratecy using slowmo, they spit out the same number so that good enough.

Mine is in RPS but converting it to RPM is easy.
Serial.println(((fan1_rotation_accumulate / 2.0) / measure_time), 1);  //rps
Serial.println(((fan1_rotation_accumulate / 2.0) / measure_time) * 60.0, 1);//rpm

  //THIS ONE IS THE LATER CODE SNIPPET
  //THE WHOLE CODE IS BELOW
  static uint16_t fan1_rotation_accumulate = 0;
  static unsigned long start;
  static unsigned long end;

  static float measure_time = 5;  // rps every second
  static bool fan1_high_flag = false;
  static bool start_high_flag = false;

  //fixed time acumulation
  // edit: i made i small improvement to this code after posting, by adding an extras if statement,
  // this make the ouputed data very consistant, but it resolution is tide to how long the time window you're measuring

  if (digitalRead(2) == LOW || start_high_flag == true) {  //start as soon as it pass the hall effect and turning low. Not sure why it only output rounded number
    start_high_flag = true;
    if (digitalRead(2) == HIGH) {
      start_high_flag = false;
      start = micros();
      while (1) {

        if (digitalRead(2) == HIGH) {
          if (fan1_high_flag == false) {
            fan1_high_flag = true;
            fan1_rotation_accumulate++;
          }
        } else {
          fan1_high_flag = false;
        }

        end = micros();
        if ((end - start) / 1000000.0 >= measure_time) {
          Serial.print("fan_1:");
          Serial.println((fan1_rotation_accumulate / 2.0) / measure_time, 2);  //rps
          fan1_rotation_accumulate = 0;
          break;
        }
      }
    }
  }

//THE WHOLE CODE

void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT);
  pinMode(3, INPUT);
}



void loop() {
  static uint16_t fan1_rotation_accumulate = 0;
  static uint16_t fan2_rotation_accumulate = 0;
  static unsigned long start;
  static unsigned long end;
  static float measure_time = 1;  // rps every second
  static bool fan1_high_flag = false;
  static bool fan2_high_flag = false;


/*
  //fixed time acumulation
  start = micros();
  while (1) {
    //fan 1
    if (digitalRead(2) == HIGH) {


      if (fan1_high_flag == false) {
        fan1_high_flag = true;
        fan1_rotation_accumulate++;
      }
    } else {
      fan1_high_flag = false;
    }
    //fan 2
    if (digitalRead(3) == HIGH) {


      if (fan2_high_flag == false) {
        fan2_high_flag = true;
        fan2_rotation_accumulate++;
      }
    } else {
      fan2_high_flag = false;
    }


    end = micros();
    if ((end - start) / 1000000.0 >= measure_time) {
      Serial.print("fan_1:");
      Serial.println(((fan1_rotation_accumulate / 2.0) / measure_time), 1);  //rps
                                                                        //  Serial.println(((fan1_rotation_accumulate / 2.0) / measure_time) * 60.0, 1);//rpm
      fan1_rotation_accumulate = 0;
      Serial.print("fan_2:");
      Serial.println(((fan2_rotation_accumulate / 2.0) / measure_time), 1);
      fan2_rotation_accumulate = 0;
      break;
    }
  }


*/
  
  //avg by time
  // fit for stable ouput
  // instead of waiting 60s to see result, you can see the result get more narrowed down with time
  // run longer time frame by changing the time_frame measuring window
  // it wont be good for fast changing rpm


  static uint8_t acum_time = 1;
  static uint8_t time_frame = 60;  //in second


  start = micros();


  while (1) {
    //fan 1
    if (digitalRead(2) == HIGH) {


      if (fan1_high_flag == false) {
        fan1_high_flag = true;
        fan1_rotation_accumulate++;
      }
    } else {
      fan1_high_flag = false;
    }
    //fan 2
    if (digitalRead(3) == HIGH) {


      if (fan2_high_flag == false) {
        fan2_high_flag = true;
        fan2_rotation_accumulate++;
      }
    } else {
      fan2_high_flag = false;
    }


    end = micros();
    if ((end - start) / 1000000.0 >= measure_time) {
      //Serial.println(acum_time);


      Serial.print("fan_1:");
      Serial.println(((fan1_rotation_accumulate / 2.0) / (measure_time * acum_time)), 2);


      Serial.print("fan_2:");
      Serial.println(((fan2_rotation_accumulate / 2.0) / (measure_time * acum_time)), 2);
      acum_time++;
      if (acum_time >= time_frame) {
        fan1_rotation_accumulate = 0;
        fan2_rotation_accumulate = 0;
        acum_time = 1;
      }
      break;
    }
  }
  
}

r/arduino • • 4d ago

Fast FFT class for LGT8F328P Arduino

4 Upvotes

FFT class to take different sizes eg 128, 64, 32, 16, 8 bins.

Speeds: 128: 6.1ms, 64: 2.7ms, 32: 1.12ms.

https://github.com/beaka/uDSU_DSP


r/arduino • • 4d ago

Look what I made! I made a thing for people that lost one of their arms so they can still use a pc.

77 Upvotes

It does't work that well cuz I used very cheap components but still. :))

It can simulate mouse movement and some kind of edge scrolling, when the pointer leaves an imaginary circle it keeps going, then simulate clicks and some keyboard presses.

Overall I should have used an esp instead of arduino or make use of a wifi module with arduino and make use of the wifi instead of using a very cheap radio transmiter.
And I should have used more accelerometer/gyroscopes, the more expensive ones for better precision, and so I can have more ways to detect and calculate input.

The glove has one arduino nano, one radio transmiter, one accelrometer gyrscope, the usb dongle has one arduino micro pro and a radio receiver.


r/arduino • • 4d ago

Beginner holiday build: 30-LED WS2812B Christmas light strip on an Arduino UNO (wiring, power tip, and starter code)

5 Upvotes

Sharing a quick 25-minute breadboard holiday build for anyone looking for a simple weekend project with an Arduino UNO and a strip of addressable LEDs.

Parts used:

  • 1x Arduino UNO Rev3 (or clone)
  • 1x WS2812B addressable LED strip (30 LEDs, 5 V)
  • 1x 470 ohm resistor (in series on the data line)
  • 1x 1000 uF electrolytic capacitor (across the 5 V supply rails)
  • 1x 5 V / 3 A external power supply
  • Breadboard and jumper wires

Wiring:

  1. Connect the 5 V external supply positive and ground to the breadboard power rails, with the 1000 uF capacitor across +5 V and GND (watch the polarity stripe on the negative leg).
  2. Power the WS2812B strip from the external 5 V and GND rails.
  3. Connect Arduino GND to the same breadboard GND rail (common ground is essential so the data signal has a reference).
  4. Connect Arduino pin 6 through the 470 ohm resistor to the strip's DIN (data in) pad, checking the arrows printed on the strip so data flows in the right direction.

The one trap beginners hit: do not power 30 LEDs straight from the Arduino's 5 V pin. At full white each pixel can pull around 60 mA (up to 1.8 A total), which will brown out or overheat the board. Giving the strip its own 5 V supply and tying grounds together keeps everything rock solid.

Starter sketch (using the FastLED library):

#include <FastLED.h>

#define DATA_PIN 6
#define NUM_LEDS 30
CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(80);
}

void loop() {
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i] = (i % 2 == 0) ? CRGB::Red : CRGB::Green;
  }
  FastLED.show();
  delay(600);
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i] = (i % 2 == 0) ? CRGB::Green : CRGB::Red;
  }
  FastLED.show();
  delay(600);
}

If you want a printable wiring diagram and live supplier pricing for the parts list, the full step-by-step guide is here: https://usefootprint.app/projects/ws2812b-neopixel-strip?utm_source=reddit&utm_medium=post&utm_campaign=reddit&utm_content=arduino_neopixel


r/arduino • • 4d ago

Uno Q Can we install N-map in the Arduino UNO Q

4 Upvotes

just trying to set up an home lab for the penetration testing and network security stuff is anyone has and idea to download the external packages from apt like n-map to download in the Arduino-OS


r/arduino • • 4d ago

Beginner's Project Pro micro button box

Post image
8 Upvotes

Hey all, looking for a bit of help and direction. Making a button box for sim racing. Pretty basic and just emulates ignition wipers lights.
- it has 4 toggles and 1 button all led and using vcc on the board for power

- The left most toggle controls the button. Meaning when it is off the button is off. When on ignition turns on. Then pressing the button will start the car.

- the other toggles will be off or on. And just be used to control lights or wipers in the game.

As the game uses key presses I’m unsure if I should be using the keyboard library or joystick library.

Can someone help point me in the right direction on the correct way to go library wise, maybe a basic toggle example


r/arduino • • 5d ago

Safe prototype

33 Upvotes

So ive been working on this for a day now and got a prototype and eventually am going to 3d print a frame and desing a pcb,yall got any other ideas that i should add to it