See our full project Here and visit BreakoutBros.com for more.
I am a huge fan of my PocketCHIP- the handheld adapter for CHIP from NTC. However one of the Chips limitations as a hobby electronics medium is the difficulty of getting started in (what is to many) an unfamiliar controls atmosphere. Until there are more guides on how to use GPIO on CHIP we feel the fastest and easiest way to get started is to use the system one already knows. To get people started quickly we plan to show you how CHIP can be paired with the most common hobby micro-controller, the Arduino. This way you can use the simple and familiar I/O of the Arduino and manage the data with CHIP. You could take readings from sensors connected to an Arduino and easily post it on the Web, or SSH into your chip and use it to control your Arduino outputs. There really are a lot of easy possibilities once the connection is in place. Here is a look at the 4 part series on how to get information from CHIP to Arduino and vise versa.
1.) Serial via USB
2.) Bluetooth using HC-05 module
3.) Wifi Using ESP8266 serial Wifi chip
4.) Multiwire methods (UART, SPI, I2C, Discrete)
Now let's get into part one:
Serial Communication Through the USBPocketCHIP has a USB port, so does the Arduino. I think you can see where this is going. The easiest way to connect the CHIP to an Arduino is simply plugging in with USB. You need a USB cord tethering them but with serial read and write information seamlessly goes back and forth. And...the main reason I got one... You can even program an Arduino via PocketCHIP. Above I have my PocketCHIP hooked up to my RoboRED and the IDE running.
From the PocketCHIP the easiest way to get the Arduino IDE is to open the terminal and type:
chip:~$ sudo apt-get update chip:~$ apt-get install arduino
This will download and install all the necessary files to program your Arduino. Any time you want to run the IDE open the terminal and simply type
chip:~$ arduino
All the examples are there, key up Blink to test the connection.
Make sure you select the correct board and after trying to upload the sketch it should prompt you to use
/dev/ttyACM0 or /dev/ttyUSB0 as the Port. Click OK but remember which one you're using.
Now you can write to the Arduino over the USB serial monitor. Check out where I am using the PocketChip to send messages to a serial LCD*. You can use this same method to give any instructions to the Arduino.
You can also read data from the Arduino on the USB serial monitor. This is where I'm reading an analog signal from the Arduino**.
You can then save that data to a text file by opening another terminal tab and typing
chip:~$ tail -f /dev/ttyACM0 > myfile
Or, depending on which Serial to USB style your clone uses
chip:~$ tail -f /dev/ttyUSB0 > myfile
That should get you connected with the USB cable.
Thanks for reading and check back (or Subscribe) so you can see part 2 where we set up Bluetooth communication.
Notes:
*Because of the screen size it is impossible to "see" Serial Display in the Examples menu but this worked for me: File>Examples>Press the down button till you are 1 below GSM> hit enter> Serial Display. The better way to do this would be File>Open>Arduino>Libraries>Liquid Crystal>Examples>SerialDisplay>SerialDisplay.ino. But this method takes longer and I feel less like a ninja.
**The 2 millisecond delay in the AnalogInSerialOut example was a little fast for my PocketCHIP so I slowed it to 20 milliseconds. It worked very well this way.
Comments
Please log in or sign up to comment.