To solve the problem of knowing when the speed controllers are initialized or not, I decided that the best solution to solve the problem would be to use a current sensor. So I bought a current sensor. But unfortunately this solution has proved difficult to implement since the sensor is not working as I expected. To test the sensor I connected it to a Arduino board. The first problem I encountered is that the sensor reads the same values, regardless of whether or not connected to a circuit. I also tried to calibrate the sensor by following the procedure that is on the product page but without success. The second problem has to do with the little information available about this sensor.
However, while I tried to solve the sensor problem I found a simple solution to the problem of whether the speed controllers were initialized or not using only one on-off switch push. There is a switch designated switch DPST (Double Pole, Single Throw), which consists of a pair of on-off switches which operate together but in different circuits. The quadcopter has two independent circuits, one connecting the motors and speed controllers to one battery and other circuit that connects the Seeeduino board to the other battery. To test the idea I had based on this example from the page of the Arduino board. I designed a scheme that can be seen in figure 1 and that lets me know when the green LED is turned on or off.
![]() |
Figure 1 |
As can be seen in the scheme of the figure 1 there are two independent circuits. One include the 9V battery and the LED and the another is on the Arduino board. Both circuits are connected to the on-off switch push. The following sketch lets me know at any moment if the LED is turned on or off.
#define SWITCHPUSH 7 // the input pin where the // on-off switch push is connected int state = -1; // state variable will be used to store // the state of the input pin void setup() { Serial.begin(9600); // open the serial port pinMode(SWITCHPUSH, INPUT); // tell Arduino SWITCHPUSH is an input } void loop() { int val = digitalRead(SWITCHPUSH); // read input value // check if the read value is different of the state value if(val != state) { // check whether the input is HIGH (switch push pressed) if(val == HIGH) { // print the string "LED is ON" to the serial port Serial.println("LED is ON"); } else { // print the string "LED is OFF" to the serial port Serial.println("LED is OFF"); } state = val; // store the value read in state variable } delay(100); // wait 100 ms between each send }
If I press the on-off switch push turns on the LED. From the Arduino board I get to know that the LED is turned on. If I turn off the Arduino board and re-connect it again I continue to know the status of the LED, because the on-off switch push operating in different circuits. This is very simple.
Figure 2 |
In Figure 2 we can see the two circuits with the various components in operation. The on-off switch push is in the image upside down so we can see the connections. By comparison we can see the LED as the speed controller. Sometimes the best solutions are the simplest ones.