Arduino code for actuators

Hello,

I’m trying to write an arduino code that, while getting data from a sensor, is able to activate two or more actuators simultaneously (if needed). Has anyone got any advice or codes?

My advice would be to write some code for your sensor and actuators. This will be faster than searching for code that fits your needs, because it may not exist, and even if it does, you could die of old age before you find it.

What type of actuators do you wish to use? Linear actuators? If yes, how many volts?

That’s a good advice​:joy::joy:

If I’m writing here, it means that I’m having some problems and so I need some advice.

Do you have any ideas not on the code itself but on how to activate more than two actuators simultaneously (if needed)?

Our problem is the code, not the actuators themselves

Hello fedepale27

Welcome to the worldbest Arduino forum ever.

Take a view here to gain the knowledge.

Have a nice day and enjoy coding in C++.

I’ll try to explain the problem in a better way. We connected the actuators and they work. Our sensor scans the environment and gets data related to obstacles. The problem is that when we expect the vibration of two or more actuators, only the actuator linked to the nearest obstacle vibrates. So if I want Actuator 1 to vibrate when obstacle is at a distance<30cm (and in a certain Angle range)it vibrates; but when I move an obstacle at a distance<30cm (in a different angle range) the actuator linked to the nearest obstacle vibrates, whereas we want both to vibrate.

How the code looks like to make both actuators vibrate at the same time

depends on:

  1. how activating a single actuator works.
    • H-bridge?, PWM?, what function-call?
  1. what logic your program has
    • conditions? , a state-machine? if else-if?, interrupts?
  1. power-supply

I'm pretty sure that you do not yet know what all the terms asked for above mean

So the simplest way to receive effective help is if you post your
complete sketch as described in this short tutorial

best regards Stefan

This problem sounds like nothing to to with any of the hardware. It's your code that's the problem. Post that code, according to forum guide, and we will help you debug it.

All in all it seems to be a xy-problem.

Find what you like around the internet, search for the words you used: "arduino sensor actuator"

I like RandomNerd

and DroneBotWorkshop
https://dronebotworkshop.com/ac-arduino/

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.