Google+
Showing posts with label device. Show all posts
Showing posts with label device. Show all posts

Monday, 23 June 2014

Program your Arduino with an Android device!

Hi,
in this Instructable I want to show you, how you can program your Arduino with your Android device. It is very simple and cheap. Also it allows us to program our Arduino where ever we want, this is usefull for permanently installed Arduino boards, like in light controllers...
So lets get started! :)


Step 1: Materials and Tools

Materials:
A USB-Host cable (OTG cable) ( http://www.amazon.de/USB-OTG-Adapterkabel-Adapter-... )
An Arduino( http://de.farnell.com/ )
1 LED (for testing)
A Android device with Android 4.0.0+ (or with host aviability)
Software:
ArduinoDroid or
ArduinoCommander from the Google Play store

Step 2: The USB-Host cable

Such a USB-Host cable is basicaly just a USB cable, but just with a few changed resistors in the mikro USB plug. The internal resistors let the Android device activate the USB-Host mode, in this mode you can also use USB-Sticks or other usb applications on the device. That is very useful, now you could plug a usb-printer in.
The problem is now, that every USB device which you plug in, will now run on the energy of your device, what realy can bring the akku down.

Step 3: Connections

This step is very simple and doesn´t require much text. Just plug the USB-A to USB-B cable into the female USB of the Host cable. Then plug the USB-B plug into the Arduino and the Mikro USB into the Android device.

Step 4: Arduino power up

Now it should look like the connections on the picture. Also your Arduino should now power up and load the last code you uploaded. On my Arduino was the Blink sketch. If it doesn´t power up, check connections.

Step 5: The apps

Now your Arduino is ready to get coded, but your Android device isnt...
Lets change that!
Currently there are 2 apps which allow us to work with our Arduino via the Host mode.
To get them we have to go to the Play Store, then type into the search bar "Arduino". Now tap on "Apps", now there should be only apps. We want the apps "ArduinoDroid" and "ArduinoCommander". Install them and launch "ArduinoDroid", it has to update the IDE, that will need some time. "ArduinoCommander" should be ready sofortly.
Note: We dont need both apps, i just want to show you both! :)

Step 6: ArduinoCommander by Anton Smirnov

Okay, the first app I want to show you is "ArduinoCommander". It is by Anton Smirnov and is for Andorid 2.2 or higher.
This app is for working with the Arduino on an Android device, you can change pins easy (directly set pins hight or low), upload sketches or read analog pins with a oscilloscope mode.
The app is easy to understand, even if the controlls are unusual. It finds the Arduino automatical and doesnt crash.
But sadly some of the functions didnt work when i tried to use them, hopefully that get fixed. Uploading a sketch worked very good!
So I would give this app 4.0 out of 5 stars :)
I want to show you short how you can connect to the Arduino:

Step 7: Step 1

First we have to start the app, now a blue window wih 4 options should appear. As we want to connect via USB we tap on "USB-Device" (on the picture in german :) ).
Other options are:
Ethernet
Bluetooth
USB-extras

Step 8: Step 2

Now tap on "Autodetect", the Android device will now scann for Arduino(s) nad show them on the screen. We will pic our Arduino ( just tap on it ).

Step 9: Step 3

After we did that the app will now show us our Arduino as a drawn animation. Normally it is colored and you can tap the pins, to change their mode. This didnt work for me, sadly i couldnt fix it for me, maybe it works for you. when you tap in the down right corner you get to the menu, where you can upload sketches from your SD-card, what works very well.

Step 10: ArduinoDroid

Now the seccond app, which allows us to upload sketches to our Arduino. This app is called "ArduinoDroid" and is for Android 4.2.2 or higher. It is also by Anton Smirnov!
This app is an IDE, a compiler and an uploader for Arduino, it also uses the host mode to upload sketches, which you can write directly in the app.
After you wrote a code, you can compile it with the "Lightning-Button", that needs some time, but works good.
when its compiled you can press the upload button (the to the right).
The upload should take only secconds.
After that my Arduino started the new code --> It worked very good!
For testing I used the "Blink" sketch.
Why am i talking?! here is a short video of the app compiling and uploading a sketch:

Step 11: Finishing!

As you just saw, it is very easy to write, compile and upload a sketch to an Arduino with an Android device.
And here a big THANK YOU to Anton Smirnov who created the apps for Android!
Read More


Wednesday, 12 February 2014

Single digit numitron clock

Numitrons are neat display devices similar to nixie tubes but designed for much lower voltages. Numitrons are basically incandescent displays in which filaments create the segments.
They have a retro look that i liked so much. I bought 6x IV-9 russian numitrons in ebay, they were about 3$ each, they're pretty cheap!
At that time i didn't know what to do with them, but then i thought about a clock. Using software from a single LED display clock i made this impressive numitron clock.

Step 1: Program the PIC

The original purpose of the software was to drive a single common-anode LED display rather than a numitron, but either way works.
The software was modified to flash the digits so the HHMM LEDs wouldn't be necessary. Also the software was modified so if the tens of hours is 0 then it is not displayed.
Moreover, the software does not check the input values so entering the wrong time such as 67:85 would be accepted, but eventually the clock will start resetting the digits correctly.
The clock operates off a PIC 16F84A using a program written by David Tait (software is further down this page). The crystal oscillator for the clock is a 4MHz crystal.
I think another microcontroller such as PIC16F628A could also work fine.

Step 2: The circuit

After testing on the breadboard,  the clock works fine, with the current crystal the clock comes forward a minute each 3 days, with a precision one it can be solved, but it's good enough for me; because setting time is easy.
You can see the test video below and download the eagle schematic to modify it.

Since numitron displays are just complex bulbs, it could be a problem to drive them from the processor, but in this case, it's not a problem:
The PIC16F84A can source or sink 25mA per I/O pin.

But each port has a limit:

Maximum current sunk by PORTA-80 mA
Maximum current sourced by PORTA-50 mA

Maximum current sunk by PORTB-150 mA
Maximum current sourced by PORTB-100 mA

With IV-9/IV-16 each segment draws 20mA, but be careful if you choose another numitron!

Step 3: PCB design

The board measures about 4x3cm (1.6x1.2inches).
it could be way smaller with all components in smd version and onto a double-layer board; but the design i made is the easier/cheaper one.

The board i made the clock with was later modified and optimized.
I used 4 resistors for the HHMM LEDs when a common resistor would do the trick.
I also used a header jumper to switch on or off the numitron, but it turned out that the microcontroller sank the current through ''off'' pins, dimly lighting up some segments.

You can use the PDF to make the circuit with the toner transfer method (see http://www.instructables.com/id/PCB-making-guide/)
Or order it with the .BRD file.

Step 4: Populating the PCB

After drilling the holes and tinning the pads, it's time to populate The PCB.

You'll need the following components:
-PIC16F84A microcontroller (or compatible)
-18 pin DIL socket
-IV-9 or IV-16 numitron (or one of your choice, but check pinout!)
-4 LEDs (just check if they fit)
-4MHz crystal
-2x 470ohm 1206 SMD resistors
-1x 1K5 1206 SMD resistor
-2x male header, or the power input you want
-An SMD capacitor, just for filtering, no matter the value.

First solder the wire jumpers and the SMD components, then the rest. Do it as shown in the diagram (the .BRD file)
Solder just the socket without the PIC in!

If you're using IV-9 or IV-16 numitron, bend the leads as shown in the picture. If you use another numitron, see the datacheet and check if it is pin-compatible, if not, you can edit the PCB or bed the leads as needed.

Step 5: Ready to use

After plugging it, it should display 12:00, set the time by pressing the button when the digit you want to change  is being displayed.
If you press the button during power on, it will enter in test mode.

I can't wait to see how you've done.
If you have any problem or doubt, feel free t ask me.
If someone wants the clock in the video, i would accept 20$.

If you've liked this instructable, please vote me for the Supercharged, 123D Circuits and Spring's Coming contests.

Read More


Join Us

//go.ad2up.com/afu.php?id=25365

© Copyright 2012, Design by Lord HTML.