It used to work correctly, then after fixing a component's soldering, it stopped working entirely. I removed everything, cleaned the board and cleaned the solder from the ports, and it still don't work. The led turns on, but it's not detected. Is it dead ? Or can I fix it ?
I'm making an saddle style vibrator (see r/ProjectCowgirl or r/OpenSaddleVibrator). In the project, there's a controlbox with a Nano in it, with two potentiometers and buttons for input control. From there, the signal goes to a UNO, which then communicates with a dual motor PWM controller.
Any help and input would be much appreciated here..
I'm having a load of trouble getting it working. Below is a wiring diagram that I'm using:
// Nano code:
// Master code for Arduino Nano for the Saddle Vibrator by Jands87
// https://www.thingiverse.com/thing:3554455
// Version 1.0 (14.4.19) - Note this has been edited for minor spelling corrections by Stumro. There is essentially no change to the code function other than directed pins.
#include <Wire.h>
const int pot0 = A0; // pin designation for pot0
const int pot1 = A1; // pin designation for pot1
const int butt0 = 2; // pin designation for button0
const int butt1 = 3; // pin designation for button1
const int LED = 13; // LED showing debugging mode
byte motor0;
byte motor1;
byte button0;
byte button1;
byte debugflag;
void setup()
{
Wire.begin(8); // join i2c bus with address #8
Wire.onRequest(requestEvent); // register event
Serial.begin(9600); // set serial baud to 9600
Serial.println("Slave"); // print on screen position of board
pinMode(butt0, INPUT_PULLUP); // set both inputs to internal pull ups
pinMode(butt1, INPUT_PULLUP);
}
void loop()
{
motor0 = map(analogRead(pot0), 0, 1023, 0, 255); // map will return byte size data
delay(10);
motor1 = map(analogRead(pot1), 0, 1023, 0, 255);
button0 = !digitalRead(butt0); // read in button status and invert
button1 = !digitalRead(butt1);
delay(500); // 0.1-sec interval as a test interval
if ((digitalRead(butt0) == 0) && (digitalRead(butt1) == 0)) { // enter debug mode if both buttons pressed when powered on
if (debugflag == 0) {
debugflag = 1;
digitalWrite(LED, HIGH);
button0 = 0;
button1 = 0;
delay(1000);
}
else {
debugflag = 0;
digitalWrite(LED, LOW);
button0 = 0;
button1 = 0;
delay(1000);
}
}
}
void requestEvent()
{
Wire.write(motor0); // data item-1 as ASCII codes
Wire.write(motor1); // data item-2 as ASCII codes
Wire.write(button0); // data item-3 as ASCII codes
Wire.write(button1); // data item-3 as ASCII codes
Wire.write(debugflag); // data item-3 as ASCII codes
if (debugflag == 1) {
Serial.print(motor0); // data item-1 as ASCII codes
Serial.print(","); // local separator
Serial.print(motor1); // data item-2 as ASCII codes
Serial.print(","); // local separator
Serial.print(button0); // data item-3 as ASCII codes
Serial.print(","); // local separator
Serial.print(button1); // data item-3 as ASCII codes
Serial.print(","); // local separator
Serial.println(debugflag); // display debug status
}
}
// Uno code:
// Master code for Arduino Uno for the Saddle Vibrator by Jands87
// https://www.thingiverse.com/thing:3554455
// Version 1.0 (14.4.19) - Note this has been edited for minor spelling corrections by Stumro. There is essentially no change to the code function other than directed pins.
#include <Wire.h>
byte inData[10]; // incoming data array for data from controller (make larger than you need)
const int motor0 = 6; // pin designation for motor0
const int motor1 = 9; // pin designation for motor1
const int LED = 13; // LED showing debugging mode
bool button0 = 0; // internal variables for button0 on controller
bool button1 = 0;
bool button1flag = 0; // check flag to see if button is being held down, debounce
bool rampmode = 0; // flag for ramping mode on motor0
bool flag = 0; // dead man switch for connection, stop motors if no data
bool debugflag = 0; // set 1 for debugflag mode to print serial updates
void setup()
{
delay(600); // allow controller to start first
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600); // set serial baud to 9600
}
void loop() {
flag = 0; // set connection flag to off to show data to stop motors if no data arrives
Wire.requestFrom(8, 5); // request 5 bytes from slave device #8
while (Wire.available()) {
for (int i = 0; i <= 4; i++) {
inData[i] = Wire.read(); - '0'; // read 1 byte from the wire buffer in to "inData[i]" -'0' is to convert back to int from char
}
button0 = inData[2]; // check to see if any buttons have been presed
button1 = inData[3];
if (inData [4] == 1){
debugflag = 1; // enter debug mode
digitalWrite(LED, HIGH); // LED showing debugging mode, HIGH);
}
else
{
debugflag = 0; // exit debug mode
digitalWrite(LED, LOW); // LED showing debugging mode, HIGH);
}
flag = 1; // set connection flag to on to show data has arrived.
}
if (flag == 0) { // deadman (no connection) switch to stop motors
for (int i = inData[0]; i == 0; i--) { // decrease motor0 and motor1 speeds until stopped
analogWrite(motor0, 0);
delay(10);
}
for (int i = inData[1]; i == 0; i--) {
analogWrite(motor1, 0);
delay(10);
}
}
if (flag == 1) { // only continue if controller is connected (deadman switch check)
// ***************** BUTTON 0 ROUTINES *****************
if (button0 == 1) { // process button routine if button0 has been pressed
button0press();
}
// ***************** BUTTON 1 ROUTINES *****************
if (button1 == 1) {
button1flag = 1; // set button flag to make sure it does not continuously run the routine (debounce)
}
if ((button1 == 0) && (button1flag == 1)) { // if button has been released reset button0 flag and process routine
button1flag = 0;
if (rampmode == 0) {
button1press();
}
else if (rampmode == 1) {
rampmode = 0;
}
}
// ****************** MOTOR ROUTINES ******************
if ((button0 == 0) && (button1 == 0)) { // no buttons have been pressed - set motor speed
if (rampmode == 1) {
inData[0] = 255;
}
analogWrite(motor0, inData[0]); // PWM to output motor0 port
delay(10);
analogWrite(motor1, inData[1]); // PWM to output motor1 port
}
}
if (debugflag == 1) {
showSerial();
delay(1000);
}
else if (debugflag == 0) {
delay(100);
}
}
void button0press() { // button0 has been pressed
inData[0] = 255; // set motor0 speed to 100%
analogWrite(motor0, inData[0]); // PWM to output motor0 port
}
void button1press() { // button1 button has been pressed
rampmode = 1;
for (int i = inData[0]; i <= 255; i++) { // slowly ramp motor speed to 100%
Serial.print(i);
Serial.println(".");
analogWrite(motor0, i);
delay(10);
}
Serial.println();
}
void showSerial() {
Serial.print("Masterboard Status: ");
if (flag == 0) { // deadman (no connection) switch to stop motors
Serial.println("Controller disconnected. (Debugging)");
}
else if (flag == 1) {
Serial.println("Controller connected. (Debugging)");
}
Serial.print("Motor 0:");
Serial.print(inData[0]);
Serial.print(" / ");
Serial.print("Motor 1:");
Serial.print(inData[1]);
Serial.print(" / ");
Serial.print("Button 0:");
Serial.print(button0);
Serial.print(" / ");
Serial.print("Button 1:");
Serial.print(button1);
Serial.print(" / ");
Serial.print("Button 1 Flag:");
Serial.print(button1flag);
Serial.print(" / ");
Serial.print("Ramp Mode:");
Serial.print(rampmode);
Serial.println();
Serial.println();
}
Edit: included link to PWM documentation and the the UNO code.
I have a 7 segment display connected to an arduino and the code allows for a IR sensor to detect and display the number pressed on a remote. Is it possible to also connect a LCD to the circuit so that the number pressed on the remote is displayed on the 7 segment and LCD ?
So. At my job I have to sometimes sponge a concrete section. Let's say 8 feet by 20 feet. So 160 square feet. To sponge a panel, I have to constantly "dab" with a sea sponge. The sponge is barely bigger than my open palm. So to do a whole panel, I dab the sponge probably average (probs more) of 12 times per square foot. So 1920 dabs of the wrist in usually about half an hour. Obviously, I don't want to do this as it's a lot of fatigue on the wrist and elbow.
I want to make an arduino tool to do this for me. Not hand held, I plan to have a gantry (a 2x4) for the contraption to ride along. That part can be manually done with a rope and a pulley to go across the panel. The hard part is deciding what to use for a piston of sorts.
I need something that can lift/lower a wet sponge quickly and by a decent distance. Probably 2cm ish. by quickly, I'm thinking 4 dabs per second. A solenoid would obviously be simplest, but I have no idea how fast they can operate, or how much weight they can handle. My other idea is to use a DC motor, and make something similar to an air compressor piston. Where the DC motor spins one direction, and the pivot point rotates around the motor making the piston go in and out. That's a touch more complicated and will likely be lots of trial and error for speed/dab distance. I don't think servos can operate fast enough, and not sure on their max speeds.
I don’t really know where to post this, but I have a screen off of an ender 3 pro that I am trying to reuse. I can connect it to the arduinos power and get it to turn on. However it boots off the ender 3 stuff that is on the screen. I am unsure how to go about programming it or how to get rid of the ender boot. It also has some rx and tx pins that I don’t know what to do with
How do I make serial input in arduino as a variable for millis()? To act as an adjustable timer? I've been trying to find codes but none seems to heed to my needs. Please help me, will appreciate it alot!
I plan to replace my ordinary doorbell with an elaborate NodeMCU-NodeRed automation chain. The chain should go like:
- person rings
- NodeMCU gets power, http-posts to Node Red flow
- NR flow does clever and funny things
- I go and open the door.
I've read some tutorials and have a small sketch, but then it hit me: why do I need to put the NodeMCU into deep sleep state, when my doorbell most probably works with 12V power and I have a step down module, why not connect the NodeMCU directly to the door bell power?
MCU gets power, POSTS to Nodered, done. No need for optocouplers or resistors... or am I missing something?
Soo i've been trying to use my pro micro as FTDI for ESP-01. And as you might asume by me commiting this very post here, i've failed.
Arduino Pro Micro with ATmega32u4 ESP-01 / ESP8266
Connections look like soo: Additionaly breakout i'am using has some kind of tiny condensator, idk why and for what. I am trying to upload a blink as test, both arduino and ESP blink a fiev times before arduino.ide splits an error at me. log from IDE
Known ideas: - shorting RST and GND on Arduino -> no serial port for IDE to upload onto - switching TX and RX wires -> No response from eighter ino or ESP
The project has 2 buttons, 2 leds and 2 buzzers. The idea is that when you press the button the light asociated with the button you pressed should stay on for a few seconds as well as the buzzer, that way the participants can know which one pressed first and needs to asnwer the question. The problem is how to determine wich one of both was pressed first and how to keep the light on for a while.
I've searched for a while this software because i know that is something that it is used in a lot of quizes and schools but where i live this is not as common.
Ive tried using many apps, to which some of them i can connect to, although my output to the serial monitor is nothing. If this module is incompatible, what are the alternatives?
#include <SoftwareSerial.h>
// BLE Mod Setup
SoftwareSerial HM(3, 4); // RX, TX
char v;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
HM.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available())
{
v=Serial.read();
HM.print(v);
}
}
So I got a LAFVIN smart car a while back and made the whole thing, I made it with a YouTube tutorial and the coding and stuff for the car where in the description. I wanted to open the file but I couldn’t in my country or region (the Netherlands) does anyone know a place where I can get the code for the LAFVIN smart car???
Hello ArduinoHelp! I've only recently gotten into modding and found a good starter project to sink my teeth into. Making a mouse input device from an old Wii Nuncuck. It took some time to figure out the pins, especially with the joystick (this was the only project I could find that didn't use a nunchuck with a gyro in it and used a Teensy 2, which I already had, so I couldn't use the original wires that go to it's connector)
Anyways, I got the code loaded in and it works. Only thing is that it doesn't work really how I might want it to. I'd like to change the code to basically have the C button (I swapped this to Right Mouse, originally Left in the code) to be Right mouse on click, and Middle mouse on Hold for some amount of time, like 1-2 seconds. This would making scrolling much easier and seems like the simplest thing to change. I've tried looking up arduino codes for things like click vs hold, but I'm still so new, most things I found basically assumed you had a working basic knowledge
The code I used is here, provided by the OP of the post. The only thing I did was swap it so the Z button was Left mouse and the C button was Right mouse. Thanks in advance
This may be a stupid noob question. Sorry. Can I reset or re-use an already programmed Uno? Will resetting it delete the sketch? Can I run a blank setup in IDE? Noob here. Sorry.
hey, so im designing a robotic arm atm, and am trying to find a good way to have limits for my actuators. They are going to be driven with cheap steppers and im trying to go for a cleaner look so i would like to avoid using limit switches. I was thinking of embedding cheap potentiometers that I got from amazon, however i would have to gear them since their range of motion is limited (270 degrees i think). Does anyone know if this is a good idea (bare in mine this isnt going to be super precise and desktop size). If not, id like to hear some other ideas. thanks
I have this issue where the serial monitor isn't reading the state of the switch properly, the monitor only works when my hand/finger is near the cable or touching. When my finger is close or touching the wire (that is being read using a digital read line) the tx light is flashing and doing all sorts. Has anyone had a similar issue before?
Some context. My project consists in 2 traffic lights, one should be always in green and the other red, and they should start changing when I press a button. so the first one goes to red while the last one changes to green.
Now my problem is that the lights change withouth the press of the button. they are constantly going back and foward. I dont believe its a sketch problem because I copied the sketch from a book, but I will check that regardless..
Has anyone had similar problems on a similar project?
I’m a high school theater director. For a production of a play called Radium Girls I would like to construct a sort of chandelier of 75 or so paper lanterns — different sizes but not tiny, clustering in a space about 20’ wide.
I would like the lanterns to light up one-by-one over the course of about 90 minutes. They could come on randomly. Fading in would be nice.
Some notes:
These would need to be bright enough to be visibly on even with stage lighting on. They don’t have to be lighting the actors.
it would be ideal to have a single power source and a single controller, so no one has to clamber high above the stage to switch out batteries. Perhaps a stagehand, on a cue, pushes a button and the program runs on its own.
I have a supportive tech department on my side, and I do okay with programming Arduinos (I also teach computer science). So assume intermediate-level skills but no more.
Hello everyone I'm having some issues I'm trying to do a simple project I want to turn a stepper motor continuously at a certain speed I used my mega 2560 board that came in my kit and got it doing exactly what I wanted but when I went to put that same sketch on the esp8266 board it does half a turn stops for a split second then repeats I changed everything that needed to be changed as far as I know like my pin numbers and stuff for the esp8266 board but it just wont continue to rotate like it did on the mega 2560 board I'm at my wits end and help would be great it is a 28byj-48 motor.
Hi everyone complete nub here I'm trying to make a project to where I use an ir remote to turn on and off a stepper motor and have it turn continuously until I hit the off button on the remote I have been trying for a week and just cannot figure it out at this point I even tried using a stock code from the library made for the stepper I'm using when I try to compile it to check it I get void error codes I'm at my wits end. Can someone please help me.
We are making an automatic wire stripper and cutter for a school project. We use an Arduino Mega, 2x shield and motor drivers and 2 stepper motors. Does anyone know how to control those 2 motors at different frequencies at the same time? You guys are our last help, no one else could help us.