9 Replies Latest reply on Sep 8, 2015 4:46 PM by CMata_Intel

    Sparkfun Arduino block for Edison information

    newbee

      Please help, this is the last part of my project and I am clueless as to why it does not work as expected:

       

      Hardware: Edison, SparkFun Base block (2 USB), SparkFun Arduino block, SparkFun battery block.

      Project: Portable system for remotely monitoring light energy.

       

      I am measuring light through an analog pin on the Sparkfun Arduino block for Edison, and transmitting this information via WiFi to a server.

       

      When I start the system loading the sketch with the Arduino IDE and the Sparkfun base block is connected to the PC through USB, the analog reading that is transmitted is correct. If I disconnect the USB to be wireless, the analog reading is still correctly sent and received by the server.

       

      The problem shows up when I restart the block by power off/ power on sequence: the system connects to the remote server but sends a zero reading.

       

      When I run this same experiment with a reference system configured for an Edison/Arduino breakout board, this does not happen, so I suspect it might have to do with the Firmata layer, which is the only difference between the two configurations.

       

      Thanks in advance for any help, I am really stuck.

        • 1. Re: Sparkfun Arduino block for Edison information
          CMata_Intel

          Hi newbee

           

          Are you using a script do run at boot or everything is set in the Arduino sketch?

          Are you using re same code on both environments?

          I suggest you to start debugging step by step your code when it is restarted by power off/ power on sequence:

          • ADC readings
          • Connection to the server
          • ADC readings

          I think this will let us know if the readings from the ADC stop before or after the connection to the server. Also, check that when you are receiving zeros in the analog pin you are indeed reading a zero in the ADC.

           

          Regards,

          Charlie

          • 2. Re: Sparkfun Arduino block for Edison information
            newbee

            Hi Charlie,

             

            I just use the Arduino sketch for booting.

            I simplified things by removing the WiFi connection and did the following experiments using LED's for observing the behavior of the Sparkfun block, and finally obtained a repeatable behavior:

             

            The sketch simply reads a value from a photo resistor on the analog A2 and blinks an LED on Arduino block if it receives a signal greater than a small value

             

            1)  With USB connected and starting the program by loading the sketch results in positive readings (LED blnk)

            2) Disconnecting the USB cable when the program is running results in a short interruption where the system stops working and then it resumes normally (LED blink)

            3) Power off the block from the battery block switch, and then power back up boots the program (I have another signal turning on in each loop) but the LED does not blink, measurement received by Edison is zero.

            4) Then reconnect briefly and disconnect the USB cable and we get the results as in step 2, brief pause and then the LED starts blinking and the analog readings are normal.

             

            I hope you have some clues, I do not know where to go from here. I do not know what happens when the USB is connected/disconnected, why does that change the behavior of the system(?)

             

            THanks

             

            C

            • 3. Re: Sparkfun Arduino block for Edison information
              CMata_Intel

              Hi newbee,

               

              What is the outcome of using the reset button in the block instead of reconnecting the USB cable?

              I was checking some of the reviews of the block you are using and also the schematics of the boards. I think the issue could be related on how the ATmega328P is powered and with the booting process of the Edison related to when the the other IC is powered by the VSYS line.

              If you take a look in: SparkFun Block for Intel® Edison - Arduino - DEV-13036 - SparkFun Electronics you will find some suggestions that may help you. We have not tested this block so I suggest you to contact SparkFun for more information about the block and it performance.

               

              Regards,

              Charlie

              • 4. Re: Sparkfun Arduino block for Edison information
                newbee

                Hi Charlie

                 

                Using the reset button does not have the same effect as reconnecting the USB cable.

                 

                If the system is working (starting from a USB-connected condition) the reset button will only  cause a small interruption but the system will keep working after that. If the system is not working, the reset button does not restore it to working condition as with the connect/reconnect USB.

                 

                If the issue is the power-up timing, is there a hope it can be fixed? How?

                 

                Hope you have more clues, thanks

                 

                C

                • 5. Re: Sparkfun Arduino block for Edison information
                  CMata_Intel

                  Hi,

                   

                  Could you attach a couple of things? A picture with all the blocks you are using connected and working, also, the sketches you are using in the Edison and in the Arduino Block. Maybe there is something that could give us an idea of what is happening.

                   

                  Regards,

                  Charlie

                  • 6. Re: Sparkfun Arduino block for Edison information
                    newbee

                    Hi Charlie, thanks for taking a look!

                     

                    Here is the code I ran on the Edison for testing sparkFunArduinoDebugging.ino. The SF Arduino block is running StandardFirmata from the Arduino IDE.

                     

                    The picture of the stack is below, please let me know if you need more details for replicating my experiment.20150902_173128.jpg

                    • 7. Re: Sparkfun Arduino block for Edison information
                      CMata_Intel

                      Hi,

                       

                      The behavior you are having seems to be related to the capacity of the battery block. The ADC you are using is located in the Arduino block and it seems that the battery is able to properly boot the Edison but not the ATMega, the ATMega seems to need power from the USB port to boot as it should, this is the reason why it works the first time and when you plug and unplug the port.

                      The alternatives you have are:

                      1. Contact SparkFun to know which is the best way to power your configuration with those blocks.

                      2. Power the Arduino block through the Vin pin of the block

                       

                      Regards,

                      Charlie

                      • 8. Re: Sparkfun Arduino block for Edison information
                        newbee

                        Hi Charlie,

                        Let me make sure I understand your hypothesis. Do you mean that when I power up the stack with the battery the Arduino block works only partially and the part not working is the ADC which needs extra current from the USB cable to start running?

                         

                        Thanks

                         

                        C

                        • 9. Re: Sparkfun Arduino block for Edison information
                          CMata_Intel

                          Hi,

                           

                          It's something like that. Let's picture a current-peak if the peak is higher than a value A but lower than value B. [A<peak<B] you will need to have a value like B to power all the modules you need.  This current seems to be provided by the USB and not by the battery.

                          One thing you could try is to shutdown all the services you are not needing in order to check if it improves the behavior.

                           

                          Regards,

                          Charlie