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
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
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
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
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
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
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
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
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
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
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
Accepted
Remote Controlled Self-Balancing Robot - how to mix control input with IMU input?
The PID get's a set point from you. For a standing still robot this a basically an angle of zero in respect to the gravity direction (which variable you use for the PID depends on your actal ...
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 ...
1
vote
Determining direction from IMU accelerometer data
You can't with any great accuracy.
The acceleration vector from the accelerometer is a combination of two things:
Gravitational acceleration
Acceleration due to change in the robot's velocity.
If the ...
1
vote
Accepted
Arduino communication protocol with python - beyond pyserial and Arduino example
Ok, after quite some time looking for something that would allow me to easily control an arduino with the raspberry pi, I found the FIRMATA protocol which allows one to communicate with the arduino ...
1
vote
Accepted
Built-In Digital Map for Robot Driving
You were able to create a custom data structure from your string, but it seems, that the connections, that are stored in the Map class, are not connected. So the map does not really represent the ...
1
vote
How can I hook up multiple MMA8451 accelerometers, (I2C protocol) using one Arduino Mega?
The general technique for addressing multiple I2C devices is:
If the device(s) have only one address: use an I2C bus multiplexer.
If the device(s) have two addresses controlled by an addressing pin: ...
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