Showing posts with label wireless. Show all posts
Showing posts with label wireless. Show all posts

Friday, May 5, 2017

ESP8266 IR Remote

Control your appliances (e.g. TV and AV systems) via WiFi+IR.




Arduino code:


References:
markszabo/IRremoteESP8266
Sony IR codes
Sony SIRC protocol





Sunday, January 29, 2017

WiFi RGB Matrix

Here's a DIY flexible 36x8 RGB-LED-matrix controlled via WiFi connection using an ESP8266 module.



Arduino Code: julznc/wifi_rgb_matrix


Assembly:

References:
NeoPixelBus - for interfacing WS2812 LEDs to ESP8266 controller
Adafruit-GFX-Library - with font library for displaying texts
LED Matrix Studio - for creating bitmap images

Saturday, January 9, 2016

Intel Edison: LED Blinker

Here's a "hello world" test application for Intel® Edison Compute Module. As what the title says, it's just a simple LED blinker task executed by a fast processor.


Below is the tiny module powered by Intel Atom dual-core processor at 500 MHz, with 1 GB DDR3 RAM, 4 GB eMMC Flash, Bluetooth 4.0 and Wi-Fi. It runs Yocto Linux (Linux 3.10.17-poky i686).


Some Intel Edison breakout boards that are shield-like (can be stacked on each other) are also already available on SparkFun. Most useful one is the base block which is used for connecting the Edison module to the host PC via USB. This block has two mini USB ports. The first port is an OTG type and is primarily used for flashing firmware/image of the Edison. The other one is an FTDI-based USB-to-Serial which is used for connecting to a host's serial terminal/console.


Initial configuration requires the Edison module to be connected to a serial terminal, like putty (sample boot log). After configuring the WiFi and the root's password, it is now possible to access the module remotely using ssh connection, just like in the demo video above.

The code below is a simple C++ code for blinking an LED connected at GP14. The code depends on mraa low level library to access the GPIO hardware.
/* intel edison led blink - yus 20150109 */

#include <mraa.hpp>
#include <iostream>

int main()
{
    mraa::Gpio *gpio = new mraa::Gpio( 36 /*=GP14!*/ );
    if (gpio && gpio->dir(mraa::DIR_OUT)==mraa::SUCCESS)
    {
        std::cout<<"Blinking GP14. Press [CTRL+C] to stop...\n";
        while (1) {
            gpio->write(1);
            sleep(1);
            gpio->write(0);
            sleep(1);
        }
    }
    return -1;
}

The provided Yocto Linux installed in the Edison already includes a GNU toolchain (GCC 4.9). So the demo code  can be compiled/build inside the Edison itself.


Alternatively, a BASH script can be also used to do a LED blink task.
#!/bin/bash

# select led pin
pin=14

gpio=/sys/class/gpio/gpio$pin

if [ ! -d "$gpio" ]; then
    echo $pin > /sys/class/gpio/export
fi

echo out > $gpio/direction
echo Blinking GP$pin. Press [CTRL+C] to stop...
while :
do
    echo 1 > $gpio/value
    sleep 1
    echo 0 > $gpio/value
    sleep 1
done

Also, for those who are comfortable developing with Arduino IDE, the Arduino IDE also supports Intel Edison. However, you need to check the correct pin mappings if you're going to use boards other than Arduino's Edison kit or Edison breakout board.



References:
Edison Getting Started
Edison GPIO block
Flashing Firmware
mraa low level library

Wednesday, February 15, 2012

Bluetooth Joystick



Android Bluetooth Dual-Joystick Controller

Sends 5 bytes every 200ms (or every 3 sec if idle).
data format: [ STX : radiusL : angleL : radiusR : angleR ]
where: STX = 0x55
           radius = {0..10}
           angle = {0..35} (or actual/10)

sample:

will send [ 0x55 : 0x0A : 0x12 : 0x05 : 0x09 ]
(**left-joystick is pulled backward; right-joystick leaning to the left)

Source code:
svn co https://yus-repo.googlecode.com/svn/trunk/Android/apps/btjoystick

Installer: BTJoystick.apk .

Joystick widget from Mobile-Anarchy.


demo on my quadruped:


#---------------------------------
edit 10/15/12
version 2: BTJoystick.v2.apk   45.8 KB



modifications:
* preference menu (e.g. "Menu->Connect" & "Menu->Options" )
* add four customizable buttons (send either an ascii char or a string)
* immediately send joystick data when a joystick returns to center position
* selectable data format, intervals and timeout
* prevent accidental closing



Thursday, February 3, 2011

MARG sensors + Bluetooth

MARG (Magnetic, Angular Rate, and Gravity) sensor array used for AHRS (Attitude and Heading Reference Systems).



Android OpenGL 3D display on Samsung Spica (i5700).


Sparkfun 9DOF sensor stick SEN-10389, later replaced by SEN-10321.

Using ATmega328P, operated at 3.3V supply and 8MHz crystal. At this speed, reading sensors' measurements and computing "AHRSupdate" take about 31ms to complete. Default compiler setting is used on WinAVR. With 25Hz sampling rate, this leaves mega328p extra 9ms to do other tasks. Bluetooth SPP (serial) communication is buffered and interrupt driven, so no processing time is wasted in reading and sending data to the android phone.



References:
(1) Sebastian Madgwick's Alternative AHRS (MARG) algorithm - Quaternion implementation of Mayhony's DCM filter incorporating magnetic distortion compensation.
(2) Fabio Varesano's FreeIMU. Also using Madgwick's implementation of the DCM filter on Arduino platform.
(3) Rotation convertions by Martin Baker. Very good discussion on quaternions and other 3D representation like Euler angles and transformation matrix.
(4) OpenGL Transformation Matrix by Song Ho Ahn
(5) Similar discusion on diydrones.com started by Harinath

Android project examples:
Android Bluetooth
Bluetooth Chat
Android OpenGL Projects
OpenGL ES tutorial
Android Bluetooth Oscilloscope

Special thanks to the generous guy who gave me these toys, Thank you very much!


Wednesday, January 19, 2011

Thursday, September 23, 2010

Android Bluetooth Oscilloscope


*This application is tested only with Samsung Galaxy GT-i5700 Spica (rooted Android 2.1 OS, i570EXXJD1 Baseband version).
The transmitter circuit uses Microchip's dsPIC33FJ16GS504 for the analog-to-digital conversion of the input signals on two channels. The processed data on the dsPIC are then transmitted to the phone (for waveform display) via the LMX9838 bluetooth SPP module.


specs/ranges:
  • time per division: {5us, 10us, 20us, 50us, 100us, 200us, 500us, 1ms, 2ms, 5ms, 10ms, 20ms, 50ms }
  • volt per division: {10mV, 20mV, 50mV, 100mV, 200mV, 500mV, 1V, 2V, GND}
  • analog input (depends on external pre-amplifier configuration): {-8V to +8V }


The source codes for the bluetooth communication is based on Bluetooth Chat example from http://developer.android.com. That example contains three java source files. And, I've completely copied the "DeviceListActivity.java", which is used for searching remote bluetooth devices. Then I've modified the "BluetoothChatService.java" to use only the RFCOMM Client functions, and used the well-known UUID "00001101-0000-1000-8000-00805F9B34FB" for the Bluetooth RFCOMM/SPP.
 
For the plotting of waveforms, I'm using SurfaceView object to draw on its canvas. This tutorial found on www.helloandroid.com helps me a lot for this task: "How to use canvas in your android".



The rest of the job mainly involves porting of my previous Python S60 script to JAVA language. It was too painful on my side, because I had to convert a single script file to multiple java + xml source files! Nonetheless, it was a good experience for me on learning the Android SDK (JAVA programming).

Project source codes for Android and dsPIC (with APK and HEX) :
AndroidBluetoothOscilloscope.zip

Electronicslab.ph forum link : Android Bluetooth Oscilloscope

Here are some interesting projects that are also based on the Bluetooth Chat example:
Bluetooth Controlled Model Car
SPRIME

Special thanks to:
Samdroid Forum  for the customized/rooted firmwares for our Spica.
Tipidcp Spica users for sharing their tips and experiences with this android phone.

----------------------------------------------------------------------
#edit (10-15-2010)
Here's now my circuit. Nothing special on it, all are based on existing circuits.

*The dsPIC I have used is most probably NOT the best choice for this project because of the many left unused peripherals (extra pins). But, this is the only part readily available in my bin and it has the fastest ADC (2 x 2MSps) among the chips I have.
*If you prefer to change the input range via the op-amp preamp, the computation is located on the "adc.xmcd" file.
*You can use other SPP bluetooth modules aside from LMX. (accdg to manufacturer, it's already obsolete)

----------------------------------------------------------------------
#edit (9-14-2011)

It's almost a year now, and yet some people are still interested in this project (considered to be obsolete). So I've decided to place the source repository also on Google Code site. You can either Browse or use git to have your own local copy:

   git clone https://code.google.com/p/android-bluetooth-oscilloscope/

See also the Changes, if you want also to learn on how to modify the code. I've started the first 'commit' with a simple "hello world" from the SDK project template. And then changes were made until the desired final oscilloscope application is achieved.

Sunday, June 27, 2010

Bluetooth Controlled Mobot

Bluetooth Controlled Mobot using Z8F0823 and LMX9838.

It's supposed to be my entry for a friendly competitions of "sumobots". But, I wasn't able to make it "autonomous" on time for the event. It only have four sensors on each corner to detect "black" lines, but no sensor for detecting an opponent. And so that I can still test the hardware, I just made it manually controllable by using my phone's bluetooth. The bluetooth module is the same circuit I used in my BT minibot . I also used the same python S60 script for my N6120c (Symbian phone) controller.











forum link: Filipino Version of Robot Wars

Saturday, September 19, 2009

Wireless LCD

Wireless LCD using Nokia 6100/6610 colored LCD, National Semiconductor's LMX9838 Bluetooth SPP module and Zilog's Z8F082A MCU.

demo:

more info: Wireless LCD

Tuesday, September 15, 2009

Wireless Oscilloscope



Wireless oscilloscope using Nokia 6120 Classic, National Semiconductor LMX9838 Bluetooth SPP module, and Microchip dsPIC33FJ16GS504.





forum link: Re: Wireless Oscilloscope

Monday, September 14, 2009

Bluetooth Controlled mini-MOBOT





Bluetooth remotely controlled mini mobot (version 2) using Zilog's Z8F082A and National Semiconductor's LMX9838 (Bluetooth® Serial Port Module) with Nokia 6120 classic as remote controller (using Python S60)