r/ArduinoHelp • • May 26 '24

i need help with my code and its a bit urgent can someone help me with it? And ill pay u for it

2 Upvotes

r/ArduinoHelp • • Apr 26 '24

I need advice regarding the next project

2 Upvotes

I am new to Arduino and Robotics (One day experience) and i have just made my first project which is blinking an led "https://electronicmindset.netlify.app/how-to-make-an-led-blink-with-arduino-uno"

However, I think it's kind of boring and I want to make another project that is fascinating.

Do uou have any idea .Note: I have ulrasonic sensor , servo and some led's plus 16*2 lcd display .


r/ArduinoHelp • • Apr 22 '24

Help on auto door

Thumbnail
gallery
2 Upvotes

I want the motors to move when the sensor detects something but when the sensor detects something again then it will stop the motors. I’m having trouble with that.


r/ArduinoHelp • • Mar 25 '24

help

2 Upvotes

so im making want to have the tempreture read off my 7 seg display but i just wont work the wireing is corect the sensor works but my display is cyceling between random letters

#include <DHT.h>
#include <SevSeg.h>

#define DHTPIN 9
#define DHTTYPE DHT11

SevSeg sevseg;

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  byte numDigits = 4;
  byte digitPins[] = {1, 12, 11, 10}; 
  byte segmentPins[] = {2, 3, 4, 5, 6, 7, 8, 0}; =
  bool resistorsOnSegments = false;
  byte hardwareConfig = COMMON_ANODE;
  bool updateWithDelays = false;
  bool leadingZeros = false;

  sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments, updateWithDelays, leadingZeros);
  sevseg.setBrightness(10);

  dht.begin();
}

void loop() {
  
  float temperature = dht.readTemperature();

  if (!isnan(temperature)) {
    
    sevseg.setNumber(temperature, 1);
  } else {
   
    sevseg.setChars("Err ");
  }

  
  sevseg.refreshDisplay();

  
  delay(1000); 
}

EDIT
the diagram is for a arduino uno but im using a arduino nano and the exsact same pins exsept pin d13 i moved it to RX0


r/ArduinoHelp • • Jan 18 '24

What board is this? How do I upload to it? Details in Comment.

Post image
2 Upvotes

r/ArduinoHelp • • Dec 22 '23

Please help 🤣🤣

Thumbnail
gallery
2 Upvotes

Hello everyone,

I hope this post finds you well. I'm currently working on an Arduino Uno project using Tinkercad, and I've hit a bit of a roadblock in my coding. I've successfully implemented a 2-way traffic light system with additional features like a car park gate (controlled by a servo motor activated by a button) and a pedestrian crossing (activated by an LDR).

The issue I'm facing is that despite having what seems to be the right code structure, my traffic light sequence works flawlessly, but when I activate the LDR or push the button, the sequence doesn't stop as intended. It just continues without responding to the inputs.

I'm relatively new to coding, and I have a feeling that I might have structured my code incorrectly. I've included everything I believe I need, but clearly, there's a hiccup in the functionality.

I would greatly appreciate any insights, suggestions, or corrections you might have. If you've encountered a similar issue or have experience with Tinkercad and Arduino, your guidance would be invaluable.

Thank you in advance for your time and assistance!

Ps sorry for the long paragraphs and lots of images of my code!


r/ArduinoHelp • • Dec 20 '23

No Barrel Power

Thumbnail
gallery
2 Upvotes

USB works. Thanks! 🍻


r/ArduinoHelp • • Dec 20 '23

Help with a project: How to detect a specific obejct's proximity?

2 Upvotes

I have this project I'm making which will activate when a specific key object is near the system

I just need a way to detect this specific object, but I feel like having a camera is too overkill since I want to detect a single thing. Is there a way to do this? I'm sorry if this is too obvious, I'm quite new to this whole arduino thing haha

If you want to know the specifics of my project: When the arduino detects that the key object is nearby (the object in question being a wristband), it will activate a robot. I intend on making a real life version of the Security Puppet from Five Nights at Freddy's 6 and, in the game, it detects a green wristband and activates. How can I do that? Is there a component or sensor that does this sorta thing?

Thank you for your time


r/ArduinoHelp • • Dec 10 '23

Arduino Multiple Rounds Help

2 Upvotes

#include <stdlib.h>

#include <stdio.h>

#ifdef _WIN32

#include <Windows.h>

#else

#include <unistd.h>

#endif

#include "rs232.h"

void wait_ms(int ms) {

#ifdef _WIN32

Sleep(ms);

#else

usleep(ms * 1000);

#endif

}

int read_serial(int cport_nr, char *buf) {

int n = 0;

while (!n) {

n = RS232_PollComport(cport_nr, buf, 255);

int last_n = 1;

while (n && last_n) {

wait_ms(10);

last_n = RS232_PollComport(cport_nr, buf + n, 255 - n);

n += last_n;

}

}

buf[n] = 0;

return n;

}

void write_serial(int cport_nr, char *buf){

RS232_cputs(cport_nr, buf);

}

int main() {

int n = 0,

cport_nr = 15, // COM port number

bdrate = 9600; // Baud rate

char mode[] = {'8', 'N', '1', 0},

buf[256];

if (RS232_OpenComport(cport_nr, bdrate, mode, 0)) {

printf("Can not open comport\n");

return (0);

}

char playagain;

int guess, continueReading, continueReading2, restartGame = 0;

do {

printf("Waiting for MBED...\n");

continueReading = 1, continueReading2 = 1;

// Receive and display messages from mbed

n = read_serial(cport_nr, buf);

printf("MBED: %s\n", (char*)buf);

wait_ms(1000); // Add a delay between messages

while (continueReading) {

scanf("%d", &guess);

sprintf((char*)buf, "%d\n", guess);

write_serial(cport_nr, (char*)buf);//send

// Receive and display messages from mbed

n = read_serial(cport_nr, buf);

printf("MBED: %s\r\n", (char*)buf);

wait_ms(1000); // Add a delay between messages

// Check if the received message indicates that you should stop reading inputs

//comparing input buffer with the message

if (strstr(buf, "Would you like to play again (y or n)?") != NULL)

continueReading = 0;

}

scanf(" %c", &playagain);

sprintf((char*)buf, "%c\n", playagain);

write_serial(cport_nr, (char*)buf);//send

wait_ms(1000); // Add a delay between messages

// Clear the input buffer

while (getchar() != '\n');

while (continueReading2) {

// Receive and display messages from mbed

n = read_serial(cport_nr, buf);

printf("MBED: %s\r\n", (char*)buf);

wait_ms(1000); // Add a delay between messages

// Check if the received message indicates that you should stop reading inputs

//comparing input buffer with the message

if (strstr(buf, "The End.") != NULL)

continueReading2 = 0;

if (playagain == 'y') {

// Receive and display messages from mbed

n = read_serial(cport_nr, buf);

printf("MBED: %s\r\n", (char*)buf);

wait_ms(1000); // Add a delay between messages

}

if (strstr(buf, "Restarting the game...") != NULL)

restartGame = 1; // Set the flag to restart the game

}

} while (playagain == 'y' && restartGame);

RS232_CloseComport(cport_nr); // Close the port

return (0);

}

I changed my code and added a condition for the pc programme to only proceed again after the message restarting the game is sent from the mbed… I don’t understand why it doesn’t let me still enter the guesses and why it doesn’t print waiting for the mbed… it gets stuck there after what is you guess but doesn’t let me insert a guess. At what stage does it get stuck in the pc programme? Is it a matter of clearing the guesses variable? Or the buffer?


r/ArduinoHelp • • Nov 24 '23

6v High Torque Servo Won't Function On Motor Shield?

2 Upvotes

I have only ever been able to get this servo to “somewhat” work when connected to 5v pin on the shield, the ground on the shield, and the signal line attached to whatever pin. But 5v is not enough and 9v is too much. I'm trying a million different ways to power this thing, but I don't understand why I give it an appropriate voltage from X source (while still having the signal line connected of course), and it doesn't want to move at all.

So currently my Arduino is powered via USB. The shield/motor is powered from a 12v 2a power supply, which with a simple voltage divider circuit gets me 6.29V. Multimeter seems to show this works. Also the “Vin Connect” jumper on back was cut to make the screw terminals a dedicated power line for the motor, per Arduino website. I tried this set up without cutting the jumper too, same - no result.

Can anyone help me out? All I want to do is power my arduino with shield, and motor, however that has to happen, and be able to run the "Servo Sweep" example code.

https://docs.arduino.cc/hardware/motor-shield-rev3

https://www.amazon.com/ANNIMOS-Digital-Voltage-Stainless-Waterproof/dp/B07KTSCN4J


r/ArduinoHelp • • Nov 12 '23

Making a midi controller with a nano

Post image
2 Upvotes

Code verifies fine but everytime I upload it this happens. Do I need a new board or is there something else that's wrong?


r/ArduinoHelp • • Sep 27 '23

noob question

2 Upvotes

I am new to Arduino and I have a question on the schematic for my 8x8x8 led cube. The schematic shows wires going from a component to "VCC". What is VCC? Is it the 5V pin on the Arduino board? Same for the ground? Thanks


r/ArduinoHelp • • Sep 12 '23

Arduino Uno Beginner - Capacitor

2 Upvotes

Arduino Uno Beginner - Capacitor

I'm very new to the Arduino Uno and I'm on project 5 of the booklet that came with it. This introduces 100uf capacitors. I was doing well until I read to be careful because it can explode if placed wrong, which stopped me in my tracks because I'm doing this with my young nephew. I bought a multimeter but to help me feel more confident but I'm new to using that as well. Some Questions..

If a 100uf capacitor connected to 5V explodes is it a small poof of something dangerous?

Do I need to discharge it once I'm done with the project? If so how do I do that safely?

Can I store these components in a regular plastic organizer/box or do they have to be in a anti static container of some sort?

Any multimeter tips?

Any recommendations on tweezers/pliers for placing the wires in the breadboard, they always get messed up when I try to put them in.

Any newbie advice would be appreciated (I'm scared lol), thanks!


r/ArduinoHelp • • Sep 03 '23

I'm working on a bigger project and I have this issue where my LEDs don't light up. Stripped down the code to the bare minimum yet they still do not light up. Any help? (Link to my LED strip in comments)

Thumbnail
gallery
2 Upvotes

r/ArduinoHelp • • Aug 12 '23

Why is xiao esp32s3 showing up as deneyap kart G? And how would I fix this?

Post image
2 Upvotes

r/ArduinoHelp • • Aug 11 '23

Decrease voltage without decreasing amperage

2 Upvotes

Hello Everybody,

I am currently working on a project in which I use a dc motor and a servo. The dc motor works at 9v, so I am using a 9v battery. I want to connect the servo to a battery instead of arduino because it simply draws too much current. I want to use the 9v battery for the servo too. How can I reduce the voltage while keeping the amperage the same? Voltage divider circuit seems to lower amperage and Id prefer to not buy a buck converter. Can I use a motor driver to lower voltage? (I am using an L298N)

Thanks!


r/ArduinoHelp • • Aug 08 '23

easiest way to create database for photos taken with esp32 cam with arduino uno.

2 Upvotes

I am a total beginner trying to make a system where esp32 cam will take pictures every minute and save it to a database. Google drive seems to be the best option. But as a beginner, it looks too complicated. And every website has different instructions and codes. I and my 2 friends have 3 days to make this. But our esp32 cam is not even enrolling faces. It does detect faces but does not enroll.

PLEASE HELP!!!!


r/ArduinoHelp • • Jul 31 '23

My motor shield is giving constant power when it shouldn’t

Thumbnail
gallery
2 Upvotes

My motor shield i M3 and m4 are giving constant power when they shouldn't my Arduino is not even plugged into my computer to tell it to send power to there. M1 and m2 are not sending any power out of them.

I have a cheap multimeter that can only be used in automatic. I can only get it to show Ohms for m1 and m2


r/ArduinoHelp • • Jun 25 '23

help needed

2 Upvotes

i have been trying to upload code to my arduino nano for several hours now and every time it just comes up with "executing comand: exit status 1" and the code never copies to my board and its frustrating. if it is needed here is the verbose output. "

/usr/local/bin/arduino-cli compile --fqbn arduino:avr:nano:cpu=atmega328 --build-cache-path /tmp --output-dir /tmp/1965698212/build --build-path /tmp/arduino-build-50166027C3E6EEFA8194B5C141B807D2 /tmp/1965698212/sketch_jun25a

Sketch uses 1898 bytes (6%) of program storage space. Maximum is 30720 bytes.

Global variables use 63 bytes (3%) of dynamic memory, leaving 1985 bytes for local variables. Maximum is 2048 bytes.

Upload started

Programming with: Serial

Flashing with command:C:/Users/vincent dionese/.arduino-create/arduino/avrdude/6.3.0-arduino17/bin/avrdude.exe -CC:/Users/vincent dionese/.arduino-create/arduino/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:/Users/VINCEN~1/AppData/Local/Temp/arduino-create-agent2255268964/sketch_jun25a.hex:i

avrdude: Version 6.3-20190619

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:/Users/vincent dionese/.arduino-create/arduino/avrdude/6.3.0-arduino17/etc/avrdude.conf"

Using Port : COM3

Using Programmer : arduino

Overriding Baud Rate : 115200

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x44

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x44

avrdude done. Thank you."


r/ArduinoHelp • • Jun 19 '23

Cant get this to work

2 Upvotes

Hello!

I have the code down below that works if i dont press the buttons that i have declared as switch pin. And when i unpress them nothing happens and i cant go back to rgb mode. Can anyone help me with this?

#include <Adafruit_NeoPixel.h>

// Constants for RGB strip

#define LED_PIN 6

#define NUM_LEDS 10

// Define the three potentiometer pins

#define POTENTIOMETER_PIN_R A0

#define POTENTIOMETER_PIN_G A1

#define POTENTIOMETER_PIN_B A2

// Define the switch pins

#define SWITCH_PIN_1 2

#define SWITCH_PIN_2 3

// Create an instance of the Adafruit_NeoPixel class

Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);

bool pulsatingEffectActive = false; // Flag to indicate if the pulsating effect is active

bool partyModeActive = false; // Flag to indicate if the party mode is active

void setup() {

Serial.begin(9600); // Initialize serial communication

// Initialize the NeoPixel strip

strip.begin();

strip.show(); // Turn off all pixels initially

pinMode(SWITCH_PIN_1, INPUT_PULLUP); // Set switch pin 1 as input with internal pull-up resistor

pinMode(SWITCH_PIN_2, INPUT_PULLUP); // Set switch pin 2 as input with internal pull-up resistor

}

void loop() {

// Read the switch states

bool switchState1 = digitalRead(SWITCH_PIN_1);

bool switchState2 = digitalRead(SWITCH_PIN_2);

// Check if switch 1 is pressed and the pulsating effect is not active

if (switchState1 == LOW && !pulsatingEffectActive) {

pulsatingEffectActive = true; // Activate the pulsating effect

partyModeActive = false; // Deactivate party mode if active

startPulsatingEffect();

}

// Check if switch 2 is pressed and the party mode is not active

if (switchState2 == LOW && !partyModeActive) {

partyModeActive = true; // Activate party mode

pulsatingEffectActive = false; // Deactivate pulsating effect if active

startPartyMode();

}

// Check if both switches are not pressed and no modes are active

if (switchState1 == HIGH && switchState2 == HIGH && !pulsatingEffectActive && !partyModeActive) {

// Read the values from the potentiometers

int potValueR = analogRead(POTENTIOMETER_PIN_R);

int potValueG = analogRead(POTENTIOMETER_PIN_G);

int potValueB = analogRead(POTENTIOMETER_PIN_B);

// Map the potentiometer values to the range 0-255 for RGB colors

int colorR = map(potValueR, 0, 1023, 0, 255);

int colorG = map(potValueG, 0, 1023, 0, 255);

int colorB = map(potValueB, 0, 1023, 0, 255);

// Set the RGB color for all pixels in the strip

for (int i = 0; i < NUM_LEDS; i++) {

strip.setPixelColor(i, colorR, colorG, colorB);

}

strip.show(); // Update the RGB strip with the new color

// Output the RGB values in the serial monitor

Serial.print("R: ");

Serial.print(colorR);

Serial.print(" | G: ");

Serial.print(colorG);

Serial.print(" | B: ");

Serial.print(colorB);

Serial.println(" | Mode: Normal");

}

delay(100); // Delay for smoothness (adjust as needed)

}

void startPulsatingEffect() {

while (pulsatingEffectActive) {

// Pulsating effect: gradually increase and decrease the brightness

for (int brightness = 0; brightness <= 255; brightness++) {

setBrightnessAll(brightness);

delay(10); // Delay between brightness steps

}

for (int brightness = 255; brightness >= 0; brightness--) {

setBrightnessAll(brightness);

delay(10); // Delay between brightness steps

}

}

}

void startPartyMode() {

while (partyModeActive) {

// Party mode: randomly change the RGB colors of all pixels

for (int i = 0; i < NUM_LEDS; i++) {

int randomColorR = random(256);

int randomColorG = random(256);

int randomColorB = random(256);

strip.setPixelColor(i, randomColorR, randomColorG, randomColorB);

}

strip.show();

delay(500); // Delay between color changes

}

}

void setBrightnessAll(uint8_t brightness) {

for (int i = 0; i < NUM_LEDS; i++) {

strip.setBrightness(brightness);

}

strip.show();

}


r/ArduinoHelp • • Jun 11 '23

it is giving me a error about a library import that doesn't exist?

2 Upvotes

r/ArduinoHelp • • May 19 '23

Why doesn't my motor spin?

2 Upvotes

Code is int motorPin = 3;

void setup() { }

void loop() { digitalWrite(motorPin, HIGH); }


r/ArduinoHelp • • Mar 16 '23

My Led blinks instead of fading

Post image
2 Upvotes

I coded my Arduino to fade my led light but when I look at the actual bulb it's just blinking on and off. Even when I change the fade values and the delay the blinking gets more and less rapid but there's never any actual fade. It's either fully on or fully off. Do I have the wrong type of LED to execute this code or did I just code it wrong?


r/ArduinoHelp • • Jan 31 '23

How do I replace delay while maintaining the same functionality?

2 Upvotes