Solenoide Arduino Santiapps

Arduino (IoT): Simple Tutorial Válvula Solenoide con un BJT

Tutorial Válvula Solenoide con un BJT En este tutorial continuamos aprendiendo sobre como controlar solenoides.  En el anterior lo hicimos via un FET pero esta vez lo hacemos via un BJT. Requisitos: Computadora (mac) Arduino UNO Válvula Solenoide de 12V TIP120 Transistor Diode 2 baterias de 9V Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Una válvula solenoide no es mas que una válvula controlada por un electromagnet, que es esencialmente un motor invertido.  Sabemos entonces que los motores generan contra corrientes.  Como podemos ver en el diagrama de arriba, debemos alimentar la válvula de una fuente y proteger el cerebro (Arduino) de las contra corrientes a través de un diodo. Al mismo tiempo debemos… Read More

Continue Reading
Controlling Motors Arduino Santiapps

Arduino (IoT): Simple Tutorial Motores DC & Servos

Tutorial Motores Ya sabemos controlar flujo de electricidad a luces.  Ahora lo vamos a hacer con motores.  Al igual que con luces hay algunos detalles importantes. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Motor DC & Servo Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Terminología Motor DC es un tipo de motor continuo.  Es decir que rota continuamente o infinitamente en la misma dirección. Motor Servo es un tipo de motor que gira o rota de manera escalonada dependiendo del valor eléctrico pasado al mismo. Comencemos sencillo.  Vamos a conectar primero 1 motor DC a la MEGA y usaremos el… Read More

Continue Reading
Arduino Tutorial Toy Car Santiapps Marcio Valenzuela

Arduino (IoT): Tutorial de Carro Juguete

Tutorial Juguete Hemos visto como controlar la electricidad. Requisitos: Un carro electrónico o a control remoto Un voltimetro o amperimetro (incluso puede ser un simple cable) En juguete electrónico como un carro de baterías no es mas que una tabla de circuitos integrados con una fuente de poder (las baterías AA tipicamente).  El programa para esa tarjeta ya esta cargado en la fabrica y lo único que hace ese programa es controlar el flujo eléctrico a los componentes del carro. Yo tengo a mi disponibilidad por los momentos este carro: Este por suerte es un carro sencillo porque no es a control remoto, solo tiene botones (3 color naranja en la… Read More

Continue Reading
Getting Started with LEDs Arduino Santiapps

Arduino (IoT): Simple Tutorial LED

Tutorial LED La idea es sencilla.  Usaremos código de computadora y un micro controlador (mcu) para controlar el flujo de electricidad.  En este tutorial aprenderemos como controlar el flujo de electricidad hacia una LED desde una micro controller board. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. LED Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) (Si solo quieren ir a ver como se conecta todo, vayan al MARCADOR) Terminología Breadboard es un tablero de filas y columnas de agujeros.  Esta matriz de agujeros se usa para interconectar componentes electricos sin usar soldadura. Arduino MEGA es una micro controller board, mcu.  Hay… Read More

Continue Reading
Creating Wearables with Attiny Arduino Santiapps

Arduino IoT: Tutorial Simple Programar ATtiny85

Tutorial Simple Programar ATtiny85   En algun momento llegaremos a querer reducir el tamaño de nuestros proyectos por ejemplo para “wearables”, proyectos usados como vestimenta por la gente. Aqui aprovechamos a programar la ATtiny85 via una Arduino UNO R3, aunque es posible obtener programadores standalone. Esta es la ATTiny85 comparada con la ATmel y la Arduino UNO R3: Como podemos ver, no solo en tamaño sino que en componentes, la ATtiny85 tendrá la ventaja de consumo energético ademas de espacio. Primero, tenemos que actualizar nuestro Arduino IDE para poder interface con una ATtiny85.  Esto lo hacemos en Preferences y Boards Manager: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json Segundo, debemos cargar el sketch de ArduinoISP en… Read More

Continue Reading
Sensores Industriales RTD Arduino Santiapps

Arduino IoT: RTD PT 100 Sensores Industriales Parte II

Arduino (IoT): RTD PT 100 Sensores Industriales Parte II   En el tutorial anterior vimos como obtener resultados de un sensor industrial, PT100.  3 puntos importantes a recalcar: PT100 es un sensor muy sensible.  De hecho PT100 viene de “Pt” el símbolo para platino, que es un elemento usado por su confiabilidad.  Su resistencia varia de manera constante y confiable a lo largo de un gran rango de temperaturas.  Es esta resistencia la que medimos para obtener nuestros datos. La resistencia del circuito esta ligada al Voltage pero los voltajes son muy sensibles a ruido y podríamos confundir ruido de las lineas de transmisión con mediciones reales.  Por tanto usamos la… Read More

Continue Reading
Bluetooth Smart Water Meter Arduino Santiapps

Arduino IoT: Tutorial Medidor de Agua Inteligente

Tutorial Medidor de Agua Inteligente Parte I   En este tutorial exploraremos mas sensores, pero aplicados.  En nuestro proyecto usamos un flujo metro construido a partir de un sensor Hall Effect para medir el flujo de agua por un conducto. Se mira asi: El codigo: byte statusLed = 13; byte sensorInterrupt = 0; // 0 = digital pin 2 byte sensorPin = 2; // El sensor hall-effect emite ~ 4.5 pulses/sec/litre/min float calibrationFactor = 4.5; volatile byte pulseCount; float flowRate; unsigned int flowMilliLitres; unsigned long totalMilliLitres; unsigned long oldTime; void setup(){ Serial.begin(38400); // Usarmos una LED como salida pinMode(statusLed, OUTPUT); digitalWrite(statusLed, HIGH); pinMode(sensorPin, INPUT); digitalWrite(sensorPin, HIGH); pulseCount = 0; flowRate… Read More

Continue Reading
Sensores Industriales RTD Arduino Santiapps

Arduino IoT: RTD PT 100 Sensores Industriales Parte I

Arduino (IoT): RTD PT 100 Sensores Industriales Parte I Setup: PT100 (blanco) ——–4/20mA (B) Resistor A0-Tierra es 237Ω Codigo: int sensorValue = 0; int temperature = 0; int ReceivedByte = 0; float f1 = 0; float t1 = 0; void setup() { Serial.begin(9600); Serial.println(“hi…”); } void loop() { delay(1000); sensorValue = analogRead(A2); //Serial.println(sensorValue); /** current voltage(250 Ohm) ADC Temperature —————————————————– 4 mA 1 V 205 -50 C 20 mA 5 V 1023 +150 C **/ // map the signals (multiplied by 10 // to get decimal values, because map() doesn’t work with floats) temperature=map(sensorValue,205,1023,-500,1500); f1 = temperature; // Float conversion t1 = f1/10.0; // dividing by 10 // with one decimal… Read More

Continue Reading
LM7805 Voltage Regulator Arduino Santiapps

Arduino IoT: Tutorial sobre LM7805 como fuente de poder

Arduino (IoT): Tutorial LM7805 como fuente de poder   Muchas veces terminamos un prototipo y queremos llevarlo a la practica.  Es decir, queremos hacerlo funcionar en el ambiente para el cual fue diseñado.  El ejemplo típico en robótica es un carro, que luego de subir el codigo desde la compu al carro y probarlo mientras sigue conectado a la compu, queremos llevarlo a la calle.  En el caso de este robot para remover semillas, queremos conectarlo a su fuente de poder (baterías recargables) y llevarlo a la practica. El problema es que necesitamos 5V para nuestros MCUs (a veces 3.3V) y tenemos combinaciones de baterías AA que nos dan 3V, 4.5V, 6V… Read More

Continue Reading
Electromagnetic Relay Arduino Santiapps

Arduino IoT: Simple Tutorial de Controlador Relay Remoto WiFi Parte 1

Arduino (IoT): Simple Tutorial de Controlador Relay Remoto WiFi Parte 1   Mucha gente me pide una manera de controlar remotamente un set de relays.  Asi que vamos a explorar el uso de una Arduino UNO + WiFi Shield.  Tenemos que correr un http server en la UNO (via la shield) para poder enviarle http requests a ese server con una IP fija en el router de Tigo que este ruteada a la IP fija interna de la UNO.  Esto requiere una UNO + WiFi shield + un router. Basicamente vamos a hacer que la IP de Tigo en nuestro router sea dirigida a la computadora que queremos, en este caso… Read More

Continue Reading
4WD Car Kit Arduino Santiapps Series

Arduino (IoT) Video Serie Completa: Kit de Carro 4×4

Arduino (IoT) Video Serie Completa: Kit de Carro 4×4 Aqui tenemos la serie completa del video tutorial del Carro Inteligente 4×4: Chassis: http://santiapps.com/?p=2348 Alambrado: http://santiapps.com/?p=2351 Código Básico: http://santiapps.com/?p=2353 Control IR: http://santiapps.com/?p=2379 Control BLE: http://santiapps.com/?p=2387 Auto-dirigido: http://santiapps.com/?p=2405&preview=true

Continue Reading
4WD Car Kit Arduino Santiapps Series

Arduino (IoT) Video Serie: Kit de Carro Parte 6 (Auto-Dirigido)

Arduino (IoT) Video Serie: Kit de Carro Parte 6 (Auto-Dirigido) Finalmente veremos como hacer un carro realmente inteligente.  Claro que hay mucho mas por hacer con un proyecto como este, pero espero que con este material tengan suficiente para poder arrancar.  Vamos a ver como agregar un sensor que le diga al carro que tan lejos esta de un obstáculo, hacer algunos cálculos para determinar cual es la mejor ruta a seguir y continuar.  Hay miles de maneras de hacer esto pero solo vamos a explorar una en detalle aqui y les dejare otra opción para su investigación [por ejemplo, agregar navegación GPS!]. Veamos las conexiones: Si han llegado hasta este… Read More

Continue Reading
Automatic Door Opener Arduino Santiapps

Arduino (IoT): Stepper para abrir puertas con L298N

Simple Tutorial Stepper Motor con L298N   Vamos a usar un stepper para abrir una puerta.  Idealmente usaríamos un mecanismo mas sofisticado como un brazo  tipo tijera para abrir una puerta, pero en este caso usamos un simple hilo para enrollarlo con un stepper. Requisitos: Computadora (mac) Arduino UNO o equivalente. L298N driver board Stepper 12V & 400mA bi-polar (30Ohm por fase) Battery pack de 6 batteries AA en serie 6 baterias AA Arduino IDE (https://www.arduino.cc/en/Main/Software) El H-bridge que usaremos es el siguiente.  Es capaz de suplir hasta 2A pero nuestro motor solo demandara 400mA: El motor es el siguiente: Hacemos nuestras conexiones así: El alambrado es basicamente asi: L298N——————————… Read More

Continue Reading
4WD Car Kit Arduino Santiapps Series

Arduino (IoT) Video Serie: Kit de Carro Parte 5 (BT)

Arduino (IoT) Video Serie: Kit de Carro Parte 5 (BT) En este caso usaremos un HM10, un modulo BLE (Bluetooth de baja energía) que es ideal para proyectos como este por su bajo consumo energético.  Antes de hacer funcionar el BLE, vamos a darle poder desde la Arduino 5V/GND para hacer parpadear la LED roja alrededor de 1 vez por segundo.  Esto significa que el BLE esta listo para conectarse.  Podemos verificar esto con un teléfono que tenga BLE y descubra el modulo, por lo general un Android es ideal o una laptop.  Para un iPhone es mejor usar una app como BLE Scanner u otras similares. Estos BLE pueden… Read More

Continue Reading
Infrared IR Sensors Arduino Santiapps

Arduino (IoT): Simple Tutorial de IR Receptor/Transmisor (Parte 3)

Arduino (IoT): Simple Tutorial de IR Receptor/Transmisor (Parte 3)   En la Parte 1 & 2 vimos como usar receptor y LED IR para leer controles y controlar LEDs de color. Ahora veremos como enviar nuestros propios códigos o señales IR desde un LED IR.  Es decir, en la primera parte solo usamos el receptor IR para recibir los códigos de un control remoto.  Ahora enviaremos esos códigos al dispositivo para controlarlo.   Conexiones   Nuestra conexión sera si: Aseguremos de conectar la LED correctamente con su pata al pin tierra y larga al resistor.   Codigo El codigo de nuestro ejemplo sera el IRrecord de la librería: [code] /* record.ino… Read More

Continue Reading
Infrared IR Sensors Arduino Santiapps

Arduino (IoT): Simple Tutorial de IR Receptor/Transmisor Parte 2

Arduino (IoT): Simple Tutorial de IR Receptor/Transmisor (Parte 2)   En la Parte 1 vimos como usar el receptor IR para leer códigos enviados por un control remote X.  Ahora veremos como controlar LEDs de colores.   Conexiones Si recuerdan de la primera parte, nuestro circuito era asi pero no usamos las LED: Ahora vamos a usar 3 LEDs y controlarlas desde nuestro mcu. Codigo La libreria que usaremos esta aqui. El codigo de nuestro ejemplo sera: #include <IRremote.h> int RECV_PIN = 3; // pin de salida del TSOP4838 int led1 = 2; int led2 = 4; int led3 = 7; int itsONled[] = {0,0,0,0}; /* al inicio las LEDs estan OFF (zero) #define… Read More

Continue Reading
4WD Car Kit Arduino Santiapps Series

Arduino (IoT) Video Serie: Kit de Carro Parte 4 (IR)

Arduino (IoT) Video Serie: Kit de Carro Parte 4 (IR) Este es el codigo final: #include “AFMotor.h” #include “IRremote.h” AF_DCMotor motor1(1, MOTOR12_64KHZ); // create motor #1, 64KHz pwm AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm AF_DCMotor motor3(3, MOTOR12_64KHZ); // create motor #2, 64KHz pwm AF_DCMotor motor4(4, MOTOR12_64KHZ); // create motor #2, 64KHz pwm int RECV_PIN = 10; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); // set up Serial library at 9600 bps Serial.println(“Motor test!”); irrecv.enableIRIn(); // Start the receiver motor1.setSpeed(200); // set the speed to 200/255 motor2.setSpeed(200); // set the speed to 200/255 motor3.setSpeed(200); // set the speed to 200/255 motor4.setSpeed(200); // set the speed to 200/255… Read More

Continue Reading
Infrared IR Sensors Arduino Santiapps

Arduino (IoT): Simple Tutorial de IR Receptor/Transmisor Parte 1

Arduino (IoT): Simple Tutorial de IR Receptor/Transmisor    IR es un tipo de comunicación que se utiliza en proyectos para controlar componentes.  Aquí hacemos un breve ejemplo de como usar un receptor.   Conexiones Codigo [code] #include <IRremote.h> int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup(){ Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } } [/code] Aqui vemos como el modulo receptor recibe las señales de un control remoto que tiene una LED IR adentro.  En el proximo tutorial veremos como usar la LED IR que viene con el Receptor IR, para armar nuestro propio… Read More

Continue Reading
4WD Car Kit Arduino Santiapps Series

Arduino (IoT) Video Serie: Kit de Carro Parte 3

Arduino IoT: Video tutorial Kit de Carro Parte 3 Este es el codigo final: #include <AFMotor.h> AF_DCMotor motor1(1, MOTOR12_64KHZ); // create motor #1, 64KHz pwm AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm AF_DCMotor motor3(3, MOTOR12_64KHZ); // create motor #2, 64KHz pwm AF_DCMotor motor4(4, MOTOR12_64KHZ); // create motor #2, 64KHz pwm void setup() { Serial.begin(9600); // set up Serial library at 9600 bps Serial.println(“Motor test!”); motor1.setSpeed(200); // set the speed to 200/255 motor2.setSpeed(200); // set the speed to 200/255 motor3.setSpeed(200); // set the speed to 200/255 motor4.setSpeed(200); // set the speed to 200/255 } void loop() { motor1.run(FORWARD); // turn it on going forward delay(1000); motor1.run(BACKWARD); // the other… Read More

Continue Reading
Hacking Electronics Arduino Santiapps

IoT Arduino-Raspberry Pi Hackeando una TSRB430 BLE Relay Board P3

  Continuamos haciendo la TSRB430 BLE pero ahora desde una Raspberry Pi 🙂   Requisitos RPi2 Modulo Serial HM10 BLE TSRB430 Relay Board Raspberry Pi2 Code [code]</pre> <pre>#!/usr/bin/env python import serial def convert_hex_to_int(hexChars): #convert string of hex chars to a list of ints try: ints = [ord(char) for char in hexChars] return ints except TypeError: pass return [] def convert_hex_to_bin_str(hexChars): #convert hex char into byte string response = convert_hex_to_int(hexChars)[0] # convert int to binary string responseBinary = bin(response) # first 2 chars of binary string are ‘0b’ so ignore these return responseBinary[2:] ser = serial.Serial( port=’/dev/serial0′, baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=1 ) print “Serial esta abierto: ” + str(ser.isOpen()) print “Escribiendo…”… Read More

Continue Reading
4WD Car Kit Arduino Santiapps Series

Arduino (IoT) Video Serie: Kit de Carro Parte 1

Arduino IoT: Video tutorial Kit de Carro Parte 1 En nuestra video serie atravesaremos varias partes sobre como armar y programar un Kit de Carro 4WD.  Aprenderemos sobre armar el chassis, alambrar los componentes, programar el código y luego agregar componentes como IR y BT para controlar el carro hasta eventualmente llegar a programar un carro auto-dirigido. Acompañenos en esta primera instalación de nuestro Kit de Carro 4WD.

Continue Reading
Hacking Electronics Arduino Santiapps

IoT Arduino-Raspberry Pi Hackeando una TSRB430 BLE Relay Board P2

  Continuamos haciendo la TSRB430 BLE pero ahora desde una Raspberry Pi 🙂 Primero instalar ssh y automatizar con: sudo /etc/init.d/ssh start y luego con: boot_enable_ssh.rc renombrar a boot.rc luego instalar vncserver con: sudo apt-get install tightvncserver luego correr vmc server: vncserver :1 -geometry 1280×800 -depth 16 -pixelformat rgb565 Acceder al ble uart del rpi para detectar tsrb430: PL2032 – AT+ADDR? 74DAEAB314A5 AT+CONNL pasando el codigo a un py script: PRIMERO SCRIPT PARA CONNL import serial ser = serial.Serial( port=’/dev/serial0′, baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=1 ) print “Serial esta abierto: ” + str(ser.isOpen()) print “Escribiendo…” #ser.write(“o”) ser.write(“AT+CONNL”) print “Escrito!  Ahora leamos…” AHORA LA CORREMOS… pi@raspberrypi:~/Documents/python $ python togglerelay.py Serial esta abierto: True Escribiendo… Escrito!… Read More

Continue Reading
Hacking Electronics Arduino Santiapps

IoT Arduino-Raspberry Pi Hackeando una TSRB430 BLE Relay Board P1

  En realidad vamos a usar los comandos especificados por el fabricante, asi que técnicamente no es hacking, pero suficiente cerca 🙂 Requisitos Arduino MCU Modulo Serial HM10 BLE TSRB430 Relay Board Arduino Code [code] #include <SoftwareSerial.h> int bluetoothTx = 10; // TX-O pin of bluetooth int bluetoothRx = 11; // RX-I pin of bluetooth SoftwareSerial bluetooth(bluetoothTx, bluetoothRx); void setup(){ Serial.begin(9600); // Begin the serial monitor at 9600bps delay(200); // Short delay, wait for the Mate to send back CMD bluetooth.begin(9600); // Start bluetooth serial at 9600 Serial.print(“send…”); // bluetooth.print(“AT”); //bluetooth.print(“e”); //open relay 1 //delay(2000); //bluetooth.print(“o”); //close relay 1 } void loop(){ if(bluetooth.available()){ Serial.print((char)bluetooth.read()); } if(Serial.available()){ bluetooth.print((char)Serial.read()); } } void… Read More

Continue Reading
Neural Networks Artificial Intelligence Arduino Santiapps

IoT: Intro a Raspberry Pi 2 – Bt Serial Uart HM10-HM12 Relay Board for AI

Para trabajar con RPi es necesario instalar todo primero y hacer las conexiones.  Para nuestros proyectos de RPi con BLE Serial por ejemplo, seguimos las siguientes instrucciones y conexiones: Conexion de BLE Serial al RPi: Rx-Tx-3.3V-GND Configuracion de Linux en RPi: Linux sudo shutdown -h now sudo ssh service start sudo inserv Configuracion del Rasbian Jessie enable_uart=1 in /etc/inittab remove console in /boot/cmdline.txt set IMME to 1 on hmsoft       Codigo Python para script simple: [code]#!/usr/bin/env python import serial ser = serial.Serial( port=’/dev/serial0′, baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=1 ) print “Serial esta abierto: ” + str(ser.isOpen()) print “Escribiendo…” ser.write(“AT”) print “Escrito! Ahora leamos” x = ser.readline() print “got… Read More

Continue Reading
Neural Networks Artificial Intelligence Arduino Santiapps

Internet Of Things (IoT): Inteligencia Artificial via Neural Networks Parte 1

Para que se usa? Para modelar el comportamiento complejo en el pasado y usar el modelo para pronosticar el futuro comportamiento. Ejemplo: Un cliente con ciertas características (compras mensuales, compras por categoría histórica) cuanto nos comprara en los siguientes meses? Ejemplo: Una imagen leída por una computadora con ciertas características (lineas horizontales, diagonales, colores, etc) es una persona o un objeto? Como funciona? Todo sistema bajo estudio (imagen, comportamiento de compra) tiene una capa de ingreso de información en la izquierda llamados inputs, capas ocultas y una capa final de resultados: Una neural network o red neural tiene 3 capas: Capa Input (ingreso o variables conocidas) Capa Oculta (interacciones entre… Read More

Continue Reading
Measuring Current Consumption Arduino Santiapps

Arduino (IoT): Simple Tutorial Medición de Corriente UNO vs NANO

Tutorial Medición de Corriente UNO vs Nano En un tutorial anterior vimos como medir la corriente de un MCU, en ese caso una Tosduino UNO.  El consumo era de 46.5mA mientras esta activa.  Luego la pusimos a dormir mediante un sketch y el consumo bajó a 33.3mA. En este caso lo comparamos con el consumo de una Tosduino Nano (equivalente a una Arduino Nano) y el consumo es de 28.1mA y baja a 21.1mA mientras duerme. Aquí podemos ver las imágenes de la diferencia en consumo entre la UNO utilizada arriba (anteriormente) versus la Nano: Ahora veamos al poner la Nano en Idle Sleep Mode:  

Continue Reading
Advanced Night Light Arduino Santiapps

Arduino (IoT): Simple Tutorial Proyecto Iluminación Nocturna v2

Tutorial Proyecto Iluminación Nocturna v2 En un tutorial anterior vimos el proyecto de iluminación nocturna y si medimos su consumo con una Nano, vemos que el consumo es de 28.8mA.  Si un día tiene 24 horas estamos hablando de 28.8mA x 24hrs = 691mAh.  Una paquete de baterías 1.5V en serie tienen una capacidad de alrededor de 2500mAh.  Esto significa que nuestro proyecto podría operar durante 2500/691 = 3.6 días. Hay mucho que se puede hacer para reducir el consumo energético de la MCU.  Como vimos podíamos reducir su consumo a 21.1mA en Sleep Mode pero aun así estamos hablando de 4.9 días de operación.  Como es posible que los… Read More

Continue Reading
Php Interface Arduino Santiapps

Arduino (IoT): Simple Tutorial Arduino PHP Web JSON/XML

Tutorial Arduino PHP Web JSON/XML En este tutorial aprendemos a interfaz entre servicios web como openweather.org y lenguajes como PHP para parse JSON o XML y alimentar la Arduino. Requisitos: Computadora (mac) Arduino UNO Servidor Linux/PHP Arduino IDE (https://www.arduino.cc/en/Main/Software) OpenWeather: http://api.openweathermap.org/data/2.5/weather?q=Amsterdam,NL&units=metric&appid=suID Resultado: {“coord”:{“lon”:4.89,”lat”:52.37},”weather”:[{“id”:801,”main”:”Clouds”,”description”:”few clouds”,”icon”:”02d”}],”base”:”cmc stations”,”main”:{“temp”:24.17,”pressure”:1013.79,”humidity”:39,”temp_min”:24.17,”temp_max”:24.17,”sea_level”:1013.72,”grnd_level”:1013.79},”wind”:{“speed”:8.56,”deg”:79.5083},”clouds”:{“all”:12},”dt”:1463065042,”sys”:{“message”:0.0123,”country”:”NL”,”sunrise”:1463024893,”sunset”:1463081183},”id”:2759794,”name”:”Amsterdam”,”cod”:200} PHP: [/code] <?php // retrieve the current weather in Amsterdam in degrees Celcius $json = file_get_contents(‘http://api.openweathermap.org/data/2.5/weather?q=Amsterdam,NL&units=metric&appid=suID’); // parse the JSON $data = json_decode($json); // show the city (and the country) echo ‘<h1>’, $data->name, ‘ (‘, $data->sys->country, ‘)</h1>’; // the general information about the weather echo ‘<h2>Temperature:</h2>’; echo ‘<p><strong>Current:</strong> ‘, $data->main->temp, ‘&deg; C</p>’; echo ‘<p><strong>Min:</strong> ‘, $data->main->temp_min, ‘&deg; C</p>’; echo ‘<p><strong>Max:</strong> ‘, $data->main->temp_max, ‘&deg; C</p>’; // something… Read More

Continue Reading
Solenoide Arduino Santiapps

Arduino (IoT): Simple Tutorial Válvula Solenoide con MOSFET

Tutorial Válvula Solenoide con MOSFET En este tutorial introducimos otros switch digital basado en transistores, el MOSFET! Requisitos: Computadora (mac) Arduino UNO Válvula Solenoide de 12V MOSFET IRLB-8721 Diode Batería 12VDC Lead-Acid (de algún UPS) Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Una válvula solenoide no es mas que una válvula controlada por un electromagnet, que es esencialmente un motor invertido.  Sabemos entonces que los motores generan contra corrientes.  Como podemos ver en el diagrama de arriba, debemos alimentar la válvula de una fuente y proteger el cerebro (Arduino) de las contra corrientes a través de un diodo. Entra el MOSFET!  Este dispositivo es muy similar a un transistor BJT como el TIP-120, pero… Read More

Continue Reading
Diodes, Transistors, BJTs, Mosfets Arduino Santiapps

Arduino (IoT): Simple Tutorial de Transistores BJT, JFET & MOSFET

Tutorial de Transistores BJT, JFET & MOSFET En este tutorial hacemos un alto en el camino y repasamos un poco de teoría para entender PN-Junctions, Diodes, BJTs, JFETs y MOSFETs. Requisitos: Computadora (mac) Arduino UNO Válvula Solenoide de 12V TIP120 Transistor, Diode N4148, MOSFET IRLB8721 2 baterias de 9V Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software)   Primero entendamos que es un PN-Junction: Una PN junction se forma al unir 2 semiconductores de distinta composición llamados n-type y p-type.  El n-type tiene mas electrones lo cual atrae hoyos positivos de la p-type.  La p-type tiene mas hoyos positivos lo cual atrae electrones de la n-type.  Esto crea una banda donde no hay flujo eléctrico después… Read More

Continue Reading
Diodes, Transistors, BJTs, Mosfets Arduino Santiapps

Arduino (IoT): Simple Tutorial de PNJ & Diodes

Tutorial de PNJ & Diodes En este tutorial exploramos la base de BJTs y FETs. Vimos que es un PN-Junction: Una PN junction se forma al unir 2 semiconductores de distinta composición llamados n-type y p-type.  El n-type tiene mas electrones lo cual atrae hoyos positivos de la p-type.  La p-type tiene mas hoyos positivos lo cual atrae electrones de la n-type.  Esto crea una banda donde no hay flujo eléctrico después de alcanzar este equilibrio debido a que los electrones negativos del n-type quedan bloqueados por la carga positiva de la banda (pn-junction) y vv al otro lado.  Esto es algo muy deseable como veremos. Aquí podemos ver en la izquierda como… Read More

Continue Reading
Biometric Fingerprint Reader Arduino Santiapps

Arduino (IoT): Simple Tutorial Seguridad Biometrica Huella Digital 3/3

Tutorial Seguridad Biometrica Huella Digital En este tutorial usamos un modulo biometrico de huella digital para brindar seguridad a nuestros proyectos.   Requisitos: Computadora (mac) Arduino UNO FPS GT511-c1R FPS Resistores Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El setup continua igual.  Ahora cambiamos el codigo para comparar las huellas digitales en el modulo. El código: [code]</pre> <pre>#include “FPS_GT511C3.h” #include “SoftwareSerial.h” //FPS connected to pin 4 and 5 – see previous schemas FPS_GT511C3 fps(4, 5); void setup(){ Serial.begin(9600); delay(100); fps.Open(); fps.SetLED(true); } void loop(){ // if a finger is on the sensor if (fps.IsPressFinger()){ //capture the finger print fps.CaptureFinger(false); //get the id int id = fps.Identify1_N(); //maximun finger print stored in 200. //Id > 200… Read More

Continue Reading
Biometric Fingerprint Reader Arduino Santiapps

Arduino (IoT): Simple Tutorial Seguridad Biometrica Huella Digital 2/3

Tutorial Seguridad Biometrica Huella Digital En este tutorial usamos un modulo biometrico de huella digital para brindar seguridad a nuestros proyectos. Requisitos: Computadora (mac) Arduino UNO FPS GT511-c1R FPS Resistores Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El setup continua igual.  Ahora cambiamos el codigo para registrar huellas digitales en el modulo. El código: [code]#include “FPS_GT511C3.h” #include “SoftwareSerial.h” //FPS connected to pin 4 and 5 – see previous schemas FPS_GT511C3 fps(4, 5); void setup(){ Serial.begin(9600); //display messages on the classical serial teminal – DEBUG fps.UseSerialDebug = true; Serial.println(“before open”); fps.Open(); //call Enroll to add fingerprint Serial.println(“before enroll”); enroll(); } void enroll(){ // get the first available id for new finger print int enrollid =… Read More

Continue Reading
Biometric Fingerprint Reader Arduino Santiapps

Arduino (IoT): Simple Tutorial Seguridad Biometrica Huella Digital 1/3

Tutorial Seguridad Biometrica Huella Digital En este tutorial usamos modulo FPS para agregar seguridad biometrica a nuestros proyectos. Requisitos: Computadora (mac) Arduino UNO FPS GT511-c1R FPS Resistores Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El modulo requiere 3.3V y es por eso que usamos 2 resistores para crear un voltage divider para generar 3.3V de los 5V proveídos por la Arduino UNO, o se puede usar el pin de 3.3V. El setup se ve asi: Vamos a usar una library para facilitar el uso del modulo.  La podemos descargar aqui: https://github.com/sparkfun/Fingerprint_Scanner-TTL En el primer tutorial queremos simplemente saber si el modulo esta funcionando. El código: [code]#include “FPS_GT511C3.h” #include “SoftwareSerial.h” FPS_GT511C3 fps(4, 5); void setup(){ Serial.begin(9600);… Read More

Continue Reading
Coffee Warehouse Monitor Arduino Santiapps

Arduino (IoT): Proyecto Monitor Remoto de Temp y Humedad Cafe Honduras

Tutorial Monitor Remoto de Cafe En este proyecto construimos un monitor de temperatura y humedad para monitorear las condiciones en una bodega de cafe. Requisitos: Computadora (mac) Arduino Nano DHT11 Modulo SIM900 GSM Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código (SIM900NanoW_OLibrary): [code] #include <Time.h> #include <TimeLib.h> #include <SoftwareSerial.h> #include <TimeAlarms.h> #include <dht.h> dht DHT; #define DHT11_PIN 5 char number[]=”+504numero”; boolean started=false; SoftwareSerial sim900(9,10); void setup(){ Serial.begin(9600); Alarm.timerRepeat(21600, MainAlarm); //21600s/60s/m=360m } void loop(){ Alarm.delay(10); // wait one second between clock display } void MainAlarm(){ Serial.println(“Main Alarm…”); int chk = DHT.read11(DHT11_PIN); Serial.print(“Temperature = “); double temp = DHT.temperature; Serial.println(DHT.temperature); Serial.print(“Humidity = “); double hum = DHT.humidity; Serial.println(DHT.humidity); sendData(temp,hum); } void sendData(double temp, double hum){ sim900.begin(9600);… Read More

Continue Reading
Voltmeter Arduino Santiapps

Arduino (IoT): Simple Tutorial para Medir Voltaje con Arduino

Tutorial de Medición de Voltaje En este tutorial usamos una Arduino para medir voltaje. Requisitos: Computadora (mac) Arduino Nano LCD 16×02 Potenciometro Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código incorpora lo que vimos para mostrar información en una pantalla LCD 16×2 y el uso de resistencias para dividir el voltaje a ser medido para que la Arduino no se dañe.  El código es así: [code] #include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Pines de data de LCD float vin=0.0; float temp=0.0; float r1=100000.0; // Resistor 1 float r2=10000.0; // Resistor 2 void setup() { Serial.begin(9600); lcd.begin(16, 2); // Cols y filas del lcd lcd.print(“Santiapps”); // Imprimir saludo. delay(1000); lcd.clear(); lcd.print(“DC… Read More

Continue Reading
GPS Arduino Santiapps

Arduino (IoT): Simple Tutorial GPS Top Titan 3 Glonass: Parte 2

Tutorial GPS Top Titan 3: Parte 2 En este tutorial recibiremos datos de un modulo GPS usando la library TinyGPS. Requisitos: Computadora (mac) Arduino MEGA Modulo Top Titan 3 GPS/Glonass Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) La conexión: GPS Pin 4 : 10 de la MEGA GPS Pin 3 : 11 de la MEGA GPS Pin 2 : GROUND de la MEGA GPS Pin 1 : 3.3V de la MEGA Ya conectado se mira asi: El código viene de una muestra en la TinyGPS llamada test_with_gps_device que se puede encontrar en File > Examples > TinyGPS > Examples > test_with_ps_device.: [code] #include <SoftwareSerial.h> #include <TinyGPS.h> TinyGPS gps; SoftwareSerial ss(10,11); //Rx from static void smartdelay(unsigned long ms); static void print_float(float val,… Read More

Continue Reading
AVR Sleep Mode Arduino Santiapps

Arduino (IoT): Simple Tutorial Medición de Corriente Sleep Mode AVR

Tutorial Medición de Corriente Sleep Mode AVR En  un tutorial anterior vimos como medir la corriente consumida por la MCU.  El mismo método puede ser utilizado para medir el consumo de corriente de un proyecto completo, al insertar el medidor entre la fuente de poder.  Antes de llegar a ese ejemplo, el cual nos ayudara a medir el consumo energético de un proyecto para poder hacer cálculos de autonomía (por ejemplo cuanta energía tendríamos que producir y almacenar para un proyecto solar por ejemplo), vamos a ver como podemos ahorrar energía poniendo nuestra Arduino a dormir. Requisitos: Computadora (mac) Arduino UNO Medidor de Voltaje/Corriente Battery Pack Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El… Read More

Continue Reading
GPS Arduino Santiapps

Arduino (IoT): Simple Tutorial GPS Top Titan 3 Glonass: Parte 1

  Tutorial GPS Top Titan 3: Parte 1 En este tutorial recibiremos datos de un modulo GPS. Requisitos: Computadora (mac) Arduino UNO o MEGA Modulo Top Titan 3 GPS/Glonass Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) La conexión: GPS Pin 4 : Rx de la UNO (o 11 en la MEGA) GPS Pin 2 : GROUND de la UNO o MEGA GPS Pin 1 : 3.3V de la UNO o MEGA NOTA: La MEGA puede usar 19/18 como Rx/Tx para hardware serial o 11/10 para software serial como en la Parte 2 de este tutorial. Ya conectado se mira asi: El código: [code] void setup() { Serial.begin(9600); pinMode(9,OUTPUT); } void loop() { delay(2000); digitalWrite(9,HIGH); delay(2000);… Read More

Continue Reading
Android Arduino App

Arduino (IoT): Simple Tutorial Arduino Android App: Parte III

Arduino Android App: Parte III Una pequeña distracción de nuestra serie Android App para Arduino para explorar appInventor2! Requisitos: Computadora (mac) Arduino UNO Arduino IDE HC05 LED & Resistor 220O Cuenta gratis en ai2.appinventor.mit.edu Ahora vamos a crear una aplicación para Android pero usaremos una aplicación web llamada appinventor de MIT. Visita ai2.appinventor.mit.edu y crea tu cuenta (anexala a tu cuenta de gmail) y podrás usar la app en linea.  Debes crear la aplicación en 2 formas: 1  Designer 2 Blocks La primera etapa de Designer es para el diseño de la app, el User Interface o UI: Aquí vemos un Palette (como el de Eclipse o Android Studio) con… Read More

Continue Reading
LM7805 Voltage Regulator Arduino Santiapps

Arduino (IoT): Fuentes de Poder en Robótica: Parte II

Fuentes de Poder en Robótica: Parte II Ahora veamos como calcular necesidades según los motores a emplear y los proyectos a desarrollar. El blog de Vishnu respecto a este tema esta aquí: Select the Right Battery for your Robot DC Motors – Part 2 of 2 … Para mas información sobre steppers específicamente, ver: http://www.geckodrive.com/support.html SOLAR   Calcular consumo del proyecto Calcular capacidad de almacenamiento Calcular capacidad de producción energética … En la próxima sección de Fuentes de Poder hacemos referencia al uso de AVR y maneras de hacer mas energéticamente eficientes nuestros proyectos.

Continue Reading
Measuring Current Consumption Arduino Santiapps

Arduino (IoT): Simple Tutorial Medición de Corriente

Tutorial Medición de Corriente En  proyectos mas avanzados vamos a querer medir la corriente para conocer el consumo energético de nuestros proyectos.  Así podemos presupuestar cuanta energía ocupamos almacenar-producir para manejar proyectos autónomos. Requisitos: Computadora (mac) Arduino UNO Medidor de Voltaje/Corriente Battery Pack Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Este tutorial no requiere código.  Simplemente vamos a operar la Arduino por medio de una fuente de poder (battery pack) y vamos a ‘insertar’ el medidor en el circuito para medir el flujo de corriente. EL MEDIDOR Normalmente los cables del medidor se conectan así: Rojo: A la terminal de VΩ10mA Negro: A la terminal COM Con esto típicamente medimos voltaje y/o continuidad.… Read More

Continue Reading
Android Arduino App

Arduino (IoT): Simple Tutorial Arduino Android App: Parte II

Arduino Android App: Parte II Ya vimos como conectarnos a dispositivos BT.  Ahora veamos como comunicarnos con esos dispositivos! Requisitos: Computadora (mac) Arduino UNO Arduino IDE Modulo Bluetooth HC-05 LED & Resistor 220O Android Studio (http://developer.android.com/sdk/installing/index.html?pkg=studio)   Ahora vamos a crear una aplicación para Android y un sketch para Arduino y hacer que se comuniquen de forma sencilla para controlar una LED. Iniciemos con la Arduino Sketch: [code] #include <SoftwareSerial.h> SoftwareSerial mySerial(6, 5); int dataFromBT; void setup() { Serial.begin(57600); Serial.println(“LEDOnOff Starting…”); // The data rate for the SoftwareSerial port needs to // match the data rate for your bluetooth board. mySerial.begin(115200); pinMode(13, OUTPUT); } void loop() { if (mySerial.available()) dataFromBT… Read More

Continue Reading
RFID Arduino Santiapps

Arduino (IoT): Simple Tutorial RFID & NFC

Tutorial RFID & NFC En este tutorial aprenderemos sobre el uso de NFC para leer tags RFID. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino).  Este tutorial en particular usa una Arduino MEGA. NFC Shield RFID modulo (tags, cards o capsules) Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software)   Las comunicaciones siempre se han caracterizado por ser tele, ósea de lejos.  Entre ciudades, entre países, entre continentes.  Ahora las comunicaciones de corta distancia han tomado relevancia, WiFi, BT y ahora NFC para lectura de tags RFID.  Aquí veremos como leer tags RFID con una shield NFC para Arduino Los tags pueden ser de tipo llavero, que son comúnmente utilizados para controlar acceso: También pueden… Read More

Continue Reading
Arduino Autonomous Rover Technology Santiapps

Arduino (IoT): Fuentes de Poder en Robótica: Parte I

Fuentes de Poder en Robótica: Parte I En robótica las fuentes de poder se tornan importante.  Si pensamos en el típico escenario de electrónica, lo que se refiere a lógica digital, o sea la operación de circuitos de lógica digital como celulares o micro-controladores solo operan con 5V a veces menos.  Por ejemplo, cuando carga su teléfono celular, lo esta conectando a una fuente de poder en su pared que suple 110-120V, sin embargo un transformador en el cargador de celular convierte ese voltaje hacia abajo, a 5V.  Sin embargo los motores, DC, Servo, Steppers y otros mas sofisticados, suelen requerir una potencia mayor debido a que tienen un requerimiento… Read More

Continue Reading
Android Arduino App

Arduino (IoT): Simple Tutorial Arduino Android App: Parte I

Arduino Android App: Parte I Muchos solicitan poder programar para Android y poder interactuar con Arduino.  Se puede con iOS y es donde tengo mas experiencia pero debo reconocer, BT de iOS SUCKS!  Así que enfoquemos esfuerzos en Android. Requisitos: Computadora (mac) Modulo HC-05 Android Studio (http://developer.android.com/sdk/installing/index.html?pkg=studio) Para comunicarnos con BT de Arduino ocupamos el Adapter: private BluetoothAdapter BA; BA = BluetoothAdapter.getDefaultAdapter(); y para usarlo debemos usar un Intent asi: Intent turnOn = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(turnOn, 0); Una vez conectados usamos los dispositivos así: private Set<BluetoothDevice>pairedDevices; pairedDevices = BA.getBondedDevices();   En lugar de pegar el código descarguemos el proyecto.  Es necesario descargar Android Studio (y JDK7) y configurar AS usando… Read More

Continue Reading
iPhone App Arduino Santiapps

Arduino (IoT): Simple Tutorial iOS & Bluno Nano

Tutorial iOS & Bluno Nano En este tutorial aprenderemos sobre la Bluno Nano pero con iPhone/iOS. Requisitos: Computadora (mac) iPhone con iOS7+ Xcode Bluno nano Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software)   Queremos ver como comunicarnos via BT usando la bluno nano. Arduino… [code] void setup() { Serial.begin(115200);  //initial the Serial } void loop() { if (Serial.available())  { Serial.write(Serial.read());//send what has been received Serial.println();   //print line feed character } }[/code] Android…  BlunoDemoiOS.zip …

Continue Reading
Arduino Autonomous Rover Technology Santiapps

Arduino (IoT): Simple Tutorial Stepper Motor con L293Dx2 Motor Shield

Simple Tutorial Stepper Motor con L293D Motor Shield   Ya hemos manejado un stepper con el H-bridge L298N pero hay otras opciones de H-bridge.  En este caso usamos la L293D motor shield.  Esta es un motor shield que nos permite controlar varios motores a la vez; steppers, DC y servos. Es importante ver las especificaciones de cada shield ya que hay muchas y todas se parecen!  En este caso la hoja técnica específica que provee hasta 600mA por canal.  Usaremos nuevamente la fuente de 9V para suplir el motor shield.   Requisitos: Computadora (mac) Arduino UNO o equivalente. L293D motor shield Stepper 12V & 400mA bi-polar (30Ohm por fase) Battery… Read More

Continue Reading
Motor Air Bluetooth Motor Driver Board Arduino Santiapps

Arduino (IoT): Simple Tutorial del MotorAir BT

Tutorial del MotorAir BT Hoy exploraremos un componente controlador via bluetooth llamado MotorAir! Requisitos: Computadora (mac) Arduino UNO o equivalente. MotorAir BT de 5V 2 Motores DC de 5VDC Arduino IDE (https://www.arduino.cc/en/Main/Software) La MotorAir es una board especializada que nos permite controlar motores via BT en este caso.  Los motores son componentes especiales debido a su naturaleza de operación.  Generan voltajes invertidos que pueden dañar otros componentes y también pueden requerir corrientes muy fuertes que pueden quemar los mismos motores! Las especificaciones dictan que el MotorAir requiere 5V para operar.  Los motores también requieren 5VDC, al menos los que usaremos en este tutorial. Aqui esta la MotorAir:   Excelente, esta board especializada… Read More

Continue Reading
Bluetooth Android Bluno Nano Arduino Santiapps

Arduino (IoT): Simple Tutorial Android & Bluno Nano

Tutorial Android & Bluno Nano En este tutorial aprenderemos sobre la Bluno Nano. Requisitos: Computadora (mac) Bluno nano Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software)   Queremos ver como comunicarnos via BT usando la bluno nano. Arduino… [code]void setup() { Serial.begin(115200);  //initial the Serial } void loop() { if (Serial.available())  { Serial.write(Serial.read());//send what has been received Serial.println();   //print line feed character } }[/code] Android… La aplicación Android se puede descargar aquí:  BlunoDemoAndroid.zip Usaremos esta aplicación para controlar un robot en una serie futura!

Continue Reading
Ballscrew Stepper Motor Control with L298N Arduino Santiapps

Arduino (IoT): Simple Tutorial Stepper con L298N Driver Board

Simple Tutorial Stepper Motor con L298N Eventualmente nuestros proyectos pueda que requieran dexteridad como la de un brazo robótico.  Para ello podemos hacer uso de un motor que sea mas preciso, mas responsive y mas fino en su movimiento.  Es decir, los motores DC son potentes pero no muy precisos para arrancar o detenerse en ciertas posiciones.  Los servos son precisos pero no tienen mucho torque y tardan en responder o cambiar de rumbo. En este tutorial exploramos los servos.  Los servos son interesantes porque nos permiten mover componentes revés y derecho como un brazo que sube y baja o una mano que abre y cierra.  También si lo combinamos… Read More

Continue Reading
GPS Arduino Santiapps

Arduino (IoT): Simple Tutorial GPS LS20031

Tutorial GPS LS20031 En este tutorial recibiremos datos de un modulo GPS. Requisitos: Computadora (mac) Arduino MEGA o UNO (el código cambia porque los Rx/Tx cambian) Modulo GPS LS20031 Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) La conexión: GPS Pin 5 (left-most when viewed from above) : No connection (or ground) GPS Pin 4 : to Arduino ground (GND) pin GPS Pin 3 : to Arduino pin 0 GPS Pin 2 : No connection GPS Pin 1 (right-most when viewed from above) : to Arduino 3.3V pin El código: [code] void setup() { Serial.begin(9600); Serial1.begin(9600); } void loop() { if (Serial1.available()) { int inByte = Serial1.read(); Serial.write(inByte); } } [/code]   En el monitor serial… Read More

Continue Reading
Advanced Night Light Arduino Santiapps

Arduino (IoT): Proyecto de Iluminación Nocturna

Proyecto de Iluminación Nocturna Nuestros robots ya pueden diferenciar entre noche y día.  Podemos usar esto a nuestra ventaja al combinarlo con detección de movimiento para controlar una luz. Requisitos: Computadora (mac) Arduino UNO o equivalente. Foto-transistor Detector de Movimiento PIR LED Resistor de 1kOhm Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Ya aprendimos a usar el detector de movimiento PIR.  Ahora combinemos el PIR con el sensor de iluminación para controlar una LED.  Hagamos las conexiones así: Ahora estudiemos el código, el cual es bastante sencillo por cierto.  Lo importante es la lógica: [code] //PIR int ledPin = 10; int pirPin = 9; int pirVal = 0; int photoTr = 0; //Timing parameters boolean… Read More

Continue Reading
iPhone App Arduino Santiapps

Arduino (IoT): Simple Tutorial iOS App

Arduino iOS App Ya vimos como conectarnos a dispositivos BT via Android.  No podríamos dejar por fuera al iOS. Requisitos: Computadora (mac) iPhone con iOS 7+ (BLE) Xcode Arduino UNO Arduino IDE HM10/11 LED & Resistor 220O Android Studio (http://developer.android.com/sdk/installing/index.html?pkg=studio) Ahora vamos a crear una aplicación para iOS y un sketch para Arduino y hacer que se comuniquen de forma sencilla para controlar una LED. Iniciemos con la Arduino Sketch para leer los datos: [code]//#include <SoftwareSerial.h> //SoftwareSerial mySerial(19,18); // RX, TX // Connect HM10 Arduino MEGA void setup() { Serial.begin(9600); // If the baudrate of the HM-10 module has been updated, // you may need to change 9600 by another value // Once… Read More

Continue Reading
Electromagnetic Relay Arduino Santiapps

Arduino (IoT): Simple Tutorial del LazyBone Bluetooth Relay Switch

Tutorial del LazyBone Bluetooth Relay Switch Hoy exploraremos un componente controlador via bluetooth llamado LazyBone! Requisitos: Computadora (mac) Arduino UNO o equivalente. Lazybones BT de 5V Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Las especificaciones dictan que el lazybone requiere 5V para operar y le podemos pasar voltajes de 5, 12, 24, 120 y 240 VAC con un máximo de 10 amperios.  El setup es sencillo:     La conexión es simplemente interrumpir el flujo en la linea viva o caliente a través del uso del switch.  Luego del otro lado del switch obtenemos el cable según el uso que le queremos dar, si normalmente abierto o cerrado el circuito. Por ejemplo; en… Read More

Continue Reading
Android Arduino App

Arduino (IoT): Simple Tutorial Android App: Parte V

Arduino Android App: Parte V Ya vimos como conectarnos a dispositivos BT.  Ahora veamos como comunicarnos con esos dispositivos! Requisitos: Computadora (mac) Arduino UNO Arduino IDE HM10/11 LED & Resistor 220O Android Studio (http://developer.android.com/sdk/installing/index.html?pkg=studio) Ahora vamos a crear una aplicación para Android y un sketch para Arduino y hacer que se comuniquen de forma sencilla para controlar una LED. Iniciemos con la Arduino Sketch para ArduDroid de Hakim Bitar: [code] /* PROJECT: ArduDroid PROGRAMMER: Hazim Bitar (techbitar at gmail dot com) DATE: Oct 31, 2013 FILE: ardudroid.ino LICENSE: Public domain */ #define START_CMD_CHAR ‘*’ #define END_CMD_CHAR ‘#’ #define DIV_CMD_CHAR ‘|’ #define CMD_DIGITALWRITE 10 #define CMD_ANALOGWRITE 11 #define CMD_TEXT 12 #define… Read More

Continue Reading
Light Sensor Detection Arduino Santiapps

Arduino (IoT): Simple Tutorial de Sensor de Iluminación

Tutorial Sensor de Iluminación En muchos casos queremos saber la iluminación disponible a nuestros robots.  Por ejemplo, a veces vamos a querer ejecutar ciertas acciones cuando hay poca luz, es decir que esta obscuro o de noche para encender luces o detectores.  Otras veces quizás necesitamos esperar a tener suficiente luz como para tomar fotos, cerrar cortinas o tomar una medición.  En este tutorial exploramos el uso de un sensor de luz o foto-transistor. Requisitos: Computadora (mac) Arduino UNO Resistor de 10kOhms Foto-transistor TEMT6000 Breadboard y Jumpers Arduino IDE (https://www.arduino.cc/en/Main/Software) Como un buen transistor, este sensor consiste de un Colector, un Emisor y una Base.  En el caso del foto-transistor, la Base… Read More

Continue Reading
TOSR08 Bluetooth Relay Santiapps

Arduino (IoT): Simple Tutorial del Bluetooth Relay TOSR08

Tutorial del Bluetooth Relay TOSR08 Hoy exploraremos un componente controlador via bluetooth llamado Bluetooth Relay TOSR08! Requisitos: Computadora (mac) Arduino UNO o equivalente. TOSR08 BT de 5V Arduino IDE (https://www.arduino.cc/en/Main/Software)   Las especificaciones del TOSR08 dictan que debe alimentarse de 5VDC.  Este modulo es capaz de manejar 8 canales separados de hasta 10A cada canal.  El relay se maneja via bluetooth o via cable USB desde una computadora. La opción de cable USB es sencilla, simplemente se conecta a su fuente de poder de 5VDC y a la computadora via un cable USB: Aquí se puede ver el conector Barrel Jack de centro positivo de 5VDC al costado izquierdo y del… Read More

Continue Reading

Arduino IoT: SPDT BLE Relay Control para Carro RC o Drone

Tutorial para operar un SPDT BLE Relay para un Carro RC o Drone Ya conocemos bien la Arduino (o RPi) que básicamente nos permiten. controlar componentes de manera digital o análoga.  Concocemos actuadores como servos, steppers, motores DC, válvulas solenoide y solenoids 5/2 para operar cilindros neumáticos y válvulas.  Ahora queremos controlar un actuador lineal, AL.  Un AL no es mas que un motor DC con engranajes que cambian la orientación del eje de movimiento conectando a un tornillo sin fin que mueve un eje horizontalmente: Dependiendo de la dirección de la corriente DC por sus 2 cables, el motor DC gira en una dirección u otra, contrayendo o retirando… Read More

Continue Reading
MQTT Automated Roller Curtain

Arduino (IoT): Tutorial de Control de Cortinas via MQTT

Tutorial Control de Cortinas via MQTT En el tutorial cortinas automatizadas veremos como controlar cortinas enrolables via un Arduino.  Vamos a introducir el concepto de MQTT, el cual nos permite comunicación corta y precisa a través de mensajes que normalmente se usa para este tipo de tareas.  También platicaremos un poco resumiendo los usos de distintos tipos de arduinos o MCUs en general para comenzar a automatizar la casa u oficina o negocio. Requisitos: Computadora (mac) Arduino UNO ESP8266 UART/TTL Wifi Shield Motor DC 30 RPM Driver Board L298N Impresora 3D como un servicio  Cortina enrolable Arduino IDE (https://www.arduino.cc/en/Main/Software)   La cortina que usamos en este tutorial es de este tipo:… Read More

Continue Reading
Android Arduino App

Arduino (IoT): Simple Tutorial Arduino Android App: Parte IV

Arduino Android App: Parte IV Ya vimos como conectarnos a dispositivos BT.  Ahora veamos como comunicarnos con esos dispositivos! Requisitos: Computadora (mac) Arduino UNO Arduino IDE HM10/11 LED & Resistor 220O Android Studio (http://developer.android.com/sdk/installing/index.html?pkg=studio)   Ahora vamos a crear una aplicación para Android y un sketch para Arduino y hacer que se comuniquen de forma sencilla para controlar una LED.   En el folder de la aplicación Android esta incluido el código del Arduino Sketch (ino). Veamos la Android App y entendamos que datos vamos a recibir primero para poder enviarlos desde nuestro Android.  La aplicación contiene 4 archivos .java: DeviceScanActivity DeviceControlActivity BluetoothLeServices SampleGATTAttributes Lo importante es conocer la estructura… Read More

Continue Reading
BPM Pulso Ox Sensor Santiapps

Arduino (IoT): Simple Tutorial de Sensor de Pulso

Tutorial Sensor de Pulso En este sensor exploraremos el mundo de la medicina donde la información es crítica, vital!  Empezaremos con el sensor de pulso. Requisitos: Computadora (mac) Arduino UNO Sensor Pulso Arduino IDE (https://www.arduino.cc/en/Main/Software)   Iniciamos con las conexiones del sensor, dependiendo de la versión están claramente etiquetadas como + para 5V, – para GND y S para señal.  Es un sensor análogo ya que toma mediciones de luz.  El sensor dispara una luz hacia la piel y dependiendo del flujo sanguíneo en ese momento (controlado por los latidos del corazón), la luz reflejada cambia y nos da una señal análoga del latido. Iniciemos descargando la el Playground para este sensor.  El… Read More

Continue Reading
UV Radiation Sensor Santiapps

Arduino (IoT): Simple Tutorial de Sensor de Radiación UV

Tutorial Sensor de Radiación UV Grove tiene una gran selección de sensores para distintas aplicaciones.  Ya vimos el sensor de CO2 en la Estación de Monitoreo Ambiental.  Ahora agregamos un sensor radiación UV para poder determinar la intensidad de la luz solar. Requisitos: Computadora (mac) Arduino UNO Sensor UV Grove Shield Arduino IDE (https://www.arduino.cc/en/Main/Software) La conexión a la Grove shield es igual que todos los conectores tipo Grove.  He allí el poder de Grove y la facilidad de crear un robot multisensorial usando una Grove Shield como interfaz. En este caso lo que tenemos que hacer es crear una linea base o baseline.  Esto se conoce como “Calibrar” el sensor porque vamos a tomar… Read More

Continue Reading
Acrylic Case Arduino Projects

Arduino (IoT): Simple Tutorial Air Quality Box Design

Tutorial Diseño de Contenedor Para la estación de Monitoreo de Calidad del Aire fue necesario diseñar un contenedor para la electrónica.  También haría falta hacer cambios mas profundos al diseño como reemplazar la Arduino UNO por una Nano o Micro que sea mas pequeña y por ende ocupe menos espacio y consuma menos energía, pero eso lo haremos en una próxima sesión.  Por ahora nos enfocamos en el diseño estructural del contenedor para la estación. Sencillamente usamos una lamina de acrílico para medir y construir las paredes para luego unirlas.  Básicamente el diseño era una pirámide rectangular en v1.0.  Para unir las paredes se uso sellador de silicone transparente  en medidas… Read More

Continue Reading
Nightlight Arduino Santiapps

Arduino (IoT): Simple Tutorial Luz Nocturna Portátil

Tutorial Luz Nocturna Portátil En este tutorial modificaremos nuestro proyecto de Iluminación Nocturna para poderlo operar de forma portátil. Requisitos: Computadora (mac) Tosduino Nano LED Blanca o de cualquier color Breadboard Detector de Iluminación Detector de Movimiento IR Arduino IDE (https://www.arduino.cc/en/Main/Software) Esta MCU es muy compacta e ideal para proyectos compactos.  En este caso vamos a armar un detector de movimiento nocturno para proveer iluminación.  Esto significa que ocupamos una MCU que controle la operación, operada por una fuente de energía portátil, como una batería en este caso.  Debido a que operara de una batería, necesitamos una MCU que consuma poca energía, como la Nano.  La MCU operara un detector de movimiento… Read More

Continue Reading
Gas Detection Santiapps

Arduino (IoT): Simple Tutorial de Sensor de Gas MQ2

Tutorial Sensor de Gas MQ2 Grove tiene una gran selección de sensores para distintas aplicaciones.  Ya vimos el sensor de CO2 en la Estación de Monitoreo Ambiental.  Ahora agregamos un sensor MQ2 que cubre un espectro de gases mas amplio. Requisitos: Computadora (mac) Arduino UNO Sensor M2 Grove Shield Arduino IDE (https://www.arduino.cc/en/Main/Software) La conexión a la Grove shield es muy sencilla.  He allí el poder de Grove y la facilidad de crear un robot multisensorial usando una Grove Shield como interfaz. En este caso lo que tenemos que hacer es crear una linea base o baseline.  Esto se conoce como “Calibrar” el sensor porque vamos a tomar una muestra de lo… Read More

Continue Reading
Arduino Simple Tutorial CO2 Sensor Santiapps Marcio Valenzuela

Arduino (IoT): Simple Tutorial Estación Ambiental Parte II

Tutorial Estación Ambiental: Parte II (CO2) Antes de poder darle autonomía a nuestro robot, queremos que nos recopile 1 dato mas, el del sensor de CO2.  Ya vimos como funciona el sensor CO2 y tenemos su código.  Aprovecharemos para aprender a incorporar un archivo .ino de un proyecto a otro para poder ejecutar código de otro proyecto. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Wifi Shield & WiFi Library Grove Shield con Sensor CO2 y/o Dust Sensor Servidor PHP (hay servicios gratuitos de php por ejemplo: http://www.000webhost.com/) o Parse.com Arduino IDE (https://www.arduino.cc/en/Main/Software) En el tutorial Sensores Avanzados vimos… Read More

Continue Reading
iOS 8 HealthKit Santiapps Marcio Valenzuela

Saving HealthKit Data & Closures

This code bit saves: healthKitStore.saveObject(bmiSample, withCompletion: { (success, error) -> Void in if( error != nil ) { println(“Error saving BMI sample: \(error.localizedDescription)”) } else { println(“BMI sample saved successfully!”) } }) The method signature is: saveObject(object: HKObject!, withCompletion completion: ((Bool, NSError!) -> Void)!) This method takes an HKObject which is bmiSample and it takes a completion closure which itself takes a bool & error and returns void. So in our method call, we pass in the bmiSample as the HKObject and for the success and error completion block we say: if error is NOT nil then log that error’s description, else log that the bmiSample was saved successfully.  … Read More

Continue Reading
Buttons and Potentiometers Santiapps

Arduino (IoT): Tutorial de Potenciómetros y Botones

Tutorial Pots & Botones Ya sabemos escribir electricidad a un pin.  Ahora vamos a aprender a leer la electricidad de un pin.  Aprenderemos la diferencia entre un pin análogo vs digital.  Finalmente afinaremos nuestro control de la electricidad usando botones y potenciómetros. Requisitos: Computadora (mac) Arduino MEGA u otra. LED Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Potenciómetro Botones Componentes Pot (azul en esquina superior derecha) es un dial mecánico que permite el flujo de electricidad a través del mismo pero con variable resistencia al flujo.  Es decir, en un extremo la electricidad fluye con facilidad mientras que en el otro extremo la misma fluye con mucha resistencia. Boton (negro en equina inferior derecha) es… Read More

Continue Reading
Data Communication Technologies Santiapps

Arduino Communication Technologies (Bluetooth, GSM/GPRS & WiFi)

Arduino Comm Technologies Im using a Sim900 module I got from SainSmart.  It basically looks like this: Its important to understand something in Arduino-world! Arduino is a brand and as such, it makes branded products.  But there are a bunch of other companies that do similar things.  The same way you can get an arduino-like board from a bunch of other manufacturers, you can also get a bunch of add-on modules or shields from other manufacturers as well. In my case, I have an original Arduino UNO/MEGA board: But I decided to go with a cheaper, TinySine WiFi shield.  That TinySine WiFi shield has a WiFiBee module on top of… Read More

Continue Reading
Voice Recognition Technology Santiapps

Arduino (IoT): Simple Tutorial Reconocimiento de Voz (Geeetech)

Tutorial Reconocimiento de Voz – Geetech Otro módulo de reconocimiento de voz por Geeetech.com Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Geeetech Module Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código esta aqui: [code] int redPin = 9; int yellowPin = 10; int whitePin = 11; int greenPin = 12; // Send 0xaa11 to store red, yellow, green, on, off // Send 0xAA21 to import to group 1 byte com = 0; //reply from voice recognition void setup() { Serial.begin(9600); pinMode(redPin, OUTPUT); pinMode(yellowPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(whitePin, OUTPUT); delay(2000); Serial.write(0xAA); Serial.write(0x37); delay(1000); Serial.write(0xAA); Serial.write(0x21); } void loop(){ while(Serial.available()){ com… Read More

Continue Reading
Sim900 Debugging Testing Module Arduino Santiapps

Web Client to post/get data to web with Arduino via SIM900 module

This is actually my work log on Arduino & SIM900 GSM/GPRS module. I’m starting off from here: https://github.com/MarcoMartines/GSM-GPRS-GPS-Shield/blob/GSMSHIELD/examples/GSM_GPRSLibrary_Client/GSM_GPRSLibrary_Client.ino But Im getting this error: status=READY ATT: ERROR RIC: ERROR DB:STARTING NEW CONNECTION ATT: SHUT OK RIC: SHUT OK DB:SHUTTED OK status=ERROR ==> Not connecting to apn for some reason. DB:NOT CONN ATT: OK RIC: ERROR DB:NOT CONN Number of data received: 0 Data received: This was quickly solved by increasing the timeout value in the inetGSM library file from 500 to 10000 ms. Now the error is: GSM Shield testing. DB:ELSE DB:CORRECT BR RIC: ATE0 ATT: +CPMS: +CPMS: 28,190,28,190,28,190 ATT: SHUT OK status=READY DB:STARTING NEW CONNECTION DB:SHUTTED OK DB:APN OK DB:CONNECTION OK… Read More

Continue Reading
Arduino Autonomous Rover Technology Santiapps

Arduino (IoT): Simple Tutorial Robot Autónomo Parte III

Tutorial Robot Autónomo: Parte III Este sketch es un poco mas fácil de entender y no utiliza un motor shield si ese es tu caso. Requisitos: Computadora (mac) Arduino UNO. Llantas (2) Motores DC (2) Sensor Ultrasonico Mini Servo Arduino IDE (https://www.arduino.cc/en/Main/Software)   Componentes La única diferencia es que no usa el motor shield o sea que los motores se conectan directamente a la UNO.  Veamos el código: #include <Servo.h> #include <NewPing.h> //CONSTANTES #define LeftMotorForward 2 #define LeftMotorBackward 3 #define RightMotorForward 5 #define RightMotorBackward 4 #define USTrigger 8 #define USEcho 9 #define MaxDistance 100 #define LED 13 Servo servo; NewPing sonar(USTrigger, USEcho, MaxDistance); //VARIABLES unsigned int duration; unsigned int distance; unsigned int FrontDistance; unsigned int LeftDistance; unsigned int RightDistance; unsigned int Time; unsigned int CollisionCounter; void setup() {   Serial.begin(9600);… Read More

Continue Reading
Arduino Engineering

Arduino

So the perfect evolution from mobile device programming is arduino/microcontroller programming. It’s basically moving from controlling software to controlling hardware.  Ever feel like coding apps is cool but you wish they could actually move things? I started off with a basic arduino kit with motors and leds. Of course I started out with the: – LED blink (on-board) – LED blink with breadboard I went a little crazy and my head overflowed with ideas for projects.  I even made Arduino Pancakes!  Very tough btw.   Pretty soon I was getting shields and sensors, motors, displays and a soldering iron. I quickly moved onto: – LCD display – DC motor –… Read More

Continue Reading
Vibration Detection Arduino Santiapps

Arduino (IoT): Simple Tutorial Detector de Vibraciones

Tutorial Detector de Vibraciones Detectar Movimiento.  PiezoVibration.ino. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Piezo Vibration Sensor Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software)   El código: [code] const int ledPin = 13; // led connected to digital pin 13 const int knockSensor = A0; // the piezo is connected to analog pin 0 const int threshold = 100; // threshold value to decide when the detected sound is a knock or not // these variables will change: int sensorReading = 0; // variable to store the value read from the sensor pin int ledState = LOW; // variable used to… Read More

Continue Reading
Arduino Autonomous Rover Technology Santiapps

Arduino (IoT): Simple Tutorial Robot Autónomo Parte II

Tutorial Robot Autónomo: Parte II Ahora terminaremos con el proyecto completo! Requisitos: Computadora (mac) Arduino UNO. Llantas (2) Motores DC (2) Sensor Ultrasonico Mini Servo Arduino IDE (https://www.arduino.cc/en/Main/Software) Primero hagamos un plan de ataque, plan de negocio o plan de diseño.  La idea es la misma, planificar una ruta general de la cual nos podemos salir en cualquier momento pero que al menos nos da un norte a seguir en caso de no haber excepciones que cambien el juego. Primero tendremos que crear 4 objetos: 2 motores DC (izquierdo y derecho), 1 motor servo para girar el sensor ultrasonico y 1 sensor ultrasonico. Antes de tomar la primera medición, asignamos 0… Read More

Continue Reading
Laser Arduino Santiapps

Arduino (IoT): Simple Tutorial Laser

Tutorial Laser En este tutorial usamos un laser, que en esencia es igual a una LED en términos de como controlarlo. Requisitos: Computadora (mac) Arduino UNO Unidad Laser 5mW Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código: [code] void setup() { Serial.begin(9600); pinMode(9,OUTPUT); } void loop() { delay(2000); digitalWrite(9,HIGH); delay(2000); digitalWrite(9,LOW); delay(3000); Serial.println(“Cool”); } [/code]   Los punteros laser se pueden usar en nuestros proyectos para señalar la dirección de avance de un vehículo o robot, para detectar un camino no-interrumpido y muchas otras aplicaciones mas.

Continue Reading
Sound Detection Arduino Santiapps

Arduino (IoT): Simple Tutorial Sensor de Sonido

Tutorial Sensor de Sonido Los robots no solo ven con los ojos.  Muchos “ven” con los oídos.  En este tutorial veremos como un robot puede detectar sonido con uno de estos módulos.  (sound.ino) Requisitos: Computadora (mac) Arduino UNO o equivalente. Sensor de Sonido Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código: [code] int currentValue; int maxValue; int minValue; unsigned long timer; int sampleSpan = 200; // Amount in milliseconds to sample data int volume; // this roughly goes from 0 to 700 void setup(){ Serial.begin(9600); resetValues(); } void loop(){ currentValue = analogRead(A0); if (currentValue &lt; minValue) { minValue = currentValue; } if (currentValue &gt; maxValue) { maxValue = currentValue; } if (millis() –… Read More

Continue Reading
JPEG Camera IR TTL Arduino Santiapps

Arduino (IoT): Simple Tutorial Camara JPEG IR TTL

Tutorial Camara JPEG IR TTL Si vamos a tener un robot explorador, a veces vamos a querer ver lo que el ve.  Podemos perfectamente agregar un modulo para tomar fotos.  En este tutorial veremos como controlar un modulo para toma de fotos, una Camara JPEG.  TutorialJPEGIRTTLCamerav2. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Modulo Camara JPEG Modulo SD para almacenar la imágen Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software)   Veamos el código: [code] //******************************************************* // www.linksprite.com // Note: // 1. SD must be formated to FAT16 // 2. As the buffer of softserial has 64 bytes, // so the… Read More

Continue Reading
Wifi Communication Arduino Santiapps

Arduino (IoT): Simple Tutorial WiFi CC3000 Arduino Shield

Tutorial WiFi CC3000 Arduino Shield En este tutorial exploramos la shield original de Arduino, WiFi, CC3000.  Esta acaba de ser reemplazada (Nov 2015) por la WiFi 101.  Veremos esa en tutoriales futuros. Ahora veamos los componentes requeridos. Requisitos: Computadora (mac) Arduino UNO Arduino WiFi Shield CC300 Arduino IDE (https://www.arduino.cc/en/Main/Software) Las shields son muy practicas y fáciles de usar.  Simplemente se conectan sobre los headers de la Arduino UNO.  Cuidado porque hay shields para distintas placas.  Es decir que una shield es especifica para la UNO y no funciona sobre la MEGA y vv. Ya conectada podemos repasar el código rápidamente para montar un servidor que muestre datos de sensores análogos (o digitales)… Read More

Continue Reading
Power Savings with Watchdog Arduino Santiapps

Arduino (IoT): Simple Tutorial Arduino Durmiente: Parte 2

Tutorial WDT: Arduino Durmiente -Parte 2 En el tutorial anterior aprendimos sobre dormir la Arduino.  Usamos eventos externos como un interrupt en un pin, (Pin2=INT0) o recepción de data Serial (la cual mandamos del Rx al Pin2(INT0) y la usamos como interrupt externo. Ahora veremos como podemos usar eventos internos al MCU para despertarlo, como timers. Requisitos: Computadora (mac) Arduino UNO Arduino IDE (https://www.arduino.cc/en/Main/Software) Repaso de los modos de dormir: SLEEP_MODE_IDLE: 15 mA (ahorra poco pero retiene muchas funciones) SLEEP_MODE_ADC: 6.5 mA SLEEP_MODE_PWR_SAVE: 1.62 mA SLEEP_MODE_EXT_STANDBY: 1.62 mA SLEEP_MODE_STANDBY : 0.84 mA SLEEP_MODE_PWR_DOWN : 0.36 mA (ahorra mucho pero OJO!) Para mayor información puede visitar (http://www.gammon.com.au/forum/?id=11497) Repaso de las formas de… Read More

Continue Reading
Power Savings with Watchdog Arduino Santiapps

Arduino (IoT): Simple Tutorial Arduino Durmiente: Parte 1

Tutorial WDT: Arduino Durmiente -Parte 1 En este tutorial aprenderemos sobre dormir la Arduino.  Esto es necesario para ahorrar energía en proyectos autónomos.  En el tutoríal de la Estación Ambiental usamos una librería llamada la LowPower library para dormir nuestros electrónicos después de tomar datos para ahorrar energía.  Así nuestra batería (la cual se cargaba solamente) duraría mas tiempo ya que solo era necesario tomar muestras cada tanto tiempo. Requisitos: Computadora (mac) Arduino UNO Arduino IDE (https://www.arduino.cc/en/Main/Software) Dormir la Arduino es sencillo y necesitamos usar: #include <avr/interrupt.h> #include <avr/sleep.h> #include <avr/power.h> #include <avr/io.h> Y código tan sencillo como: void sleepNow(){     // Cual modo queremos usar:     set_sleep_mode(SLEEP_MODE_IDLE);     // Habilitar sleep (SE) bit:     sleep_enable();… Read More

Continue Reading
Ethernet Arduino Santiapps

Arduino (IoT): Simple Tutorial Ethernet W5100 Arduino Shield

Tutorial Ethernet 5100 Arduino Shield En este tutorial exploramos la shield original de Arduino, Ethernet, W5100.  Tambien esta la Arduino CC3000 WiFi, la cual acaba de ser reemplazada (Nov 2015) por la WiFi 101.  Veremos estas en tutoriales futuros. Ahora veamos los componentes requeridos. Requisitos: Computadora (mac) Arduino UNO Arduino Ethernet Shield W5100 Arduino IDE (https://www.arduino.cc/en/Main/Software) Las shields son muy practicas y fáciles de usar.  Simplemente se conectan sobre los headers de la Arduino UNO.  Cuidado porque hay shields para distintas placas.  Es decir que una shield es especifica para la UNO y no funciona sobre la MEGA y vv. Ya conectada podemos repasar el código rápidamente para montar un servidor que muestre… Read More

Continue Reading
Power Savings with Watchdog Arduino Santiapps

Arduino (IoT): Simple Tutorial WDT: Parte IV – WatchDog Timer (WDT)

Tutorial WDT: Parte IV – WatchDog Timer (WDT) En esta parte utilizamos nuestro el WatchDogTimer (WDT) interno del Arduino para resetear nuestra Arduino UNO cada 8 segundo.  El WDT es otra manera de “despertar” una Arduino o resetearla.  Es muy común a la hora de revivir una Arduino que por mal código o malas condiciones electrónicas puede haber caído en un loop y esta atascada. Requisitos: Computadora (mac) Arduino UNO Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código: #include <avr/wdt.h> #define RESETWATCHDOG void setup(){ Serial.begin(57600); Serial.println(“”); Serial.println (“——->Arduino Rebooted”); Serial.println(“”); wdt_enable(WDTO_8S); // Reseteara la Arduino c/8s } void loop(){ #ifdef RESETWATCHDOG wdt_reset(); // Reiniciar el WDT (Pat the Dog) #endif Serial.println(“Arduino Running”); delay(1000); }… Read More

Continue Reading
Real Time Clock Arduino Santiapps

Arduino (IoT): Simple Tutorial RTC: Parte III – Alarmas

Tutorial RTC: Parte III – Alarmas En esta parte utilizamos un DS1307 para disparar alarmas.  Las alarmas son muy útiles para realizar tareas en momentos específicos.  Algunos módulos de RTC traen alarmas incorporadas como el DS3231 y otros.  Pero el modulo DS1307 no trae alarmas incorporadas.  Es decir que solo puede llevar la hora pero no configurar y disparar alarmas cuando se le programe.  Para eso usaremos ayuda de las librerías Time y TimeAlarms. Requisitos: Computadora (mac) Arduino UNO Modulo RTC DS1307 Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código: [code] /** RTC Alarms without DS3231 without powering down */ #include <Wire.h> #include “RTClib.h” #include <Time.h> #include <TimeAlarms.h> RTC_DS1307 rtc; void setup(){ Serial.begin(9600); Wire.begin(); rtc.begin();… Read More

Continue Reading
Real Time Clock Arduino Santiapps

Arduino (IoT): Simple Tutorial RTC: Parte II – Configurar con DS1307RTC

Tutorial RTC: Parte II – Configurar con DS1307RTC En esta parte utilizamos una librería distinta, la DS1307RTC en lugar de la RTClib.  Primero haremos lo mismo, configurar la hora en nuestro modulo RTC. Requisitos: Computadora (mac) Arduino UNO Modulo RTC DS1307 Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código: [code] #include <Wire.h> #include <Time.h> #include <DS1307RTC.h> const char *monthName[12] = { “Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”, “Jul”, “Aug”, “Sep”, “Oct”, “Nov”, “Dec” }; tmElements_t tm; void setup() { Serial.begin(9600); bool parse=false; bool config=false; // obtener fecha de computadora if (getDate(__DATE__) &amp;&amp; getTime(__TIME__)) { parse = true; // configurar la fecha y hora al rtc if (RTC.write(tm)) { config = true; } } Serial.begin(9600);… Read More

Continue Reading
Real Time Clock Arduino Santiapps

Arduino (IoT): Simple Tutorial RTC: Parte I – Configurar con RTClib

Tutorial RTC: Parte I – Configurar con RTClib Parece algo sencillo e inconsecuente pero muchas veces necesitaremos tomar el tiempo o ejecutar tareas basadas en el tiempo “real”.  Esto se refiere a la hora verdadera usada por la humanidad y no en base a un timer que iniciamos arbitrariamente hace tantos minutos o segundos.  Para esto usamos un modulo RTC. Requisitos: Computadora (mac) Arduino UNO Modulo RTC DS1307 Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El modulo DS1307 RTC es este: Este modulo debe ser programado para asignar la hora “real” humana.  Una vez se hace esto, mientras tenga la batería CR2032 que trae atras, el modulo mantendrá la hora. Primero lo que vamos a… Read More

Continue Reading
Arduino Autonomous Rover Technology Santiapps

Arduino (IoT): Simple Tutorial Robot Autónomo Parte I

Tutorial Robot Autónomo: Parte I Ya sabemos controlar motores y sabemos sentir (ver).  Combinemos estas habilidades para hacer que nuestro robot se mueva. Requisitos: Computadora (mac) Arduino UNO. Llantas (2) Motores DC (2) Sensor Ultrasonico Motor Mini Servo Arduino IDE (https://www.arduino.cc/en/Main/Software) Primero vamos a armar el motor shield con los 2 DC motors y los vamos a hacer funcionar de forma sencilla para ver como operar los motores a través del shield. Componentes El sensor ultrasonico se puede pegar con silicon transparente escolar a la paleta del servo.  El alambrado es sencillo: El servo se conecta a la terminal de Servo2 en la shield El Sensor tiene 4 conexiones Vcc al… Read More

Continue Reading
SD Card for storing data Arduino Santiapps

Arduino (IoT): Simple Tutorial Escribir Data en SD Card

Tutorial SD Card Almacenar datos en SD.  SDCardReadWrite.ino. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Modulo con SD Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código: #include <SD.h> File myFile; void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } Serial.print(“Initializing SD card…”); // On the Ethernet Shield, CS is pin 4. It’s set as an output by default. // Note that even if it’s not used as the CS pin, the hardware SS pin  // (10 on most Arduino boards, 53 on… Read More

Continue Reading
TFT Display Arduino Santiapps

Arduino (IoT): Simple Tutorial TFT Pantalla 1.8″ Parte III

Tutorial TFT 1.8″ Parte III Ver imágenes en una pantalla tft. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino UNO. MicroSD 1.8″ TFT Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código lo bajamos aquí: Documents/Arduino/Adafruit-ST7735-Library-Master Las conexiones son: Shield——————–UNO SCK – 13 DI – DO – 11 TCS – 10 Reset(9) – 9 DC – 8 CCS4 – 4 Es importante set los pines en codigo correctamente: /*************************************************** ADAFRUIT ****************************************************/ #include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7735.h> // Hardware-specific library #include <SPI.h> #include <SD.h> #define TFT_CS 10 // Chip select line for TFT display #define TFT_RST 9 // Reset line for… Read More

Continue Reading
TFT Display Arduino Santiapps

Arduino (IoT): Simple Tutorial TFT Pantalla 1.8″ Parte II

Tutorial TFT 1.8″ Parte II Leyendo analogo del joystick! Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Camara JPEG TFT con joystick! Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código esta aquí: void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); } #define Neutral 0 #define Press 1 #define Up 2 #define Down 3 #define Right 4 #define Left 5 // Check the joystick position int CheckJoystick() { int joystickState = analogRead(3); if (joystickState < 50) return Left; if (joystickState < 150) return Down; if (joystickState < 250) return Press; if (joystickState < 500) return Right;… Read More

Continue Reading
TFT Display Arduino Santiapps

Arduino (IoT): Simple Tutorial TFT Pantalla 1.8″ Parte I

Tutorial TFT 1.8″ Parte I Ver graficas y escribir o dibujar en una pantalla tft. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino UNO. MicroSD 1.8″ TFT Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) El código lo bajamos aquí: Documents/Arduino/Adafruit-ST7735-Library-Master Las conexiones son: Shield——————–UNO SCK – 13 DI – DO – 11 TCS – 10 Reset(9) – 9 DC – 8 Es importante set los pines en codigo correctamente: [code] /*************************************************** ADAFRUIT ****************************************************/ #include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7735.h> // Hardware-specific library #include <SPI.h> // For the breakout, you can use any 2 or 3 pins // These pins will also… Read More

Continue Reading
Remote Solar Charging Weather Station Arduino Santiapps

Arduino (IoT): Simple Tutorial Estación Ambiental: Solar Parte III

Tutorial Estación Ambiental Solar: Parte III Ya tenemos la unidad de muestreo.  Ahora veamos la unidad central encargada de recibir los datos y mostrarlos en el LCD. Requisitos: Computadora (mac) Arduino UNO & Nano Battery LiPo Modulo Carga Solar USB-LiPo DC-DC Booster DHT11 Modulo RF 433MHz(Rx/Tx) 2 Breadboards LCD 16×2 Arduino IDE (https://www.arduino.cc/en/Main/Software) Finalmente llegamos a la Unidad Central o de Recepción de datos. Unidad Central: Rx RF de 433MHz para recepción y almacenamiento Arduino UNO La Unidad Central es la que recibirá los datos.  Como tal puede operar de una UNO completa ya que su consumo energético es mas grande pero podría estar conectada a un tomacorriente con USB. El código… Read More

Continue Reading
Remote Solar Charging Weather Station Arduino Santiapps

Arduino (IoT): Simple Tutorial Estación Ambiental: Solar Parte II

Tutorial Estación Ambiental Solar: Parte II Ahora que tenemos nuestra fuente de poder podemos armar nuestra unidad de muestreo.  Esta se encargará de tomar las mediciones y por ende necesitará autonomía energética.  Aquí también veremos el uso de la librería LowPower, la cual nos ayudará a ahorrar energía mientras la unidad no este maestreando.  Es decir, la mayoría de las veces solo tenemos que muestrear 1 o 2 veces cada hora.  El resto del tiempo podemos reducir la cantidad de energía consumida ya que no es necesario alimentar todos los componentes. Requisitos: Computadora (mac) Arduino UNO & Nano Battery LiPo Modulo Carga Solar USB-LiPo DC-DC Booster DHT11 Modulo RF 433MHz(Rx/Tx) 2 Breadboards… Read More

Continue Reading
Remote Solar Charging Weather Station Arduino Santiapps

Arduino (IoT): Simple Tutorial Estación Ambiental: Solar Parte I

Tutorial Estación Ambiental Solar: Parte I Tenemos ya varias ideas para proyectos.  En algunos casos estos proyectos necesitan autonomía energética.  El caso de una estación de monitoreo ambiental es el candidato perfecto para esto.  Es necesario que la operación continue y por lo general lejos de un tomacorriente.  Podríamos usar baterías alcalinas pero puede que solo dure 3 días dependiendo de la cantidad de funciones que tenga el robot. Es aquí donde un paquete de baterías recargables funciona a la perfección.  Utilizaremos un panel solar para recargar esas baterías via un modulo de carga solar.  Tendremos que buscar un panel solar con ciertas especificaciones pero seguro lo podemos encontrar en alguna… Read More

Continue Reading
GSM Arduino Santiapps

Arduino (IoT): Simple Tutorial GSM Parte V

Tutorial GSM: Parte V Ahora queremos hacer cosas mas precisas como hacer algo si recibimos un SMS. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Modulo SIM900 GSM/GPRS Arduino IDE (https://www.arduino.cc/en/Main/Software) Estaremos usando el modulo SIM900 GSM/GPRS para nuestra comunicación: Como podemos ver, el modulo tiene un pin 5V, 2 pines GND y los típicos 2 pines para Rx y Tx. Veamos un ejemplo sencillo: #include <SoftwareSerial.h> char inchar; //SoftwareSerial SIM900(7, 8); int led1 = 10; int led2 = 11; int led3 = 12; int led4 = 13; void setup(){ Serial.begin(19200); pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); pinMode(led4,… Read More

Continue Reading
GSM Arduino Santiapps

Arduino (IoT): Simple Tutorial GSM Parte IV

Tutorial GSM IV Ahora exploraremos como llamar a Arduino para hacer algo mas especifico.  Aquí vamos a parse otra informacion sobre la llamada entrante. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Modulo SIM900 GSM/GPRS Arduino IDE (https://www.arduino.cc/en/Main/Software) Estaremos usando el modulo SIM900 GSM/GPRS para nuestra comunicación: Como podemos ver, el modulo tiene un pin 5V, 2 pines GND y los típicos 2 pines para Rx y Tx.  Seguiremos usando los pins 18 & 19 en nuestra MEGA como Serial1. En este caso leeremos cuantas veces suena el timbre.  El timbre suena y manda una señal “RING”.  Mejor… Read More

Continue Reading
GSM Arduino Santiapps

Arduino (IoT): Simple Tutorial GSM Parte III

Tutorial GSM Veamos que mas podemos hacer cuando el numero que llama es autorizado sin necesariamente esta almacenado en una SIM.  O sea, podemos “parse” los resultados de la llamada para obtener cierta informacion.  En este caso la informacion que vamos a parse del numero que llama es precisamente el numero que nos da el Caller ID. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Modulo SIM900 GSM/GPRS Arduino IDE (https://www.arduino.cc/en/Main/Software) Estaremos usando el modulo SIM900 GSM/GPRS para nuestra comunicación: Como podemos ver, el modulo tiene un pin 5V, 2 pines GND y los típicos 2 pines para Rx y… Read More

Continue Reading
Arduino Melodias Santiapps

Arduino (IoT): Simple Tutorial Creando Melodías con Piezo Buzzer & Arduino Nano

Tutorial Fet, iOS & Bluno Nano En este tutorial aprenderemos sobre la Bluno Nano y su utilidad para controlar remotamente un proyecto. Requisitos: Computadora (mac) Arduino nano Breadboard, 1kR & Piezo Buzzer Arduino IDE (https://www.arduino.cc/en/Main/Software) La conexión es del pin 3 de la Nano al + del buzzer.  El GND de la Nano va a tierra del buzzer a traves de un 1kR. El código en este caso es muy sencillo: El proyecto final es así:

Continue Reading
GSM Arduino Santiapps

Arduino (IoT): Simple Tutorial GSM Parte II

Tutorial GSM En el tutorial anterior vimos como hacer una llamada desde el modulo SIM900.  Ahora veremos como verificar si un numero que llama esta autorizado (grabado en nuestro SIM) y si lo es, enviar mensajes de texto tipo SMS.  Esto es muy util para autenticar una llamada para ejecutar código en un proyecto Arduino. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Modulo SIM900 GSM/GPRS Arduino IDE (https://www.arduino.cc/en/Main/Software) Estaremos usando el modulo SIM900 GSM/GPRS para nuestra comunicación: Como podemos ver, el modulo tiene un pin 5V, 2 pines GND y los típicos 2 pines para Rx y… Read More

Continue Reading
GSM Arduino Santiapps

Arduino (IoT): Simple Tutorial GSM Parte I

Tutorial GSM GSM (Global System for Mobile) es una tecnología de comunicación remota.  GSM nos permite comunicación de voz y datos (GPRS – General Packet Radio Service).  Primero experimentaremos con llamadas telefónicas.  Finalmente pasaremos a transmisión de datos via GPRS. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Modulo SIM900 GSM/GPRS Arduino IDE (https://www.arduino.cc/en/Main/Software) Estaremos usando el modulo SIM900 GSM/GPRS para nuestra comunicación: Como podemos ver, el modulo tiene un pin 5V, 2 pines GND y los típicos 2 pines para Rx y Tx.  Por ende la conexión es bastante sencillo.  Sin embargo nuevamente si vamos a subir… Read More

Continue Reading
ESP8266 Esp01 Wifi Arduino Santiapps

Arduino IoT: Simple Tutorial de Configuracion de ESP8266 WiFi con Nano

Arduino (IoT): Simple Tutorial de Configuracion de ESP8266 WiFi con Nano En este tutorial configuraremos un modulo ESP8266 para conectarlo a una red wifi.  Haremos esto usando una nano para enviar comandos AT a través del monitor serial.  Una vez configurada la ESP a nuestra red wifi, podremos usar la nano para cualquier proyecto que requiera wifi para enviar datos a la nube. Materiales: Arduino Nano + ESP8266 Cables y breadboard Primero es necesario confirmar la configuración del modulo.  Para eso conectamos el modulo via Rx/Tx a la Nano y damos poder via 3.7V Lipo así: Ahora cargamos un sketch vacio y abrimos el Monitor Serial para enviar comandos AT al… Read More

Continue Reading
Weather Arduino Santiapps

Arduino (IoT): Simple Tutorial Estación Ambiental Parte I

Tutorial Estación Ambiental: Parte I En este tutorial combinaremos 2 habilidades electrónicas que hemos aprendido: Colectar datos en sensores digitales Comunicar datos via WiFi Incorporaremos una habilidad distinta que no es precisamente de Arduino pero si de IoT.  La habilidad de recibir datos en un servidor en la web. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Wifi Shield & WiFi Library Grove Shield con Sensor CO2 y/o Dust Sensor Servidor PHP (hay servicios gratuitos de php por ejemplo: http://www.000webhost.com/) o Parse.com Arduino IDE (https://www.arduino.cc/en/Main/Software)   Aquí tenemos la Arduino UNO debajo de la TinySine WiFi inter-conectada a la Grove… Read More

Continue Reading
Voltmeter Arduino Santiapps

Arduino IoT: Tutorial para construir Voltmeter

Arduino (IoT): Tutorial para construir un voltmeter   Diseño Podemos construir 2 tipos de voltímetros con un Arduino: Mayor a 5V Menor o igual a 5V Debido a que la Arduino solo funciona con 5V máximo, el mejor tipo de voltímetro a construir con ella es el #2.  Ese es en efecto el que construiremos. Voltímetro >5V El tipo #1 involucra tomar un voltaje mas grande a 5V y partirlo de manera que solo midamos 5V máximo.  La diferencia se toma en cuenta al medir que % de 5V alcanzamos.  Por ejemplo si queremos medir 12V, partimos los 12V con algo llamado un voltaje divider.  Esto se asegura de partir en voltaje… Read More

Continue Reading
Ultrasonic Sonar Arduino Santiapps

Arduino (IoT): Simple Tutorial Ultrasonic Piezo Parte I

Tutorial Ultrasonic Piezo Determinar la distancia entre un robot y un obstaculo o meta es muy comun.  Hoy aprenderemos a usar un sensor de distancia el cual nos sera muy util en muchos proyectos. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. LED Breadboard Sensor Ultrasonico Piezo Buzzer Arduino IDE (https://www.arduino.cc/en/Main/Software) En este tutorial estamos preparándonos para el siguiente que utilizara el mismo piezo buzzer como alarma cuando detectemos objetos cercanos con el sensor ultrasónico.  Es por eso que veran mas componentes conectados al breadboard: Aqui vemos ya el sensor ultrasonico conectado al breadboard.  Sin embargo para esta… Read More

Continue Reading
Wifi Communication Arduino Santiapps

Arduino (IoT): Simple Tutorial WiFi

Tutorial WiFi Es muy común querer conectar nuestros proyectos Arduino a la nube.  WiFi es una de las maneras en que podemos hacer esto.  Claro también podemos usar GPRS y lo haremos mas adelante.  Por ahora veamos como conectar nuestra Arduino a una WiFi shield y lograr conectividad a la web. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Wifi Shield & WiFi Library Arduino IDE (https://www.arduino.cc/en/Main/Software) Estaremos usando el modulo WiFi de Roving Networks basado en la WiFly. Aquí podemos ver la WiFi shield (en azul) con su modulo WiFi Bee (en rojo). En este caso, dado… Read More

Continue Reading
Ultrasonic Sonar Arduino Santiapps

Arduino (IoT): Simple Tutorial Ultrasonic Piezo Parte II

Tutorial Ultrasonic Piezo II Ahora vamos a querer medir la distancia entre nuestro sensor y el objeto ademas de hacer sonar el buzzer.  Esto es mas util y parecido a un radar/sonar. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. LED Breadboard Sensor Ultrasonico Piezo Buzzer Arduino IDE (https://www.arduino.cc/en/Main/Software) Ahora si tenemos todos los componentes necesarios y conectados de la siguiente forma: El Piezo Buzzer (cilindro negro en la esquina superior izquierda) se conecta asi: Piezo (+) > Resistor de 220 Ohm – Color Fuchsia Fila 15 Piezo (-) > GND – Color Azul Resistor > Pin 9 de MEGA –… Read More

Continue Reading
Sensores Avanzados Arduino Santiapps

Arduino (IoT): Simple Tutorial Sensores Avanzados II

Tutorial Sensores Avanz. II Hoy exploraremos sensores avanzados.  Iniciamos con un sensor infrarojo Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. LED Sensor Infrarojo (PIR) Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Aqui esta el sensor y la conexión sencilla: Las conexiones son sencillas.  El sensor PIR tiene 3 terminales: VCC -> Conecta al 5V de la UNO GND -> Conecta al GND de la UNO Out -> Conecta al pin 9 de la UNO (o cualquier otro pin digital) El código: int ledPin = 13; int pirPin = 9; int val = 0; void setup(){ pinMode (ledPin,OUTPUT); pinMode (pirPin, INPUT);… Read More

Continue Reading
Sensores Avanzados Arduino Santiapps

Arduino (IoT): Tutorial de Sensores Avanzados

Tutorial Sensores Avanzados Ok es cierto, ya sabemos leer datos de un sensor de Temperatura y Humedad.  Estos son datos que podemos obtener fácilmente de muchas fuentes.  Pero si quisiéramos datos mas específicos como para hacer una estación ambiental? Requisitos: Computadora (mac) Arduino UNO.  Aqui utilizamos la UNO por el pinout que es identico al del Grove Shield.  El pinout (osea las conexiones) de la MEGA son ligeramente distintas. Sensores CO2 & Polvo (Dust) tipo Grove Breadboard Grove Shield Arduino IDE (https://www.arduino.cc/en/Main/Software) La tarjeta Grove Shield es una shield y como tal se ensambla sobre la UNO. Esta shield tiene 4 puertos para sensores análogos, 8 puertos para sensores digitales y… Read More

Continue Reading
4WD Car Kit Arduino Santiapps Series

Arduino (IoT) Video Serie: Kit de Carro Parte 7 (Guante)

Arduino (IoT): MPU6050 Accelerometro para Carro 4×4 Parte 7 (Control de Carro via Guante) En un tutorial anterior vimos como crear un carro 4×4 y controlarlo via instrucciones: Pre-cargadas en el codigo Via IR Via Bluetooth Via Sensor Ultrasonico En otro tutorial anterior vimos como usar un accelerometer MPU6050 para visualizar movimiento (aceleración) en cualquiera de los 3 ejes de las 3 dimensiones espaciales.  Usamos los datos del sensor para mover una gráfica de una ‘aeroplano’ en un programa llamado Processing y así visualizar el movimiento de nuestro sensor en una pantalla: Ahora veremos como combinar los datos de aceleración espacial para controlar un carro 4×4: Las conexiones serian las… Read More

Continue Reading
Bluetooth Motor Control Arduino Santiapps

Arduino (IoT): Simple Tutorial Bluetooth & Servo

Tutorial Bluetooth & Servo   Esta vez vamos a mover el Servo, pero en lugar de dejar los datos escritos adentro del código o usar el monitor serial para enviarlos al motor, los vamos a enviar desde un dispositivo con Bluetooth. Usaremos el BT de un celular para enviar la data.  Para esto es necesario bajar una aplicación que envia datos por Bluetooth. Podríamos crear una pero se sale un poco del tema Arduino.  Además hay varias aplicaciones en las tiendas de apps que ya hacen eso. Lo haremos con un Android pero también se puede desde una laptop o tablet. Requerido Computadora (mac) Arduino MEGA (u otra similar como UNO)… Read More

Continue Reading
Arduino Websites Santiapps

Sitios Arduino

A continuacion algunos sitios WordPress de Arduino y Raspberry así como proyectos IoT:   Ardubasic Aprendiendoarduino Tecnotero Arduinodeangel Tallerarduino Muyraspi Raspberryparatorpes Raspberry Pi Spy ModMyPi’s Blog Adafruit Industries | Raspberry Pi  Hack a Day | Raspberry Pi Electronics-Lab | Raspberry Pi  Ozzmaker | Raspberry Pi  Cat Lamin | Raspberry Pi  Raspberryblog.de The Raspberry Pi Guy | Youtube

Continue Reading
Temperature Humidity Arduino Santiapps

Arduino (IoT): Simple Tutorial Sensores T/H

Tutorial Sensores T/H Hasta ahora hemos principalmente enviado informacion a los componentes.  Escribimos datos a una LCD, a motores y LEDs.  Ahora veamos como leer informacion de los componentes. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. DHT11 Sensor de Temp/Humedad Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) La conexión es sencilla: El pin de data, a la par del pin de 5V en el sensor, lo conectamos al pin 5 de la MEGA.  Este sera el pin que leeremos en codigo para obtener la data. El codigo… #include dht DHT; #define DHT11_PIN 5 void setup() { Serial.begin(9600); Serial.println(“DHT TEST PROGRAM “);… Read More

Continue Reading
Playing Melodies with Arduino Santiapps

Arduino (IoT): Simple Tutorial de Parlantes y Melodias

Arduino (IoT): Simple Tutorial de Parlantes y Melodias Arduino   En tutorial aprendemos que los sonidos no son mas que energía y esa energía la podemos reproducir usando energía eléctrica en una Arduino.  El tutorial es sencillo y muy interesante porque, que mejor melodía que…bueno preparen el tutorial y escuchemos!  Será una muy buena sorpresa.   Conexiones La conexión del cable rojo es al pin 8, que usamos como salida de la Arduino. Codigo El codigo sera en dos partes.  La primera parte es notas.h que básicamente solo define las notas.  La segunda parte es el código que usa esas notas.  Aquí esta notas.h: #define C0 16.35 #define Db0 17.32 #define D0 18.35… Read More

Continue Reading
LCD for Data Display Arduino Santiapps

Arduino (IoT): Simple Tutorial LCD

Tutorial LCD Ya sabemos accionar luces y motores.  Ahora veamos como visualizar informacion en una pantalla LCD que es una tarea muy común para mostrar informacion obtenida de sensores. Requisitos: Computadora (mac) Arduino MEGA (u otra variante Arduino) o incluso Arduino clone, Edison, Raspberry…  Este tutorial en particular usa una Arduino MEGA. Pantalla LCD Breadboard Arduino IDE (https://www.arduino.cc/en/Main/Software) Una pantalla LCD es un componente un poco mas complicado.  Como pueden ver ya viene montado sobre una tarjeta de circuitos.  Pero no es de asustarse, una tarjeta de circuitos lo único que es, es una conexión de varios componentes de manera fija.  Es mas, en los tutoriales anteriores que hicimos interconexiones usando la breadboard,… Read More

Continue Reading

Jobs In Demand During and After Covid-19, Part 1

The ongoing Covid-19 pandemic is taking a massive toll on the global economy, destroying millions of jobs worldwide as companies are forced to reduce staff. The International Labour Organization has forecast that the pandemic could reduce global working hours by nearly 7 percent in the second quarter of 2020. This is the equivalent to 195 million full-time jobs. According to a report by McKinsey, in Africa, Europe, and the United States, up to a third of the workforce is vulnerable to reduced income, furloughs, or layoffs as a result of the pandemic. Many millions of jobs could be lost permanently, which, in turn, would dampen consumer spending. The pandemic is… Read More

Continue Reading

Santiapps = ArduinoHonduras

ArduinoHonduras is now Santiapps. In order to provide our readers with a unified experience, Facebook.com/ArduinoHonduras has been rebranded as Santiapps. Santiapps.com is the content producer for more than +120 Arduino, Raspberry Pi, iOS and Android Programming Tutorials in Spanish and English. We are moving to developing final products developed by ourselves and our users as well as improving of tutorials by moving over to a video format which is better suited for our needs. We hope you enjoy the new .com/Facebook/YouTube experience. Ahora ArduinoHonduras es Santiapps. Para dar a nuestros lectores una experiencia más unificada, Facebook.com/ArduinoHonduras ha sido renombrada Santiapps. Santiapps.com es el generador de contenido para más de +120… Read More

Continue Reading

iOS7 Custom Transitions

iOS7 Series –Custom Transitions There is a hierarchy of actors you need to visualize here.  It goes a little something like: A TransitioningDelegate An AnimatedTransitioning A ContextTransitioning The VC you start out with and that will call the transition will adopt the first protocol, the TransitioningDelegate Protocol.  The purpose of doing so is to obtain the authority to manage the entire transition process. You will then create a Transitioning class which we can call the Transition Manager.  This class will adopt the AnimatedTransitioning protocol.  The purpose of this protocol is to animate the transition. The Transition Manager class receives all the necessary information from the Transitioning Context (a protocol adopted… Read More

Continue Reading

Business of iOS Apps

I keep reading articles or watching videos of iOS businesses who made it and they share their wisdom of the Common 10 Mistakes iOS developers make. Guess what? Most of those mistakes, although they are worded as developer concepts, they are really business concepts. Common Mistakes: Don’t need a marketing guy. Don’t need a business guy. Don’t need a business perspective. Usually worded as, I thought I would get rich quick, or Im looking for a one hit wonder, or Im a great programmer and I thought that was enough. Well guess what, if you are going to sell something and make more than 99c for it, its gonna need… Read More

Continue Reading

Creating a simple UICollectionView in iOS

Steps 1) Create Master-Detail Application & Replace the MasterViewController First we want to create a Master-Detail Application just because it sets up a Master-Detail relationship even though thats the first thing we are going to break :).  So go ahead and create a new project in XCode4 based on a Master-Detail Application type.  Use ARC, Storyboards and CoreData because we will use CoreData to store information.  Your storyboard should look like this: Now select the Master scene until its highlighted in blue and delete it with the Delete key.  We simply replace it by dragging in a UICollectionViewController onto the storyboard in its place.  This places a UICollectionViewController scene with… Read More

Continue Reading

iOS7 – UIKit Dynamics

iOS7 Series – UIKit Dynamics   Incorporating UIKitDynamics into your app is pretty simple!  The great thing about it is that you really get the most bang for your buck because the end result has a really big WOW Factor which is certain to impress your users.  Let’s take a quick conceptual drive around UIKitDynamics. First we adopt the protocol into the ViewController which will implement UIKitDynamics, why?  Well because the objects which will be animated in the end will have to send back a lot of signals like “Hey, I collided with a boundary” or “hey I just hit somebody else and I was going this fast, in this… Read More

Continue Reading

iOS Smarties :)

Everyone loves Smarties!  And much the same way Smarties Candies make you smarter… today we are talking about Code Snippets that make you….er Smarter!  More than a source of cut/paste Objective C source code, this is meant to be a quick reference.  As such, some of these will be incomplete and I will be filling them up as I go along.  1)   UIAlertView UIAlertView *internetAlert = [[UIAlertView alloc] initWithTitle:@”No hay farmacias” message:@”Favor cambie sus parámetros” delegate:self cancelButtonTitle:@”Cancelar” otherButtonTitles:@”Ok”, nil]; [internetAlert show]; 2)   NSNotification //1. Register as observer of notifications in viewDidLoad [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveTestNotification:) name:@”TestNotification” object:nil]; //2. NSNotifCtr CLEANUP in viewDidUnload [[NSNotificationCenter defaultCenter] removeObserver:self]; //4. Post notif to NSNotif in… Read More

Continue Reading

First Google Glass App – Part 8 – Hello Glass!

Jumping right in, let’s create a Glass GDK project from scratch: Create New Android Project Configure GDK Imports Code qwe To create a new project…See our Part 1 of the tutorial. Make sure to configure the Glass GDK Sneak Peek Manually if it didn’t get configured by Android Studio or Eclipse on set up.  As it turns out, even if you create a project setting GDK as the Compile for API, it doesn’t get created as such.  You must double check in your build.gradle file (CAREFUL, there are 2 such files.  You need to modify your inner most gradle file) and make sure it looks something like this: And you… Read More

Continue Reading

iOS7 Sprite Kit for Game Design for iPhone & iPad

iOS 7 Series – Sprite Kit Welcome to iOS7 and to start off, I want to kick things off with SpriteKit.  Although it deals with video games, many companies are using iOS apps as a marketing tactic to engage their users in an effort to promote their products. SpriteKit is the most prominent feature in iOS7 so we’re going to take a quick tour.  Go ahead and create a New Project in XCode5 and select the SpriteKit template (the bottom right icon): Click next and fill in your project data.  Once you are in the main XCode window notice we have the following files in the Project Navigator: 1)   AppDelegate… Read More

Continue Reading

First Google Glass App – Part 7 – Bridge to Glass App GDK Development

Before jumping into Glass dev, let’s understand how to create a Hello World project in Android Studio (AS) and run it on our device. Create New Project Get to know the guts Add Imports Add Code Tweak guts Run on Device Create New Project When you select New Project from the File Menu, you get this Wizard screen: Fill in the Application Name in a natural language and the Module Name without spaces.  Make sure to select API 15 for Minimum and Target SDK but Glass Development Kit Sneak Peek for Compile with. Click Next and in the next screen just leave everything as is (the launch icon selector screen).… Read More

Continue Reading

First Android App – Part 6

My First Android App Now we are going to receive the input of this message and use the button to send it. To do so, edit your Button declaration to look like this: <Button android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”@string/button_send” android:onClick=”sendMessage” /> We are simply telling it to respond to the onClick button action by calling the sendMessage method. So we must declare this method in code, of course.  Open your MainActivity.java file and add the following: /** Called when the user clicks the Send button */ public void sendMessage(View view) { // Do something in response to button } We are declaring a public method that returns void, is called sendMessage and… Read More

Continue Reading

Glass Development Mirror API – Part 4 – Where to start after setting up!

So you have Glass and you want to develop apps for it? You already have an IDE such as Eclipse or Android Studio to code your apps in, you know all about adb and Droid@Screen to view your Glass screen on your computer screen! Well you do have options, before jumping into your typical Hello World Glass app. As with other platforms like iOS, you have the option of native apps and web based services apps.  This last option is basically an app that runs on a server(s) and interacts directly with your device (be it Glass or iDevice) by sending it information. Native – GDK – Apps These are… Read More

Continue Reading

How to create an app – Not programmatically

A fellow coder asked: “How does one go about developing an app from scratch?  Where does one start?” My response follows: Some will say its a matter of style and you have to find your own. And eventually you will, after a lot of copy-paste programming. I started in 2009 and my first app was a copy-paste of a few different projects. All the app did was connect to the Internet, download XML and parse it into a uilabel. Then I decided to look into more complex app samples. So I downloaded a few from Apple. In particular I remember iPhoneCoreDataRecipes. In hindsight, it was too complex for a beginner… Read More

Continue Reading

ObjC Programming

The Big Picture ObjC is OOP which means objects send messages to other objects. Before getting into messages, let’s define objects. Objects. This is very diverse. An object can be a string, a number, a Boolean, an integer, an array, a dictionary or even one you create yourself. There are any types of objects but let’s start at the root object. The root object is called NSObject. You’ll see references to it in code but you’ll hardly ever use it directly. This is called the root object because it’s the starting point of any object. It’s like Adam and Eve rolled into one and ANY other kind of object in… Read More

Continue Reading

Static Libraries in iOS – Video Tutorial

Libraries is another one of those rather obscure topics for newbie programmers, kinda like Blocks and Delegates/Protocols.  Think of libraries as just that, a resource you can use which doesn’t belong to you.  A loaner 🙂 NOTE: If you need a nice tutorial on Blocks or Delegates, check out: Video Tutorial: Objective-C Blocks Video Tutorial: Objective-C Protocols and Delegates Ok back to our tutorial!  Well a library is a piece of code that you can use (by importing it into your projects) but its not yours, so you can’t really do what you want to that piece of code, except use its functionality.  In this tutorial we will create our… Read More

Continue Reading

Command line prompts

ls ping netstat open locate sqlite sudo nano /etc/apache2/httpd.conf Computers are amazing! We all love telling them what to do. It’s like having you’re own personal assistant. And while adding calendar appointments, editing presentations and browsing web pages is very sophisticated nowadays, command prompt shells are so much more appealing, to me anyway. I remember the first time I used a command prompt was in my uncle’s Apple IIe back in San Francisco. Who didn’t love making printout loops using * to draw shapes and spell words…or since we are geeks, draw a big heart on the screen. I also remember computer class back at school at EIS. The 10… Read More

Continue Reading

First Android App – Part 5

My First Android App   Android is based on Java much like iOS is based on ObjectiveC.  If you are coming from an iOS background, itll be a bit jarring at first.  Even though ObjC “comes from” C, C formats are a bit different.  So I thought Id start with that first. ObjC: [myObject methodForDoingThis:someParameter]; is a method call which refers to this declared method: -(void)methodForDoingThis: (id)someParameter{ //1. Take the passed in parameter //2. Do something to with that parameter value //3. Call some other method… //4. Or if this were a method that returned an object instead of void //4. Return a new object value } C: myObject.methodForDoingThis(someParameter); is… Read More

Continue Reading

Google Glass & Android Series for Developers & Users

So I’ve gotten a little carried away with the Glass-Android thing.  My posts are as disorganized as my thoughts, so I thought I’d organize my posts a bit.  Here is the set of posts for Android & Glass Development as of Feb 15th, 2014: Google Glass Review – Part 1 – 什么 (shen me = what = what Glass is & isn’t) Google Glass Review – Part 2 – Pros & Cons Develop apps for Google Glass – Part 3 – Setting up! Glass Development Mirror API – Part 4 – Where to start after setting up First Android App – Part 5 First Android App – Part 6 First Google… Read More

Continue Reading

Google Glass Review – Part 1- 什么

I got my Glass a little late…but here is my review! What they are? You might think the answer is obvious, but its not.  Its a wearable computer but its not a full blown computer.  Does that make it less of a computer?  Not really, unless you consider ipads and iphones less than a computer because you can’t do ALL the things you can normally do on a full blown laptop. What can you do with them? Since we already mentioned you can’t do everything you can on a full blown computer, let’s talk about what we CAN DO! Out of the box, Glass comes with a few commands such… Read More

Continue Reading

Develop apps for Google Glass – Part 3 – Setting up!

If you have experience in Android (Java) development, this will be even easier. What you’ll need: Google Glass – to test your apps on Eclipse or Android Studio for coding Android SDK 15 & Glass Development Kit Sneak Peek (GDK) Configure adb Glass Well you either borrow a pair or get your own, but you will need Google Glass to test your apps.  The reason being that there is no Glass emulator as there is for Android as of yet. Eclipse or Android Studio Eclipse is the most widely known IDE for Android programming but its worth getting to know Android Studio, the new IDE for developing on Android &… Read More

Continue Reading

Blocks & Completion Handlers

Think of blocks as c functions: (return type)functionName(input1, input2) { input1 + input2 } and you call it like this: return type = functionName (1,2) Blocks are similar: NSInteger (^mathOperation)(NSInteger x, NSInteger y) = ^NSInteger(NSInteger x,NSInteger y){ return x + y; }; You call it like this: NSInteger sum = mathOperation(1,2); Now imagine how cool it is to, instead of just passing a value to a method (like saying: here is a value, evaluate it), you can pass a whole method to it (like saying: here is something else to do!). Or better yet, here do this but only when you finish doing that! Like, load the users posts or tweets after you finish authenticating him!… Read More

Continue Reading

Creating Reactive Cocoa Xcode project

  Earlier I posted an article on using RAC.  It was a plain vanilla example of using RAC. While I AM working on a second post with more useful examples, I wanted to go over how to ADD RAC to a project.   First, you must have ruby installed.   This means, go to Terminal and type in: which ruby This is what I get: …../.rvm/rubies/ruby-2.1.0/bin/ruby Important to note here that if you don’t have that rvm bit, you might still have ruby.  RVM stands for Ruby Version Manager and for what little I know about ruby, its one of the managers available for ruby but there are others. If… Read More

Continue Reading

Reactive Cocoa in 3 simple steps!

If you made it through installing ReactiveCocoa, via Cocoapods, which required you to have ruby, update it and install Cocoapods and CLT, then you’re already ahead!  So here is RAC.  RAC is used when you need to be notified of something important in your app; completed download, some long asynchronous task like data fetching, parsing or image processing is complete or to update UI such as a completed form produces an active Submit button or an incomplete field yields a red warning sign to the user. How does RAC work? You basically create signals for events you are interested in (like the ones mentioned above) and then you tie those… Read More

Continue Reading

Why Im not excited about multitasking!

  MULTITASKING ISNT FOR US   Why Im not excited about multitasking!  On iOS, OS X, Windows or any other platform, multitasking simply is not a good fit for humans. The reason is that while these operating systems might multitask and quite efficiently at times, humans and human brains more specifically, cannot multitask. Let’s take the typical working day. Let’s say that you finish eating lunch at home and get back in the car to drive to your office. On the way to work you remember that you have to pick up some groceries on your way back home. [toDoArray addObject:@”groceries”]; A few minutes later a call comes in and… Read More

Continue Reading

WWDC 2013 Videos of Interest

WWDC 2013 Videos of Interest Introducing Text Kit Advanced Text Layouts & Effects with TextKit Building User Interfaces in iOS7 Custom Transitions Using View Controllers Customizing Your App’s Appearance for iOS 7 Introduction to Sprite Kit Designing Games with Sprite Kit Getting Started with UIKit Dynamics What’s New in iOS User Interface Design Pretty much all the Whats New…

Continue Reading

Apple’s iOS7 and the future of development

Sure iOS7 brings a lot of technological advances. But more importantly, it sets a new precedent in the Software Development industry. Here are a reasons: 1). An Elite development team. Many people complain about Apple shutting out developers by not opening up. It’s funny because their code is open, you just have to be willing to pay. Where disgruntled programmers see disappointment, I see a company filtering an elite team of outsourced developers to keep pushing the envelope where only the savviest survive. 2). An evermore demanding market niche. I downloaded ios7 on Monday like most devs. The first thing I noticed was Skype crashing and Testflight failing to install.… Read More

Continue Reading

Cocos2d Tips: Design Game Objects for your game

Keep your game classes organized and logically ordered. Create a GameObject class, a GameCharacter class and then subclass these. Its important to keep your Game Objects ordered as well as your code.  The more you order your objects, the cleaner your code will be as well.  A GameObject is anything used in a game from labels to sprites to power ups. Its important to create a base class for all objects because, as a simple example, you want to be able to constrain all game objects to your screen.  Its not unthinkable to believe that at some point you might inadvertently cause a game object to be pushed off screen.… Read More

Continue Reading

NSOperationQueue & NSInvocationOperation

1. In your main class’ init method call this: operationQueue = [[NSOperationQueue alloc]init]; [operationQueue setMaxConcurrentOperationCount:1]; 2. Then in your viewWillAppear you can call this: [self showLoadingIndicators]; //calls a method which presents loading indicators (optional) [self beginLoadingTwitterData]; // this is the method that fires it all off 3. In your beginLoadingTwitterData you call this: NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(synchronousLoadTwitterData) object:nil]; [operationQueue addOperation:operation]; // creates and adds NSOperation to a queue [operation release]; 4. In this synchronousLoadTwitterData is where you do the heavy lifting: NSDictionary *dict = [[NSDictionary alloc] initWithDictionary:[TwitterHelper fetchInfoForUsername:[twitterIds objectAtIndex:count]]] // this calls for a method “fetchInfoForUsername” which returns an NSDictionary, but to do so, it connects to… Read More

Continue Reading

iPhone needs a Siri button

Apple’s iPhone desperately needs a Siri button! From the beginning of time (in other words, 2007), the iPhone has only had the Home button. Well, and yes, the Power button. Ok, ok, and the volume buttons! Throughout every iteration these buttons have remained constant. From time to time, the OS added varying functionality to these buttons such as Assistive Touch or Mute/Rotation Lock. But overall their main functionality remained the same. The bottom line is, there is a reason why mechanical buttons are limited in today’s touch era. Mechanical objects offer greater probability of malfunctions than do their digital counterparts. Case in point, the now ubiquitous and quite profitable iPhone… Read More

Continue Reading

Top Ten Mobile App Features

Feedback system Responsiveness Do one thing right Socialize & Gamify A few clicks Website match Analytics Off-line Customize user experience It’s a mobile device Every app needs to provide the user with a direct connection to the company’s customer service department Above all an app must be responsive and quick. The best app in the world is useless if it takes too long to open. Great apps do one thing and do it right! If you try to juggle too much functionality into one app, the user gets overwhelmed. The best way nowadays to keep users interested is to Gamify or Socialize. Gamify means give your users that carrot they… Read More

Continue Reading

GrandCentralDispatch & Blocks

GCD helps improve your apps performance and responsiveness by outsourcing processes that require a lot or computing power to the background while keeping your UI responsive.  Normally you might want to do some heavy lifting. Let’s create an Empty Application.  You need to declare a IBOutlet UIImageView *imageView ivar in your appDelegate, make it a property and synthesize it in .m and make the connection in Interface Builder, IB.  In it’s viewDidLoad method put the following code: // Download the image NSURL *url = [NSURL URLWithString:@”http://www.santiapps.com/assets/bbkoko.jpg”]; NSURLRequest *req = [NSURLRequest requestWithURL:url]; NSURLResponse *res = [[NSURLResponse alloc] init]; NSError *err = nil; NSData *data = nil; data = [NSURLConnection sendSynchronousRequest:req returningResponse:&res… Read More

Continue Reading

iOS App or Cocos2d Game Design – Grand Scheme

A lot of programmers that are entering the iOS application or Cocos2d game arena are somewhat confused about the overall scheme of things. They can’t see the forest for the trees. I’m a very visual learner myself, which actually makes me a rather bad programmer. Actually it makes me a bad programmer because I’m slow to pick stuff up. I need to see the big picture and then dive into the details, not the other way around. So I put together a simple image, for visual learners like myself, to understand how things operate. At this moment its a very simple image. I intend to update it constantly in order… Read More

Continue Reading

TexurePacker 3.0.1 is the best tool for sprite sheets

  Spritesheets are a must these days, what with having to include so much eyecandy now that games for iOS are getting so sophisticated.  Even if not for performance issues, spritesheets are great for simply keeping assets organized in a game.  Add to that the easy to use AutoSD option which makes your HD or Retina Display assets as well as the non-Retina assets easy to manage, TP is by far the best tool for the job. Whether you are a newbie or advanced developer, we highly recommend you pick it up asap.  You’ll see how easy it is to manage your assets and export them.  This is a tool… Read More

Continue Reading

Cocos2d Tips: Creating a Menu

You can create a menu by creating label items or image items and passing them to a CCMenu object. A typical MainMenuScene.m file might look like this: -(void)playScene:(CCMenuItemFont*)itemPassedIn { if ([itemPassedIn tag] == 1) { [[GameManager sharedGameManager] runSceneWithID:kIntroScene]; } else if ([itemPassedIn tag] == 2) { [[GameManager sharedGameManager] runSceneWithID:kSecondScene]; } else if ([itemPassedIn tag] == 3) { [[GameManager sharedGameManager] runSceneWithID:kThirdScene]; } else { CCLOG(@”Unexpected item. Tag was: %d”, [itemPassedIn tag]); } } -(void)displayMainMenu { CGSize screenSize = [CCDirector sharedDirector].winSize; if (sceneSelectMenu != nil) { [sceneSelectMenu removeFromParentAndCleanup:YES]; } // Main Menu CCMenuItemImage *playGameButton = [CCMenuItemImage itemWithNormalImage:@”TapMeToPlay.png” selectedImage:@”TapMeToPlay.png” disabledImage:nil target:self selector:@selector(displaySceneSelection)]; CCMenuItemImage *optionsButton = [CCMenuItemImage itemFromNormalImage:@”someImage.png” selectedImage:@”someImage.png” disabledImage:nil target:self selector:@selector(showOptions)]; mainMenu =… Read More

Continue Reading

Library compile error in XCode 4.5 for iOS6 regarding armv7s and armv7

Here are the resources you will need to fix your libraries.a which are not compiling for armv7s, into working compiling libraries: The post on how to do it: http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/ An article on how to modify your $PATH on your mac: http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/ Another article on how to edit your .profile hidden file: http://www.tech-recipes.com/rx/2618/os_x_easily_edit_hidden_configuration_files_with_textedit/ And this is the lowdown: You will basically have to create the .sh file & .c file mentioned in Matt’s post.  He then explains how to compile the .c and chmod the .sh. Then you must add these files to your path by either creating a .profile or adding this line to your existing .profile: PATH=$PATH:$HOME/afolderwhereyouplacedyourabovefiles # Add to PATH… Read More

Continue Reading

NSOperation

Lets say you are not only downloading tweets (text) from the web, but actual chunks of raw data, such as images. You may have a method that returns a UIImage, such as: -(UIImage*)cachedImageForURL:(NSURL*)url{ //Preferably look for a cached image id cachedObject = [cachedImages objectForKey:url]; if (cachedObject == nil) { //set loading placeholder in our cache dict [cachedImages setObject:LoadingPlacedholder forKey:url]; //Create and queue a new image loading op ImageLoadingOp *operation = [[ImageLoadingOp alloc] initWithImageURL:url target:self action:@selector(didFinishLoadingImageWithResult:)]; [operationQueue addOperation:operation]; [operation release]; } else if(![cachedObject isKindOfClass:[UIImage class]]) { //were already loading the image, dont kick off another request cachedObject = nil; } return cachedObject; } Except notice this time the operation is not… Read More

Continue Reading

No free lunch…

I started coding in iOS since 2009.  I do it part time because I have a full time job, so I dedicate about 3 hours a day, 5 days a week. I am a tech guy, always have been.  Studied Biochemistry and picked up ASP, PHP and moved into iOS.  But because I live in a country where technicians are highly undervalued, I got my MBA in 2000.  So I know a thing or two about how to run a business. So when I started meeting indies in 2009, I approached them and said, “I have some ideas for an app, is anyone interested in working with me?”.  Their response… Read More

Continue Reading

iOS UI Refresh

iOS is undoubtedly a great touch UI. However, it needs a refresh, it’s long overdue for an overhaul.  Not just a “new widget” type refresh but a real overhaul.  If we can make a robot that flies millions of miles to explore a hostile planet… SEARCHING FOR APPS The whole repetitive process of searching for apps in the AppStore, installing them, updating them everyday and switching between them is getting so old, so 2012! We’re are in the era of Robots that travel millions of space miles to do their thing. Robots that park cars, help the elderly etc. Our robots are getting smarter by the day. We need our… Read More

Continue Reading

Cocos2d Tips: Animations and image sizing

So you have some art but don’t know how to properly size it for the iPad or iPhone in their 2 versions (retina and non-retina display)! Let’s learn about image sizing and how to use these images in animations for your game objects (player, enemies, power ups or simple eye candy). Before we even get into creating animations, we need to clear up the sizing issue.  Currently there are 4 screen sizes: iPhone NonRetina = 480 x320 iPhone Retina = 960 x 640 iPad NonRetina = 1024 x 768 iPad Retina = 2048 x 1536 This means that when creating art for a game, you will go bonkers sizing images… Read More

Continue Reading

Cocos2d Tips: How to design a game coding strategy

Know you know quite a bit, enough to make a game. Do you know how and where to start? Let’s look at how to start coding your action layer, what code to put in what methods and how to keep your update method clean and tidy. When I started coding, and unfortunately most of my current projects are still coded that way, I simply opened up Xcode and started coding.  iOS apps are a bit better because you can use the “hooks” methods they come with such as viewDidLoad and cellForRowAtIndexPath etc.  Games are a bit more confusing because you are given an empty slate.  At least in Cocos2d you… Read More

Continue Reading

How to Read iOS or Mac OS Programming Documentation

The toughest part for me to get started was reading the Apple Documentation on iOS or MacOS. When I got into more APIs it got more complex. You need to understand how to read API or proprietary code documents in order to understand how to create a piece of code, connect to web services or debug changes in code. You will very often see the term DEPRECATED, which means a particular method name is no longer used. This is very important so let’s take a look at Apple Docs first: This tells us that the object of type NSArray has many methods that you can call on it. They may… Read More

Continue Reading

Passing Data Example

Delegates or Properties, take your pick. PROPERTIES Class A (ViewController) wants to communicate with Class B (ViewController) Before calling Class B, do the following: In Class B, create a @property NSString* receivedValue; In Class A, #import Class B then in the method that calls B (either prepareForSegue or didSelectRowAtIndexPath or some method where you present Class B view controller, do the following: Class B *calledVC = alloc/init calledVC.receivedValue = ‘whatever value you want to pass’; then call Class B VC Done!   DELEGATES Let’s say Class B wants to notify Class A that something has finished.  In Class B add this above your @interface: @protocol YourDelegateProtocol <NSObject> – (void)itemWillBePassed; @end… Read More

Continue Reading

NSCoding & NSUserDefaults to store something simple…

Lets say you created an app which lets you select a person from the Address Book and you wish to set that person as the default user to use each time you launch the app. You want to store that preference in NSUserDefaults. If there is a lot of data to that person, you probably don’t want to store each key, key by key…This is where you can modify your NSObject class to conform to NSCoding and quickly save & load your data. 1. In you NSObject Class add theprotocol. @interface CustomObject : NSObject <NSCoding> 2. Now add these 2 methods to your NSObject Class: – (void) encodeWithCoder:(NSCoder*)encoder; – (id)… Read More

Continue Reading

How to mask a UIImage in iOS

– (void)viewDidLoad { [super viewDidLoad]; UIImage *imageToMask = [UIImage imageNamed:@”koko.jpg”]; UIImageView *imageToMaskImgView = [[UIImageView alloc] initWithImage:imageToMask]; CGRect imgRect = CGRectMake(0, 0, imageToMaskImgView.frame.size.width, imageToMaskImgView.frame.size.height); UIView *maskMaster = [[UIView alloc] initWithFrame:imgRect]; [maskMaster setBackgroundColor:[UIColor whiteColor]]; [maskMaster addSubview:imageToMaskImgView]; UIGraphicsBeginImageContext(maskMaster.bounds.size); [maskMaster.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSLog(@”%@ is the view image”, viewImage); UIImage *bFooImg = [UIImage imageNamed:@”blackapple.png”]; self.myPic.image = [self maskImage:bFooImg withMask:viewImage]; } – (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage { CGImageRef maskRef = maskImage.CGImage; CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef), CGImageGetHeight(maskRef), CGImageGetBitsPerComponent(maskRef), CGImageGetBitsPerPixel(maskRef), CGImageGetBytesPerRow(maskRef), CGImageGetDataProvider(maskRef), NULL, false); CGImageRef masked = CGImageCreateWithMask([image CGImage], mask); //memman CGImageRelease(mask); CGImageRelease(maskRef); return [UIImage imageWithCGImage:masked]; }

Continue Reading

Cocos2d Games: PhysicsEditor & TexturePackerPro

Getting an app from idea to finished product is quite a drawn-out process.  As programmers we rarely accept the fact we need help, but thats when tools like these come in.  Tools like PhysicsEditor & TexturePacker are perfect for speeding up the development process of games so that you can focus on the tasks that matter most, the tasks that make a game a winner; game logic. Pick up these tools today, trust me, your expectations will be more than surpassed! http://www.texturepacker.com – The sprite sheet creator turns chaos into order http://www.physicseditor.de – Edit your physics shapes with ease

Continue Reading

Random yet helpful tips for Xcode 4.3.1

I’ve been learning a lot about tools for developing iOS apps and its amazing how much these tools, when you learn how to use them, can help you: Source Control Snippets Edit in Scope Speech Assistant Appirater TestFlight SDK Let’s look at these one by one: Source Control. This tool is for creating “Time Machine” like versions of your project as you progress through your project and make changes to it. The idea is two-fold: (a) Keep important subversions, i.e. version 1.0, 1.0.1, 1.0.5, 1.1.0 etc of your project as you make changes to it. And (b), share those versions with a team of developers so that you all have… Read More

Continue Reading

AppleTV & AirPlay: The future

What can you do with your AppleTV? Aside from streaming movies or buying movies online instead of the limited selection at your local store, you can do much more than watch movies. In it you can access built in apps like YouTube, Netflix, iTunes, WSJ, Flickr, etc. you can play iOS “AirPlay-enabled games” and access the web with apps like these: http://theapple.tv/apps/list-of-airplay-enabled-apps/

Continue Reading

XCode & Git

Ok, i just started getting my feet wet in this but here is the scoop! Git is a versioning technology which allows you to create multiple versions of your project much like TimeMachine on your Mac.  The whole point behind it is that at any time you can go back to a specific project mod and retake it from there. The first step is to GITTIFY your folder.  You can either do this manually from the command line or from Xcode by creating a new project and check marking the Use Git Repository option.  Since you are using Xcode simply check the box for Git in your new project. Now… Read More

Continue Reading

Use a simple NSNotificationCenter alert

The idea behind this is to notify one object/class of another object/class’ action. Thus you need the following: 1. A Class (A) whose object will register to receive notifications (be notified). 2. A Class (B) whose object will be doing something and when it finishes, must notify the other (post notification) Receiving Class A This class must cleanup its listening task so that when it is no longer active, the NSNotificationCenter will not waste time and resources notifying it about events it was once interested in. To do this simply add this to your dealloc method: //1. NSNotifCtr CLEANUP in viewDidUnload or dealloc [[NSNotificationCenter defaultCenter] removeObserver:self]; This class must actually… Read More

Continue Reading

AddressBook UI

Have you ever tried to get data fields from the address book and ran into the wonderful world of ABPerson reference only to find it reads like the blueprints to a space rocket? Here is the straight out code on how to do it: //Commented out code fails because the values are NOT STRINGS, but rather NSCFType) //NSString *fone = (__bridge NSString*)ABRecordCopyValue(person, kABPersonPhoneProperty); //self.telLabel.text = fone; //This on the other hand, does work ABMutableMultiValueRef phoneMulti = ABRecordCopyValue(person, kABPersonPhoneProperty); CFStringRef fone = ABMultiValueCopyValueAtIndex(phoneMulti, 0); NSString *foneObject = (__bridge NSString*)fone; NSLog(@”phone is %@”,foneObject); self.telLabel.text = foneObject; CFRelease(fone); //Haven’t tried with URL //NSString *url = (__bridge NSString*)ABRecordCopyValue(person, kABPersonURLProperty); //self.urlLabel.text = [NSString stringWithFormat:url]; //SocialProfiles… Read More

Continue Reading

Santiapps.com: Digital Graphic Design for newbies (noobs)

Wanted to share this tutorial for graphic design noobs that are interested in creating their own artwork for iOS games. You may indeed have some graphic design skills and some much better programming skills but turning your paper art into digital usable art is a whole new ballgame. Visit this tutorial in spanish, since this is a spanish blog: Diseno Grafico para Juegos Digitales (Principiantes)

Continue Reading

Facebook: Worldwide Genetic Experiment

What does the biggest social network share with the most global science field? Does the most complex web software have anything to do with one of the most complex fields in human nature? Is Facebook the world’s largest human genetic experiment? What do you get when you mount a huge amount of human relational information onto the largest, most accessible data depot in the world?  Ill tell you what you get…the biggest artificial intelligence in the world (since we are not sure about the universe’s size or the possibility of coexisting multiverse’s). Lets think about what Facebook contains.  On a personal level, it contains: Your name, face and personal likes… Read More

Continue Reading

Importing Box2D & Chipmunk into XCode

 am up to Chapter 13 and I have just finished RE-building my project because of minor details I may have omitted and Id like to share with you all and perhaps get cleared up: 1. Importing folders. When importing folders into Xcode, which Ive had experience with Coreplot, Facebook, twitter apis, json libraries and more recently Box2D and Chipmunk folders, there is a difference between copying and not copying if needed. I thought I understood the difference but Im not sure now. When adding a folder to your project, you add it via the finder first and then via Xcode. Lets take Chipmunk for example: a. You copy your Chipmunk… Read More

Continue Reading

Faulty Damaged iPhone Home Button Not Working

I’ve read many a posts… on many a forums… suggesting many a solutions… none have worked for me: press, hold and circle your finger around it a few times blow compressed air on the button and the pin connector shutdown this or that other applications…or all of them press power button til slide to shutdown, then press and hold the home button to reset it connect the cable and gently press the cable connector upwards…and downwards… all to no avail. and i dont have the option to return it cause its australian so a US store wont take it. I have recently noticed that when it is docked into my… Read More

Continue Reading

Box2D – Cocos2d – ObjC Complex Code Design

I got lost with a few kinks added in C10 and the vector stuff and c++ stuff in Ch11.   So Id like to review what is happening by the time we get to the cart that you can move via the accelerometer. 1. Before we only needed to add a cocos2d scene and then a layer to make a screenful of action.   With Box2D we must still create a Scene and Layer but we add the C++ format of Class.h & Class.mm  instead of just .m. We also added a query callback C++ Class that serves the specific purpose of  cycling through all bodies in the [b]box2d world?… Read More

Continue Reading

Power Hungry Devices

Its funny how capitalism leads to consumerism and that it turn, in a free democratic society, is fueled by our “NEED” for more and more services.  What this translates to is the fact that we want more and more “things” which we request from our technology.  So everyday we come up with things we want our phone to do for us.  First, the beeper simply sent us text messages for us to get to a landline and call.  Then it allowed us to answer text messages.  Soon after came the cellular phone and we didn’t have to go to a landline, we could simply call on the mobile phone.  But… Read More

Continue Reading

Apple: The future of computing

It’s no secret Apple’s MBA is a great form factor; the thinnest computer ever with some nice muscle. Specially now with the i5 processor. The SSD/Optical-less wonder has convinced users that cloud computing is not only the future, but that it’s also actually feasible. For years Mac OSX has been the most stable, user friendly commercial OS which has set the groundwork for the birth of iOS. Along comes iPhone and iPad and they convinced users that iOS is a powerful enough OS to power the future of computers. Add to this mix a great combination of SSD-AlwaysOn, the virtually endless capacity of traditional HDD drives with a splash of… Read More

Continue Reading

Social Media Underwater…

I love technology…and I love scuba diving…But have you ever thought about how unlucky underwater creatures are?  Or will be? Certain dogs already have special collars that tweet or post their location to Facebook.  Im sure that eventually social media/web technology will evolve to include such animals into real world social gaming.  Many believe web technologies can soon connect humans to many kind of animals in air or on land…How unlucky are their underwater counterparts who simply could not, due to the fact that they live in an electrically conducive medium which automatically discards the possibility of them having electronics? Then again, some electronics such as beacons (radio transmitters) are… Read More

Continue Reading

Twitter, Facebook & Google Plus Integration

Twitter Twitter allows you to update your Twitter timeline by sending an email to a secret address. So go to TwitterMail.com and sign-in with your Twitter account credentials. In the Twittermail tab, find a button to setup your Twittermail account. Now simply, press the button “Set up your twittermail account now”. In this Twitter setup page there is a unique email address which has been assigned to you to send the updates. Now, when you wish to share a post in Twitter from your Google plus profile, just add that email address in the visibility box along with other circle(s) and share the post as usual. To avoid having to… Read More

Continue Reading

Android vs iOS

A friend of mine recently send me an email with this link from extremetech.com listing the 5 Android features that leave iOS in the dust.  Here are my thoughts in response: 1.  Homescreen/widgets.  These drain battery life, which is why iOS doesnt have them.  I’ve been learning to code in Android and their OS can run as many background services as apps that contain them.  This drains battery and consumes bandwidth. iOS’s solution is APNS or push notifications which a server running on the internet can send to the device instead.  Its not as fancy as Android, I agree, but ill trade it for battery life anyday.  When hardware manufact… Read More

Continue Reading