In this project, he learn how he communicate between Arduino (Internal Arduino chip on LattePanda) and Microsoft Visual Studio and send data from the Arduino to use a Windows Application. Following is the original article.
THINGS USED IN THIS PROJECT
- Software apps and online services:
INTRODUCTION
LattePanda is a complete mini computer integrated with Arduino running full version Windows 10. It includes everything a regular PC has and can do anything that a regular PC does. It is compatible with almost every gadget you know: printers, joysticks, cameras and more. Any peripherals that work on your PC will work on LattePanda. LattePanda comes pre-installed with a pre-activated full edition of Windows 10.
Using existing APIs, you can develop your own software and hardware projects on LattePanda as you would on a normal PC with C#, Javascript, Ruby and so on. Say goodbye to your bulky laptop! But not only can it be used as a low cost regular Windows computer, LattePanda is also designed with an Arduino compatible co-processor, which means it can be used to control and sense the physical world, just like an Arduino board! Whether you are a Windows developer, an IoT developer, a hardware DIY fanatic, interactive designer, robotics wiz or a maker, LattePanda can aid your creative process with physical computing projects! LattePanda can run full version of windows 10 and Ubuntu.
SPECIFICATION
- Processor: Intel Cherry Trail Z8300 Quad Core 1.8GHz
- Operation System: Pre-installed pre-activated full edition of Windows 10 (Home version)
- Storage Capability: 32/64GB
- USB: 1 x USB 3.0, 2 x USB 2.0
- HDMI Video Output and Ethernet port
- Touch and Display Connector
- Plug and Play Sensor Connectors
- GPIO: 2 GPIOs for Intel chip, 20 GPIOs for Arduino
LattePanda Pinout
Below pictures is a basic diagram that displays all the pins:
Pinouts in area U1 are assigned to the X-Z8300 core. At the moment, no more information is available.
Pinouts in area U2 are assigned to the ATmega32u4 core. Each of the 20 digital pins (A0 - A5, D0 - D13) in area U2 can be used as an input or output, each operating at 5 volts. Each pin can output or input 40 mA and each has an internal pull-up resistor (disconnected by default) of 20-50k ohm.
Caution: Exceeding 40mA on any I/O pin may cause permanent damage to the ATmega32u4.
Some pins have specialized functions :
Analog Inputs: A0 - A5, A6 - A11 (on D4, D6, D8, D9, D10, and D12). The LattePanda has 12 analog inputs, labeled A0 through A11, all of which can also be used as digital I/O. Each pin has a 10 bit resolution (i.e. 1024 different values). By default they measure from ground to 5 volts.
Serial: D0 (RX) and D1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
External Interrupts: D3 (interrupt 0), D2 (interrupt 1), D0 (interrupt 2), D1 (interrupt 3) and D7 (interrupt 4). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value.
PWM: D3, D5, D6, D9, D10, and D13 provide 8-bit PWM output.
SPI: D16 (MOSI), D14 (MISO), D15 (SCK).
LED: D13 There is a built-in LED driven by digital pin 13. When the pin's value is HIGH or LOW
TWI: D2(SDA), D3(SCL).
Other pins on the board:
Reset: Bring this line LOW to reset the micro-controller. It is typically used to add a reset button to shields which block the one on the board.
What is the purpose of this project?
In this project, we will learn how we communicate between Arduino (Internal Arduino chip on LattePanda) and Microsoft Visual Studio and send data from the Arduino to use a Windows Application. Here we will measure temperature and humidity environment and send DHT sensor data to Thingspeak.
How to access pinouts from Visual Studio
LattePanda.Firmata is an open-source Firmata library provided by LattePanda, which is suitable for Windows apps developed in Visual Studio. This class allows you to control Arduino GPIO from Windows apps, with features including:
- Reading and writing to digital pins
- Sending data to devices and receiving data form devices through the I2C Bus
For this project, I made some changes to the Firmata library to read DHT sensor data or any other sensor.
3 Steps to Your Remote Arduino Project
- Download and Install Visual Studio 2015
- Set up the Arduino (It is pre-installed, unless you changed the Arduino program)
- Create a project or use the sample project
Download and Install Visual Studio 2015
In the first step, it is necessary to install Visual Studio on LattePanda. It is not installed by default.
- Enable developer mode on your operating system; for this purpose, go to Settings > Update & security > in For Developers section > Select Developer Mode
Set up the Arduino
- Download this file and open the file in Arduino. (This file replaces with StandardFirmata. Some changes have been done on this file)
- Add Adafruit DHT sensor library to Arduino.
- Select Arduino Leonardo from Board section. Then select correct COM port; finally, upload the sketch.
DHT Wiring
The aim of this project is to read temperature and humidity data by DHT11 sensor connected to LattePanda. So it is necessary that the DHT sensor is connected as in the following picture. I use the sensor DHT11, which can be used instead of DHT21 or DHT22.
Pinout :
DHT > LattePanda
Data > D7
VCC > 5V
GNG > GND
Read Temperature and Humidity
Download this file and open the file with Microsoft Visual Studio. Sign Up in Thingspeak and create New Channel with two fields (Field 1 for temperature and Field 2 for humidity). After Save Channel, in API Keys tab, copy Key value and paste in Program.cs file, instead of THINGSPEAK_KEY_HERE.
Save file and click Start Button. The output will be as shown below:
In the end, the data can be viewed on the Thingspeak server as shown below:
Resources
This project is made by Ramin Sangesari in Hackster.io.