Testing your Arduino board

Without disconnecting your Arduino board from your PC, you can test that it works as it should. Since the Firmata protocol is well known, there exist a lot of applications on varying operating systems, that can read sensors and control devices connected to the Arduino. Since we demonstrate Windows 10 in this book, you can use the Windows Remote Arduino Experience App for this purpose. It can be downloaded at https://www.microsoft.com/sv-se/store/p/windows-remote-arduino-experience/9nblggh2041m.

To test this software, we also need to connect some devices to it for testing. Let's connect our light sensor, PIR sensor, and relay module to it to see if we can access them. Make sure to connect ground, power and signal correctly. Also make sure to differentiate between digital pins and analog pins on your Arduino board. For the purposes of our example, I connected the PIR sensor to digital pin 8, and the relay to digital pin 9. The light sensor was connected to the analog pin A0.

In my Starter Kit, ground (GND or -) is always black, power (3.3V, 5V or +) is always red. Analog pins are colored blue, while digital are colored green.

While digital pins 0 and 1 can be used on some Arduino boards for general purpose input and output, other boards use them for serial communication only. That's why we've selected pins 8 and 9 instead of 0 and 1.

Also, consider using an antistatic wrist strap to protect your hardware from electrostatic discharges.

When opening the Windows Remote Arduino Experience App, you must first choose how the app will communicate with your Arduino board. Since it's connected to a USB port, select USB in the Connection box, and select a communication speed of 57600 baud. Next, the app makes a search, and a list of devices will be presented. The Arduino board should appear. Select it and click the Connect button.

You should now be able to interact with the hardware you connected. First go to the Analog tab. Set the A0 pin to Input, and then watch how the value changes as you cover or illuminate the sensor accordingly:

Analog peripherals

Similarly, on the Digital tab, set the 8 pin to Input. Move your hand in front of the PIR sensor to activate it, and watch how the value jumps to a high voltage level. Set the 9 pin to Output and control it by setting the value correspondingly. You should hear the relay clicking as it changes position:

Digital peripherals

Now that you know your Arduino is programmed correctly, and that values are reported as they should be over the USB serial cable, you're ready to start programming.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.224.197