15
votes
What is the best technique to design a 20 push button circuit
For 20 buttons you can use a Keypad Matrix arrangement (plenty of examples online) where you would use only 9 pins (5 columns of 4 rows is 5+4 pins). It's slightly more involved that simple 1:1 ...
5
votes
How do I code delay inside a ISR?
An ISR should be kept as short as possible, since while it runs, no other interrupts can be handled (including the one powering the delay() function. Thus you cannot delay that easy inside an ISR and ...
5
votes
Pulsein() function blocks other tasks from running silmultaneously
It is quite likely due to blocking. The description of the pulseIn() function in the Arduino site's reference section says:
Reads a pulse (either HIGH or LOW) on a pin. For example, if value is
HIGH, ...
4
votes
Need some Hardware advice with arduino
To process incoming images, voice commands, produce sounds, and also do WiFi is almost certainly beyond the capabilities of any micro computer, like the Arduino (maybe some of the more recent models ...
4
votes
Accepted
Smooth Servo movement for robotic arm: An ongoing answer and soluton
Your original solution uses blocking code (the for loops with delay() calls in them). Surely that works, but it can easily get you in trouble, when extending the project with more functionalities (...
4
votes
What is the best technique to design a 20 push button circuit
The example project below can control 16 switches. If you have a membrane keypad with 5 x 4 or 5 x 5 then you can meet your requirement.
I will shortly add an example of using shift registers to have ...
4
votes
LM7805 gets very hot with four servo motors
Depending on load, your servos can draw 250ma of current or more when actuated. This means that your 7805 may need to supply >1 amp of current at 5V.
In order to get 5V from a 12V adapter the 7805 ...
3
votes
Accepted
Can I connect Multiple Devices to One 5V and one GND pin of my Arduino Uno R3
Yes, you can connect multiple devices to GND and +5 V. You may find that you need to bring one wire from the PCB to an external connector or piece of stripboard so that you can make more reliable ...
3
votes
How can I control 4 DC motors with an Arduino?
Yes, you can do this using 2 L293D motor drivers, each motor driver can run 2 motors and it is very easy to use.
You should connect Vcc 1(used to power on the chip) to 5V and Vcc 2 to a power supply ...
3
votes
How do you determine Lead Screw position using Absolute Encoder?
The encoder attaches to the motor (or other) shaft and sends a 10-bit rotational position for a precision of 0.35 deg, and a claimed accuracy of +/- 0.7 degrees. It will be up to the application to ...
3
votes
Need some Hardware advice with arduino
Your main bottleneck here is the camera. If you want to do real time video, I would suggest getting a Raspberry Pi or the equivalent then using it as a master over something easier to code like an ...
3
votes
Accepted
Is it possible my ATMega is burnt due to bad wiring?
Smoke is a definite sign something failed. The LED (power indicator)is independent of the microprocessor, it just indicates power is applied in the appropriate direction. Go to the basics, and load ...
3
votes
Smooth Servo movement for robotic arm: An ongoing answer and soluton
Here are the simulation results of the code from Chrisl
The code (same as the other answer)
#include <Servo.h>
Servo servo1;
int set_angle = 0;
int current_angle = 90; // setting starting ...
2
votes
Rotate Robot head according to Sound level
A couple of years ago, I completed a MOOC on FUN called Binaural Hearing for Robots (it doesn't seem to have run since, but it may be worth keeping an eye on it to see if they open registration again. ...
2
votes
Multi-threaded Robot
You could also give my ThreadHandler library a try
https://bitbucket.org/adamb3_14/threadhandler/src/master/
It uses an interrupting scheduler to allow context switching without relaying on yield() ...
2
votes
Recording of sensor results but only retain the last 3 sets of data
It depends how big the data is... if one data set is 100 bytes, you can spend 300 bytes of internal SRAM memory.
What you also can do if the memory usage is too big, is to add external SRAM, like the ...
2
votes
My "avoid car" can't move straight
Likely the two gearbox motors you have are running at slightly different speeds for the same voltage. This is probably within normal tolerances, given that you say it moves slightly to the right or ...
2
votes
Accepted
Out of two logically similar sketches, one works while the other does not
Given that both libraries are the same.
The two sketches seem to set up the motorcontroller quite differently. Changing an "input pin" and "enable pin" around, would lead to errratic motor behaviour.
...
2
votes
How can I hook up multiple MMA8451 accelerometers, (I2C protocol) using one Arduino Mega?
Talking about I2C protocol. The slave Address is of 7 Bits that means one I2c can handle 127 Slave I2C devices of different address. So you can connect 127 devices with Single I2C Port just make sure ...
2
votes
How can I hook up multiple MMA8451 accelerometers, (I2C protocol) using one Arduino Mega?
Brief explanation: When you talk to the slave device through I2C you start with (slave) device address. Then you send the message. It is like calling your colleague in an office with many other people....
2
votes
Running a robot with 2 front-facing sensors, but it's stuttering
your updateDirection logic doesn't quite work the way you think it does.
after a bit of code formatting and comments it looks like this:
void updateDirection() {
if (distanceInchR < ...
2
votes
Deriving the exact relationship between PWM and steering
Where do I learn more about this feedback mechanism?
It depends on the kind of feedback. You can have absolute or relative feedback. Relative would be, for example, to use an encoder on each wheel to ...
2
votes
What is the best technique to design a 20 push button circuit
you can use a so called shift register. One very common one is a 74HC165 shift register (https://playground.arduino.cc/Code/ShiftRegSN74HC165N/).
With one of such IC you can connect 8 buttons, however ...
2
votes
are 4AA batteries (6V) power my arduino
I understand you situation completely as I had also previously experienced the same problem. 9 V batteries are not enough to get the job done.
Therefore, I suggest you to use two 3.7 V Batteries. ...
1
vote
Can 2 H-Bridges be controlled by one Arduino?
Yes you can connect 2 H-bridges to a single arduino. Just make sure that you have enough power for the arduino and the motors and also check if you have enough pins (I/O and PWM) for using the H-...
1
vote
Arduino acts odd when disconnected from computer
What seems is that you are facing an power shortage while working with on board power supply.
While running DC motors and Arduino on same battery set your Arduino is not getting enough power.
Try ...
1
vote
How to properly run four DC motors with an Arduino?
With out knowing the demands of the motors (how much current they need under a given load) it is difficult to answer your question. But, in most Arduino designs:
Motors are powered independently of ...
1
vote
Trying to Pulse an LED a number of times outside of the main loop
You'll want a class function that decides whether 'now' is time to toggle the LED or not, and returns quickly. Call that function frequently from your loop function. Your other class functions will ...
1
vote
Accepted
Error compiling a sketch to class/library conversion
Don't define your global variables in the header file. Only declare them, using external linkage. Then define them in the implementation file
Header (.h):
extern ros::NodeHandle nh;
Implementation (....
1
vote
Determining direction from IMU accelerometer data
You haven't described your robot but if it is a typical wheeled vehicle that can drive forward and backward, the accelerometer can give you one of those two directions (which is already known because ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
robotics × 140arduino-uno × 59
motor × 25
sensors × 23
servo × 14
arduino-mega × 13
programming × 13
serial × 8
arduino-motor-shield × 8
arduino-nano × 7
power × 5
i2c × 5
pwm × 5
arduino-ide × 4
ir × 4
rotary-encoder × 4
pid × 4
c++ × 3
bluetooth × 3
interrupt × 3
shields × 3
adafruit × 3
battery × 3
sketch × 3
electronics × 3