SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Jul 18, 2011, 10:24 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Build Log
Diy osd (Arduino and opensource)

As this project is almost finish, I think it's time for a little update/summary here in post #1.

Lets start with a little video-clip showing the OSD in action
DIY OSD flight test (software v 0.14) (3 min 5 sec)


The main purpose of this project was to make a DIY OSD that can be made with;
  • Opensource software
  • Simple and cheap hardware
  • Only little technical knowledge required

It's not intended to be a graphic-heavy OSD, but an easy readable OSD with the most important info. But it's opensource and you can do whatever you want with it.

Quite a few updates and features have been added by request from users - and I hope to continue this. Feel free to post suggestions - but be reasonable. I don't mind to implement a feature - but I'm not gonna rewrite it all for another purpose etc.

I decided to make this project freely available and opensource - and I don't plan to earn anything on my work. Neither do I intend to sell or produce anything - but others are welcome to use it as they want.

If you don't want to make the hardware yourself the software also supports SimpleOSD OPEN (16 mhz with arduino bootloader and LM1881 sync seperator). It's should be available from here:
http://flytron.com/osd-headtrackers/...uino-boot.html

The OSD support theses features at the moment:
  • Easy hardware design with Arduino
  • Easy setup section added to code
  • Speed from GPS
  • Altitude from GPS
  • Flight timer from GPS
  • Position from GPS
  • Heading from GPS
  • Current from current sensor
  • mAh used
  • Auto set home position
  • Calculate Line of sight
  • dimming of text background
  • Arrow pointing home
  • Speed in km/h
  • Flight summary (max altitude, max speed, max LOS, total distance traveled and average speed)
  • Support NTSC and PAL
  • Support SimpleOSD open 16 mhz version with arduino bootloader

This is the schematic I use at the moment (Please note, AIN0 and AIN1 is NOT pin A0 and A1 on Arduino).


Same schematic but with a bit further explanation/text by Enthlapy (Dimming/brightness resistor value is a bit different, but you can just change these to what you prefer).


Fritzing-drawing, made by thnilsen


Old first post:
A work in progress. This post will be updated with more pictures text etc. Please be patient

A few weeks ago i started to play with a DIY-OSD. There is a lot of commercial OSD's available, but I figured it would be fun to make one myself. I wanted to make the hardware as simple and cheap as possible, so everything has been made using only an atmega micro-controller and a few standard components (resistors, capacitors and diodes). This makes it possible, to build an OSD for less than 10 $ (without GPS and current sensor).

I have chosen to make it all compatible with Arduino – so the code can be used directly with a simple arduino board, atmega with bootloader etc. This makes it pretty easy and cheap for everyone who wants to try it out. No SMD components or extra chips are needed.
At the moment it works just fine, and only LOS and an arrow home needs to be added (this is now done).

So far it has been made for a PAL video signal, but it shouldn’t be very difficult to make it compatible with NTFS.

In general;
A normal analog video-signal can be seen here;

The start indicates that a new line is starting and the variation in voltage is simply a way to express the color. A high voltage (about 1 volt) equals white and lower voltage is darker. Please see Wikipedia for further info on PAL/NTSC video signal.
http://en.wikipedia.org/wiki/PAL

The trick is to detect a new line, count the lines and show the pixels at the right time.
And off course reset the linecount when a new frame is detected.

The hardware:
The hardware is based on an atmega micro-controller and only a few normal components. New line and frames are detected with the analog comparator in the atmega mikro-controller.
As the sync pulse in the video-signal can have a little DC-offset, a few components is needed. To control this offset, the video-signal is AC-coupled. The sync-pulse will then be a negative voltage. To change this, you can add some DC-offset with a positive biased clamping circuit;
http://en.wikipedia.org/wiki/Clamper_%28electronics%29
It's now possible to get a positive video-signal where the sync-pulse is very close to ground. The voltage reference should match the biased video-signal’s synch pulse.
In theory you can bias the video-signal so the sync-pulse goes a bit below ground. This makes it possible to use ground as reference voltage. I have tried and it seems to work fine, but I wouldn’t recommend it.
To show the pixels you can use SPI or USART to shift out pixels very fast. The USART in SPI mode works perfect as it is double buffered. The problem is that you probably want to use the USART for communication with a GPS module. I don’t think the USART pixel generation is of any interest, but I have the code if anyone wants to see it. The SPI is only single buffered (8 bit) so you will have about 2 clock cycles (1 ekstra pixel) that will be the same as the last one, but this is only a minor issue.

The brightness is simply adjusted with a resistor. To avoid the pin from draining a simple diode should be used as well.

Test-video
OSD test (0 min 19 sec)


First test with Arduino duemilanove


A breadboard test;


Simple print-test;


An early test from the breadboard;


Another example. Can't decide if I want to use small or large numbers. Any preferences?
Might add a smaller resistor to make the text brighter.


Later breadboard version.


I plan to use this little arduino pro board. That should make a really small and simple OSD.


Prototype finished;




The circuit at the moment;
C1 = 0.1 uF
R1 = 50 K pot
It might be a good idea to lower R2.


Made so far:
  • In general the hardware is finish and works
  • Working OSD
  • Small ASCII table
  • Communication with GPS
  • "Extracting" data from GPS strings
  • Speed from GPS
  • Altitude from GPS
  • Time from GPS
  • Position from GPS
  • Heading from GPS
  • Current from current sensor
  • mAh used
  • Set home position
  • Calculate Line of sight
  • dimming of text background
  • Arrow pointing home
  • Speed changed from knots to km/h
  • Flight summary added (max altitude, max speed, max LOS, total distance traveled and average speed)
  • Support for NTSC and PAL
  • Support SimpleOSD open 16 mhz version with arduino bootloader

Should be finish soon
  • ...

Ideas for improvement:
Notes to the code;
The code for writing characters, numbers etc. is currently not very flexible if you want to re-arrange the text, numbers etc. As I don't plan to re-arrange the text I don't really care, but a "cleaner" solution could probably be implemented.
The main problem is, that timing is very critical. Even the use of while-loops instead of repeating makes a big difference. While-loops takes quite a few clock-cycles, which is clearly visible.

The code can be opened with notepad++ or Arduino IDE. Please rename to .pde instead of .txt when using with Arduino.

use of the code;
The code can be used as you want. Feel free to change, update delete etc.
Use of the code in a commercial product is welcome as well - but it would be great to know.

GPS:
The software have been written and tested with a MTK GPS and 2 GPS-simulation programs. The software should more or less work with all GPS'es, but I don't guarantee anything. It's recommended not to use lower than 1 hz update rate, and it's preferable to configure the GPS to only send RMC and GGA NMEA strings.







version 0.04;
  • Speed changed to km/h
  • Number of satellites added
  • Now only "active numbers" will show. This means 5.5 meter altitude will show as 5.5 and not 0005.5. Speed will show as 10.5 instead of 010.5. Done with speed, LOS, altitude, current and mah consumed.
  • Altitudes higher than 999 meters will now show as xxxx.x instead of xxxx.

Version 0.05
  • Support for SimpleOSD 16 mhz
  • Voltage and current input can be choosen in beginning
  • Battery voltage added
  • A few danish comments translated/removed
  • Few minor changes/cleaning in code

Version 0.06
  • Flight summary added with:
  • Max altitude
  • Max Speed
  • Max LOS
  • Total distance traveled.
  • Flight time
  • Wrong baud-rate settings will no longer crash the controller

Version 0.07
"look" changed - and some minor changes.

Version 0.08
Small bug fixes from version 0.07
  • Black line removed
  • total distance up to 99 km supported
  • Error in total distance calculation corrected

Version 0.09
  • GPS code updated
  • LOS and heading should work for everyone (no matter location)
  • Alarm function added on LOS, altitude, battery-voltage and mah used
  • Avg speed added to flight summary
  • Baud rate can be set in the setup-section (by just writing 9600 etc)
  • The line where analog-readings and current calculation is done have been added to #define line section
  • corrupt serial data will no more "fill the buffer" and block valid data
  • Topline moved a bit, might help NTSC users.

Version 0.10
  • NTSC support (line numbers from Melih used)
  • mah code updated to support timing in NTSC video signal
  • In setup it's only necessary to choose controller and video system (PAL or NTSC)
  • The input used for current-sensor and voltage-divider can be set by just writing the pin-number
  • Calibration for voltage-divider added to setup-section
  • Dimming added to SimpleOSD version (thanks Melih)

Version 0.11:
  • Auto altitude offset added
  • No altitude info from GPS (with altitude offset on) will no more show as 6220 meter (thanks to mrfliboy - noticed this on his movie)
  • Maximum speed in summary should be fixed (showed a weird string now and then)
  • Parameters added to flight summary, it's now possible to choose when flight summary is displayed
  • Couple of small changes
  • CUR and VLT replaced with A and V. What do you prefer?

Version 0.12:
  • Start-up screen added. Shows number of satellites, sat-fix, delay (from sat-fix to set-home) and the time (this can be used to check if the gps update-rate is right)
  • Possible to hide GPS-coordinates if altitude > x (but can be set to show every x second anyway)

Version 0.13
  • Some of the code changed a bit and re-arranged to be more efficient.
  • Option added to "align" text - all the text can be moved left and right to fit/center perfect
  • Summary centered

Version 0.14
  • Now possible to show mah / km - can be used to find optimal cruise speed etc. (need to be turned on under setup)
  • Speed/altitude decimals can be turned off in setup
  • Minor fix with GPS-coordinates that was alligned wrong (when using hide when over x meter and only show every x second - guess no one have discovered this yet)
  • Example added to config "show summary" for plane and quad
  • Dimming added to text
  • Delay for align screen moved - gives quite a few more clock cycles for every line for anything else

Version 0.15
  • Menu added (configuration also saved when power-off)
  • Support for US units (altitude offset must be on)
  • Dimming removed from top characters (when showing decimals)
  • Version-number added on startup-screen
  • Plane-position can be shown (in degrees)

The menu will allow you to change these settings:
  • Show mah/km (on/off)
  • Show decimals (on/off)
  • Text alignment to center text
  • Show plane position (on/off)
  • Altitude alarm (set value)
  • LOS alarm (set value)
  • Volt alarm (set value)
  • mAh alarm (set value)
  • Arrows updated a bit
  • The word "max" was bugged in summary - now fixed
  • Menu and start-up screen fixed a bit (only look)
  • A little more free space available.

Version 0.16
  • Arrows updated a bit
  • The word "max" was bugged in summary - now fixed
  • Menu and start-up screen fixed a bit (only look)
  • A little more free space available.

Exit must be chosen to save data. All data will be saved to eeprom, so they will stay until new data is written.
First time you load the new firmware the settings will be saved to the eeprom.
Even if you reload/flash the software the old values will be saved. If you want to update the values there is an option in the file to overwrite previously data. Just be sure to change the value back to 0, otherwise settings will be reloaded everytime.

Version 0.17
  • RSSI support added (can also be used to read voltage on second battery etc)
  • If alarms are set to 0, they will be off
  • Bug with negative altitude showing an arrow instead of minus is fixed

Version 0.18
  • Updated for Arduino IDE v 1.0
  • Splitted into multiple files and cleaned a bit
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Apr 20, 2012 at 03:55 AM.
Reply With Quote
Sign up now
to remove ads between posts
Old Jul 18, 2011, 10:28 AM
Don't leave it Stock
mrfliboy's Avatar
USA, IL, Round Lake
Joined Feb 2004
2,514 Posts
Very nice!!
mrfliboy is online now Find More Posts by mrfliboy
Reply With Quote
Old Jul 18, 2011, 10:28 AM
Registered User
Joined Sep 2001
6,190 Posts
Subscribed.
cactus is offline Find More Posts by cactus
Reply With Quote
Old Jul 18, 2011, 10:29 AM
Registered User
GregSilver's Avatar
United States, FL, Plantation
Joined Nov 2005
655 Posts
awesome.... please keep this project updated. I have a little exp. with arduino and would love to follow your steps!
GregSilver is offline Find More Posts by GregSilver
Reply With Quote
Old Jul 18, 2011, 10:49 AM
Registered User
mark the shark's Avatar
United Kingdom, England, Darwen
Joined Aug 2007
595 Posts
Very nice..
mark the shark is online now Find More Posts by mark the shark
Reply With Quote
Old Jul 18, 2011, 11:07 AM
Registered User
Österreich, Burgenland, Eisenstadt
Joined Aug 2010
40 Posts
Cool, I'm in! Seems to be the perfect project after MultiWiiCopter
maexx is offline Find More Posts by maexx
Reply With Quote
Old Jul 18, 2011, 11:15 AM
Bugs!!!!!!!
viper6549's Avatar
USA, OK, Wayne
Joined Sep 2009
222 Posts
Sweet, I would love to have a peak at the code.
viper6549 is offline Find More Posts by viper6549
Reply With Quote
Old Jul 18, 2011, 11:56 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
There seems to be quite a few interested, great

The code is not too pretty, but it's well commented.
I will upload the current version shortly.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 18, 2011, 12:01 PM
aka Nigel Uno
Italia, Lazio, Monterotondo
Joined Sep 2004
364 Posts
Nice work!!

Ciao

Luca
gtrick90 is offline Find More Posts by gtrick90
Reply With Quote
Old Jul 18, 2011, 12:22 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Code has been attached. I haven't done any cleaning yet, but feel free to take a look

New image attached as well.
Should I go for small or large numbers?
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 18, 2011 at 12:33 PM.
Reply With Quote
Old Jul 18, 2011, 02:15 PM
Registered User
charlienofun's Avatar
United States, CA, Santa Clara
Joined Mar 2008
374 Posts
Subscribed.
charlienofun is offline Find More Posts by charlienofun
Reply With Quote
Old Jul 18, 2011, 02:30 PM
Registered User
Joined Sep 2001
6,190 Posts
Quote:
Originally Posted by maexx View Post
Cool, I'm in! Seems to be the perfect project after MultiWiiCopter
+1. There is currently only one OSD using the Gyro and ACC data from the MultiWiicopter to show an Artificial Horizon. That one is closed source and there is not much documentation on it and it's very pricey.
Tom66 is working on an OSD as well and I started working on some sudo code to take the IMU data from the IC2 on a MultiWii and generate a AHI line for his code base.

What I like about the OP's solution is that it's Arduino based and so is MultiWii. So, we might finally have an open source AHI OSD solution for Wii based flight controllers!
cactus is offline Find More Posts by cactus
Reply With Quote
Old Jul 18, 2011, 04:13 PM
RC = FUN
Fort Wayne, Indiana
Joined Aug 2008
3,636 Posts
This is pretty awesome!

I'd say go for the big text, but that's just me. And, put an arrow pointing home! -Tyler
flyboy321 is offline Find More Posts by flyboy321
Reply With Quote
Old Jul 18, 2011, 04:14 PM
Registered User
SW England
Joined Aug 2009
800 Posts
Maybe you would also be interested in this opensource, Arduino RC hardware
http://www.rcgroups.com/forums/showthread.php?t=1446653

Hardware:
http://www.flytron.com/16-openlrs
Forum:
http://forum.flytron.com/viewforum.php?f=7

Nigel.
Devonboy is offline Find More Posts by Devonboy
Last edited by Devonboy; Jul 18, 2011 at 04:27 PM.
Reply With Quote
Old Jul 18, 2011, 04:22 PM
Registered User
Italia, Lombardia, Milano
Joined Jun 2010
146 Posts
Hi dennis,
please continue, I like this idea to built my own OSD as i like fly , programming and electronics.
Please submit a schematic.
Ciao, Carlo
carlonb is offline Find More Posts by carlonb
Reply With Quote
Old Jul 18, 2011, 04:28 PM
Registered User
Romania, Dolj, Craiova
Joined Sep 2007
15,451 Posts
All of you excited by this ideea, tom66 already started more than one year ago one similar project. Have you seen any (happy) ending of his project ?
Isn't better an approach as the above openlrs, first produce something barely usable, and then announce ?
renatoa is offline Find More Posts by renatoa
Reply With Quote
Old Jul 18, 2011, 04:58 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by flyboy321 View Post
This is pretty awesome!

I'd say go for the big text, but that's just me. And, put an arrow pointing home! -Tyler
LOS is almost done - home pointing arrow will be next.

Quote:
Originally Posted by RENATOA View Post
All of you excited by this ideea, tom66 already started more than one year ago one similar project. Have you seen any (happy) ending of his project ?
Isn't better an approach as the above openlrs, first produce something barely usable, and then announce ?
It's not meant as an announce (- it's a build log). I don't plan to sell anything, neither do I plan to design a perfect and flexible OSD. I have made an DIY-OSD for personal use (as it has been fun to make) and just wanted to share the idea and make the code available to everyone.
With Arduino compatibility it should give quite a few people the opportunity to use the code/or part of the code to make their own OSD.

Set home position has been made and I'm almost done with LOS. Last thing will be home pointing arrow.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 18, 2011 at 05:18 PM.
Reply With Quote
Old Jul 18, 2011, 05:23 PM
Registered User
Italia, Lombardia, Milano
Joined Jun 2010
146 Posts
Quote:
Originally Posted by RENATOA View Post
All of you excited by this ideea, tom66 already started more than one year ago one similar project. Have you seen any (happy) ending of his project ?
Isn't better an approach as the above openlrs, first produce something barely usable, and then announce ?
Quote:
Originally Posted by Dennis Frie View Post
LOS is almost done - home pointing arrow will be next.



It's not meant as an announce (- it's a build log). I don't plan to sell anything, neither do I plan to design a perfect and flexible OSD. I have made an DIY-OSD for personal use (as it has been fun to make) and just wanted to share the idea and make the code available to everyone.
With Arduino compatibility it should give quite a few people the opportunity to use the code/or part of the code to make their own OSD.

Set home position has been made and I'm almost done with LOS. Last thing will be home pointing arrow.
I agree with you Dennis, it's funny DIY this stuff. GOOOOO ONNNN ! please.
Bye, Carlo
carlonb is offline Find More Posts by carlonb
Reply With Quote
Old Jul 18, 2011, 05:25 PM
Registered User
CheckSum's Avatar
Joined Jan 2011
512 Posts
Nice one Dennis,
I look forward to seeing the 'finished' code. Thanks for sharing!
CheckSum is offline Find More Posts by CheckSum
Reply With Quote
Old Jul 18, 2011, 05:51 PM
Registered User
SW England
Joined Aug 2009
800 Posts
Please don't take my post about OpenLRS the wrong way, I just pointed it out because I have invested in it and as Renatoa says, it's also open source and the hardware is ready for programming any way you want it.

I think it's great that Dennis has posted his concept and released the basic code into the public domain, do what you will with it and maybe copy Dennis' hardware if it suits you.

I am tired of buying nice hardware that is proprietry and will not work with some other piece of nice hardware because the vendor(s) don't want you to change anything or use it with some other nice piece of hardware you have purchased.
I've also invested in the OpenPilot hardware.

Dennis, please carry on with your personal 'project' as I for one am interested.

Nigel.
Devonboy is offline Find More Posts by Devonboy
Reply With Quote
Old Jul 18, 2011, 05:56 PM
Registered User
Houston, Tx
Joined Oct 2006
26 Posts
I'm very interested and looks like I have something to tinker with.
cyonics is offline Find More Posts by cyonics
Reply With Quote
Old Jul 18, 2011, 06:13 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Great with some interest

Just finished a quick LOS calculation. It's not perfect as I assume the earth is flat and the latitude is around 56 degrees - but it works for me
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 19, 2011, 04:42 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by carlonb View Post
Hi dennis,
please continue, I like this idea to built my own OSD as i like fly , programming and electronics.
Please submit a schematic.
Ciao, Carlo
I would like to make a few more hardware-tests and make a flexible solution (with standard components and a little trim-pot), before I upload the schematic.
In generel, the only thing that has to be done is to adjust the video-signal, with the same circuit as shown on wikipedia (the bias voltage goes to the "+" just above the capacitor);
http://en.wikipedia.org/wiki/File:Po...ng_Circuit.svg
A finish circuit can be seen here (not mine);
http://www.viennawireless.org/balloo...rlay/index.php
http://www.circuitcellar.com/avr2004/DA3754.html

This guy is only using a resistor. I wouldn't thrust the sync detection, but you might be lucky. And when using SPI, i recommend also to use a diode from the SPI-pin
http://diydrones.com/profiles/blogs/...as-osd-without

But I find that a standard diode provide too low voltage for the bias-circuit, to raise the video-signal above ground.

I'm currently using a zener-diode to create the voltage reference and bias voltage - but I would prefer to use standard components all the way. That would make things easier available for everyone
2 Diodes en series could be a solution - but that's a boring solution (though it works fine)
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 19, 2011 at 04:52 AM.
Reply With Quote
Old Jul 19, 2011, 07:03 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Done;

- Set homeposition automatic a couple of seconds after GPS fix.

- Calculate and show line of sight

- Heading home (For now just shown as degrees/numbers. It have been tested to work fine with a seperate Arduino and GPS, but I haven't tried to walk around with the breadboard, screen, power-supply etc
I have worked around with the seperate Arduino and GPS though :P )
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 19, 2011 at 09:03 AM.
Reply With Quote
Old Jul 19, 2011, 07:40 AM
Flying like an Angel.
BlueAngel2000's Avatar
Austria
Joined Sep 2007
1,488 Posts
Quote:
Originally Posted by RENATOA View Post
All of you excited by this ideea, tom66 already started more than one year ago one similar project. Have you seen any (happy) ending of his project ?
Isn't better an approach as the above openlrs, first produce something barely usable, and then announce ?
I think you cannot compare this OSD to tom66s OSD.
1. Tom has never flown FPV (and still not flown FPV)
2. started from scratch (soldering, building, electronics,......)
I was too interested in Toms OSD, but lost interest a long time ago.
He has much ideas, but not really the experience to do it good. (just my personal opinion)


@Dennis:
nice work.
keep it going.

a simple DIY OSD is just missing in the current FPV scene.
BlueAngel2000 is offline Find More Posts by BlueAngel2000
Reply With Quote
Old Jul 19, 2011, 08:31 AM
Registered User
Luxembourg
Joined May 2009
806 Posts
Dennis you are on fire!

You have my support!
iacei is offline Find More Posts by iacei
Reply With Quote
Old Jul 19, 2011, 11:24 AM
Registered User
Joined Sep 2010
2,424 Posts
Great ... It would be awesome if some code-knowing members would help, after the basic things would be sort out, to make this system extensible, like using wm+,cheap acc for some stabilization and to show data on osd....or I can wait for black vortex + megapirate code... ... or the uavdevboard ...a lot of solutions, mainly I want to say the best would be to keep this one simple and cheap and get as much out as you can in as little time and people will surely appreciate it with some donations
msev is online now Find More Posts by msev
Reply With Quote
Old Jul 19, 2011, 01:07 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Final breadboard version with Arduino Pro mini.
The use of Arduino pro mini should make an easy and small OSD

Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 19, 2011, 03:10 PM
Registered User
Lancaster, CA
Joined Apr 2007
82 Posts
Good work. I appreciate your posting this. I'm also working to create my own display, and the details such as the circuit design, along with the pitfalls and lessons learned are really helpful to me. For the DIY-er, you don't have to give them a polished system. They can figure out the minor details themselves. 

You wrote about potentially dimming the display. Have you considered outlining the characters in a black or dark grey?  I've seen other overlays that do this and it does a pretty good job in making the text readable in most lighting conditions.
killabx is offline Find More Posts by killabx
Reply With Quote
Old Jul 19, 2011, 08:08 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by killabx View Post
Good work. I appreciate your posting this. I'm also working to create my own display, and the details such as the circuit design, along with the pitfalls and lessons learned are really helpful to me. For the DIY-er, you don't have to give them a polished system. They can figure out the minor details themselves. 

You wrote about potentially dimming the display. Have you considered outlining the characters in a black or dark grey?  I've seen other overlays that do this and it does a pretty good job in making the text readable in most lighting conditions.
Exactely, I don't plan to create a completely polished system - just to show how it can be done

The dimming of the text background is very easy. It would be nice to add a black outline to the characters, but that would require another way to blast the pixels or some timing skills
I haven't found any solution, unfortunately.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 19, 2011 at 08:16 PM.
Reply With Quote
Old Jul 19, 2011, 08:12 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
And just a quick update. Here is a picture of the "finish prototype" (just missing cable to current sensor).

Tested a few minutes ago, and it seems to work perfect.





Edit; A quick test with GPS also seems to work fine
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 19, 2011 at 09:00 PM.
Reply With Quote
Old Jul 19, 2011, 08:16 PM
Registered User
CheckSum's Avatar
Joined Jan 2011
512 Posts
Denis,
I am a big Arduino fan with multicopters and was wondering if you have any thoughts on this Maxim BOB OSD?
-Thanks
Breakout Board for MAX7456 On Screen Display

Here is some sample code:
Code:
/*
    MAX7456 test code
	Pete Dokter, 6/17/09
	
	This test code blinks the word "SAMPLE" just under
	where you'd expect someone's face to be.
	
*/

#include <avr/io.h>
#include <avr/interrupt.h>


#define RESET 0	//PB0
#define CS 2	//PB2
#define MOSI 3	//PB3
#define MISO 4	//PB4
#define SCK 5	//PB5


//Define functions
//======================
void ioinit(void);      //Initializes IO
void delay_ms(uint16_t x); //General purpose delay
void delay_us(int x);
void SPI_write(char address, char byte);
char SPI_read(char address);

//======================




int main (void)
{
	char x;

    ioinit(); //Setup IO pins and defaults
	
	delay_ms(1000);
	
	//reset
	PORTB &= ~(1<<RESET);
	delay_ms(1000);
	PORTB |= (1<<RESET);
	delay_ms(1000);
	
	SPI_write(0,0x08);	//enable display of OSD image
	delay_ms(1);
	
	//automatic black level control, have to read, augment and rewrite
	//The data sheet is rather specific about this
	x = SPI_read(0xEC);	
	delay_ms(1);
	x &= 0xEF;
	SPI_write(0x6C,x);
	delay_ms(1);
	
	SPI_write(0x04,0);//DMM set to 0
	
	x = 25;
	
	SPI_write(0x05,0x01);//DMAH
	
	SPI_write(0x06,x);//DMAL
	SPI_write(0x07,0x1D);
	
	SPI_write(0x06,x+1);//DMAL
	SPI_write(0x07,0x0B);
	
	SPI_write(0x06,x+2);//DMAL
	SPI_write(0x07,0x17);
	
	SPI_write(0x06,x+3);//DMAL
	SPI_write(0x07,0x1A);
	
	SPI_write(0x06,x+4);//DMAL
	SPI_write(0x07,0x16);
	
	SPI_write(0x06,x+6);//DMAL
	SPI_write(0x07,0x0F);
	
	
	while(1)
	{
		SPI_write(0,0x08);	//enable display of OSD image
		delay_ms(1000);
		SPI_write(0,0);	//disable display of OSD image
		delay_ms(1000);
	}
	
	
}

void ioinit (void)
{
	PORTB = 0xFF;
	DDRB = ((1<<CS) | (1<<MOSI) | (1<<SCK) | (1<<RESET));

    TCCR2B = (1<<CS21); //Set Prescaler to 8. CS21=1

}

//General short delays
void delay_us(int x)
{
	int y, z, a;
	
	y = x/256;
	z = x - y * 256;
	
	for (a = 0; a < y; a++)
	{
		TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
		
		TCNT2 = 0; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click
	
		while(!(TIFR2 & 0x01));
		
	}
	
	TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
	
	TCNT2 = 256-z; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click

	while(!(TIFR2 & 0x01));
	
}

//General short delays
void delay_ms(uint16_t x)
{
	for (; x > 0 ; x--)
    {
        delay_us(250);
        delay_us(250);
        delay_us(250);
        delay_us(250);
    }
	
}

void SPI_write(char address, char byte)
{
	unsigned char SPICount;                                       // Counter used to clock out the data

	unsigned char SPIData;                                        // Define a data structure for the SPI data
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
														
																// Repeat for the Data byte
	SPIData = byte;                                            // Preload the data to be sent with Data
	
	for (SPICount = 0; SPICount < 8; SPICount++)
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK); 
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1; 
	}           
	
	PORTB |= (1<<CS);
	PORTB &= ~(1<<MOSI);

}


char SPI_read(char address)
{
	unsigned char SPICount;                                       // Counter used to clock out the data
  
	char SPIData; 
	char temp;
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
	

	PORTB &= ~(1<<MOSI);                                         // Reset the MOSI data line
	
	SPIData = 0;
	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock in the data to be read
	{
		SPIData <<=1;                                               // Rotate the data
		PORTB |= (1<<SCK);                                         // Raise the clock to clock the data out of the MAX7456
		
		temp = PINB;
		if (temp & (1<<MISO)) SPIData |= 1;                       // Read the data bit
		
		PORTB &= ~(1<<SCK);                                       // Drop the clock ready for the next bit
	}                                                             // and loop back
	PORTB |= (1<<CS);                                                 // Raise CS
					  
	return SPIData;                              // Finally return the read data


}
CheckSum is offline Find More Posts by CheckSum
Reply With Quote
Old Jul 19, 2011, 08:42 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by CheckSum View Post
Denis,
I am a big Arduino fan with multicopters and was wondering if you have any thoughts on this Maxim BOB OSD?
-Thanks
Breakout Board for MAX7456 On Screen Display

Here is some sample code:
Code:
/*
    MAX7456 test code
	Pete Dokter, 6/17/09
	
	This test code blinks the word "SAMPLE" just under
	where you'd expect someone's face to be.
	
*/

#include <avr/io.h>
#include <avr/interrupt.h>


#define RESET 0	//PB0
#define CS 2	//PB2
#define MOSI 3	//PB3
#define MISO 4	//PB4
#define SCK 5	//PB5


//Define functions
//======================
void ioinit(void);      //Initializes IO
void delay_ms(uint16_t x); //General purpose delay
void delay_us(int x);
void SPI_write(char address, char byte);
char SPI_read(char address);

//======================




int main (void)
{
	char x;

    ioinit(); //Setup IO pins and defaults
	
	delay_ms(1000);
	
	//reset
	PORTB &= ~(1<<RESET);
	delay_ms(1000);
	PORTB |= (1<<RESET);
	delay_ms(1000);
	
	SPI_write(0,0x08);	//enable display of OSD image
	delay_ms(1);
	
	//automatic black level control, have to read, augment and rewrite
	//The data sheet is rather specific about this
	x = SPI_read(0xEC);	
	delay_ms(1);
	x &= 0xEF;
	SPI_write(0x6C,x);
	delay_ms(1);
	
	SPI_write(0x04,0);//DMM set to 0
	
	x = 25;
	
	SPI_write(0x05,0x01);//DMAH
	
	SPI_write(0x06,x);//DMAL
	SPI_write(0x07,0x1D);
	
	SPI_write(0x06,x+1);//DMAL
	SPI_write(0x07,0x0B);
	
	SPI_write(0x06,x+2);//DMAL
	SPI_write(0x07,0x17);
	
	SPI_write(0x06,x+3);//DMAL
	SPI_write(0x07,0x1A);
	
	SPI_write(0x06,x+4);//DMAL
	SPI_write(0x07,0x16);
	
	SPI_write(0x06,x+6);//DMAL
	SPI_write(0x07,0x0F);
	
	
	while(1)
	{
		SPI_write(0,0x08);	//enable display of OSD image
		delay_ms(1000);
		SPI_write(0,0);	//disable display of OSD image
		delay_ms(1000);
	}
	
	
}

void ioinit (void)
{
	PORTB = 0xFF;
	DDRB = ((1<<CS) | (1<<MOSI) | (1<<SCK) | (1<<RESET));

    TCCR2B = (1<<CS21); //Set Prescaler to 8. CS21=1

}

//General short delays
void delay_us(int x)
{
	int y, z, a;
	
	y = x/256;
	z = x - y * 256;
	
	for (a = 0; a < y; a++)
	{
		TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
		
		TCNT2 = 0; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click
	
		while(!(TIFR2 & 0x01));
		
	}
	
	TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
	
	TCNT2 = 256-z; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click

	while(!(TIFR2 & 0x01));
	
}

//General short delays
void delay_ms(uint16_t x)
{
	for (; x > 0 ; x--)
    {
        delay_us(250);
        delay_us(250);
        delay_us(250);
        delay_us(250);
    }
	
}

void SPI_write(char address, char byte)
{
	unsigned char SPICount;                                       // Counter used to clock out the data

	unsigned char SPIData;                                        // Define a data structure for the SPI data
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
														
																// Repeat for the Data byte
	SPIData = byte;                                            // Preload the data to be sent with Data
	
	for (SPICount = 0; SPICount < 8; SPICount++)
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK); 
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1; 
	}           
	
	PORTB |= (1<<CS);
	PORTB &= ~(1<<MOSI);

}


char SPI_read(char address)
{
	unsigned char SPICount;                                       // Counter used to clock out the data
  
	char SPIData; 
	char temp;
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
	

	PORTB &= ~(1<<MOSI);                                         // Reset the MOSI data line
	
	SPIData = 0;
	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock in the data to be read
	{
		SPIData <<=1;                                               // Rotate the data
		PORTB |= (1<<SCK);                                         // Raise the clock to clock the data out of the MAX7456
		
		temp = PINB;
		if (temp & (1<<MISO)) SPIData |= 1;                       // Read the data bit
		
		PORTB &= ~(1<<SCK);                                       // Drop the clock ready for the next bit
	}                                                             // and loop back
	PORTB |= (1<<CS);                                                 // Raise CS
					  
	return SPIData;                              // Finally return the read data


}
The MAX7456 OSD chip should be a good and easy way to show text.
I actually got a few samples laying around - but decided to make it all on a single microcontroller anyway. You should be able to find quite a few projects with the MAX7456.

I decided to use a single micro-controller to keep the hardware as simple and cheap as possible. I found it tempting to make an OSD with more or loss "normal" components and no need for extra chips etc.
I have been looking at the breakout board, but find the size and price a bit too high. But it's probably a good place to start. You should be able to show some text pretty quick - and I feel pretty sure that it does the job better than me. Just be aware, that the chip is only available in SMD, and the signal has to go through the chip. A loose connection is a bad idea
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 19, 2011 at 08:52 PM.
Reply With Quote
Old Jul 20, 2011, 04:03 AM
Electronics slayer
SouthPawPaul's Avatar
Reading, UK
Joined Jul 2008
494 Posts
Quote:
Originally Posted by Dennis Frie View Post
And just a quick update. Here is a picture of the "finish prototype" (just missing cable to current sensor).

Tested a few minutes ago, and it seems to work perfect.

Edit; A quick test with GPS also seems to work fine
That is a thing of beauty Dennis. I love to see Arduino projects for RC. Keep up the excellent work (and share the plans ).
SouthPawPaul is offline Find More Posts by SouthPawPaul
Reply With Quote
Old Jul 20, 2011, 04:35 AM
Registered User
Joined Mar 2009
1,154 Posts
Extremely impressive project ! Does it have some spare ADC ?
flipflap is offline Find More Posts by flipflap
Reply With Quote
Old Jul 20, 2011, 06:47 AM
Registered User
Joined Apr 2008
299 Posts
Quote:
Originally Posted by Dennis Frie View Post
And just a quick update. Here is a picture of the "finish prototype" (just missing cable to current sensor).

Tested a few minutes ago, and it seems to work perfect.





Edit; A quick test with GPS also seems to work fine
That's awesome ! good work. I built a multiwii setup (that is currently on sale on ebay http://cgi.ebay.co.uk/ws/eBayISAPI.d...#ht_500wt_1156), and am a big fan of the arduino mini pro.
thecrawfords67 is offline Find More Posts by thecrawfords67
Reply With Quote
Old Jul 20, 2011, 07:09 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by flipflap View Post
Extremely impressive project ! Does it have some spare ADC ?
It got plenty of spare ADC's
The main problem is timing and processor power. But it shouldn't be any problem to attach a pressure sensor etc.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 20, 2011, 07:58 AM
Registered User
Joined Sep 2010
2,424 Posts
Will you really share the code and schematics with us ? I want a definite answer! hehe and when will that happen?
msev is online now Find More Posts by msev
Reply With Quote
Old Jul 20, 2011, 08:14 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by msev View Post
Will you really share the code and schematics with us ? I want a definite answer! hehe and when will that happen?
Yep - for sure
I have no intention to sell it etc. so no reason to keep it for myself.

The code is already uploaded - only minor changes has been made (Line of sight, set homeposition and heading home).

I will upload the schematic as soon as I have made a nice drawing on the pc
But it's a good idea to play a bit with the circuit yourself, it's not perfect
So far it's a simple AC-coupling with 0.1 uF (standard value capacitor for AC-coupling video), climping circuit (100k resistor and 1N4148 diode) and a biasing-voltage from a reference voltage made with a 1N4148 diode. I find the 100k resistor value a bit too high, but lower resistor values doesn't seems to raise the video-signal enoguh. A diode with a bit higher voltage-drop would probably be better.

The princip is the same as this one;
http://www.viennawireless.org/balloo...rlay/index.php

Voltage dividing is made with a pot. So en general, with a biased video-signal above ground you should be able to set the reference-voltage with the pot and get a stable sync.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 20, 2011 at 08:19 AM.
Reply With Quote
Old Jul 20, 2011, 08:53 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Here you go...

You might want to take a look at;
  • R2 - Resistor value a bit high
  • Capacitor removed in climping circuit - so far it seems to work fine without
  • R1 controls brightness

It has been drawn to match the layout of the Arduino Pro mini board (That's the reason why ground is at the top). AIN0 (pin7) has to be connected right next to AIN1 - pin 6 on the arduino board.


Arduino pro mini + 8 components do the trick for now
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 20, 2011 at 09:58 AM.
Reply With Quote
Old Jul 20, 2011, 10:25 AM
Registered User
Joined Sep 2001
6,190 Posts
Quote:
Originally Posted by CheckSum View Post
Denis,
I am a big Arduino fan with multicopters and was wondering if you have any thoughts on this Maxim BOB OSD?
-Thanks
Breakout Board for MAX7456 On Screen Display

Here is some sample code:
Code:
/*
    MAX7456 test code
	Pete Dokter, 6/17/09
	
	This test code blinks the word "SAMPLE" just under
	where you'd expect someone's face to be.
	
*/

#include <avr/io.h>
#include <avr/interrupt.h>


#define RESET 0	//PB0
#define CS 2	//PB2
#define MOSI 3	//PB3
#define MISO 4	//PB4
#define SCK 5	//PB5


//Define functions
//======================
void ioinit(void);      //Initializes IO
void delay_ms(uint16_t x); //General purpose delay
void delay_us(int x);
void SPI_write(char address, char byte);
char SPI_read(char address);

//======================




int main (void)
{
	char x;

    ioinit(); //Setup IO pins and defaults
	
	delay_ms(1000);
	
	//reset
	PORTB &= ~(1<<RESET);
	delay_ms(1000);
	PORTB |= (1<<RESET);
	delay_ms(1000);
	
	SPI_write(0,0x08);	//enable display of OSD image
	delay_ms(1);
	
	//automatic black level control, have to read, augment and rewrite
	//The data sheet is rather specific about this
	x = SPI_read(0xEC);	
	delay_ms(1);
	x &= 0xEF;
	SPI_write(0x6C,x);
	delay_ms(1);
	
	SPI_write(0x04,0);//DMM set to 0
	
	x = 25;
	
	SPI_write(0x05,0x01);//DMAH
	
	SPI_write(0x06,x);//DMAL
	SPI_write(0x07,0x1D);
	
	SPI_write(0x06,x+1);//DMAL
	SPI_write(0x07,0x0B);
	
	SPI_write(0x06,x+2);//DMAL
	SPI_write(0x07,0x17);
	
	SPI_write(0x06,x+3);//DMAL
	SPI_write(0x07,0x1A);
	
	SPI_write(0x06,x+4);//DMAL
	SPI_write(0x07,0x16);
	
	SPI_write(0x06,x+6);//DMAL
	SPI_write(0x07,0x0F);
	
	
	while(1)
	{
		SPI_write(0,0x08);	//enable display of OSD image
		delay_ms(1000);
		SPI_write(0,0);	//disable display of OSD image
		delay_ms(1000);
	}
	
	
}

void ioinit (void)
{
	PORTB = 0xFF;
	DDRB = ((1<<CS) | (1<<MOSI) | (1<<SCK) | (1<<RESET));

    TCCR2B = (1<<CS21); //Set Prescaler to 8. CS21=1

}

//General short delays
void delay_us(int x)
{
	int y, z, a;
	
	y = x/256;
	z = x - y * 256;
	
	for (a = 0; a < y; a++)
	{
		TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
		
		TCNT2 = 0; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click
	
		while(!(TIFR2 & 0x01));
		
	}
	
	TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
	
	TCNT2 = 256-z; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click

	while(!(TIFR2 & 0x01));
	
}

//General short delays
void delay_ms(uint16_t x)
{
	for (; x > 0 ; x--)
    {
        delay_us(250);
        delay_us(250);
        delay_us(250);
        delay_us(250);
    }
	
}

void SPI_write(char address, char byte)
{
	unsigned char SPICount;                                       // Counter used to clock out the data

	unsigned char SPIData;                                        // Define a data structure for the SPI data
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
														
																// Repeat for the Data byte
	SPIData = byte;                                            // Preload the data to be sent with Data
	
	for (SPICount = 0; SPICount < 8; SPICount++)
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK); 
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1; 
	}           
	
	PORTB |= (1<<CS);
	PORTB &= ~(1<<MOSI);

}


char SPI_read(char address)
{
	unsigned char SPICount;                                       // Counter used to clock out the data
  
	char SPIData; 
	char temp;
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
	

	PORTB &= ~(1<<MOSI);                                         // Reset the MOSI data line
	
	SPIData = 0;
	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock in the data to be read
	{
		SPIData <<=1;                                               // Rotate the data
		PORTB |= (1<<SCK);                                         // Raise the clock to clock the data out of the MAX7456
		
		temp = PINB;
		if (temp & (1<<MISO)) SPIData |= 1;                       // Read the data bit
		
		PORTB &= ~(1<<SCK);                                       // Drop the clock ready for the next bit
	}                                                             // and loop back
	PORTB |= (1<<CS);                                                 // Raise CS
					  
	return SPIData;                              // Finally return the read data


}
I was wondering if you wanted to start a new thread to explore using this board with the Arduino based Flight Controllers for IMU and other sensor based data overlay?
cactus is offline Find More Posts by cactus
Reply With Quote
Old Jul 20, 2011, 04:28 PM
SX_
.........lost..........
Zambia, Lusaka, Lusaka
Joined Jun 2005
325 Posts
Very cool project!!
Will have to have a go!!

Thanks for sharing!!

Willie
SX_ is offline Find More Posts by SX_
Reply With Quote
Old Jul 20, 2011, 04:49 PM
Pimpsac
Joined Jul 2011
14 Posts
Nice dude will be following this. Can't wait till you get some video up of it in action
Pimpsac is offline Find More Posts by Pimpsac
Reply With Quote
Old Jul 20, 2011, 05:08 PM
FPV from Lithuania
vipix's Avatar
Lithuania
Joined Mar 2007
128 Posts
What GPS module in use there?
vipix is offline Find More Posts by vipix
Reply With Quote
Old Jul 20, 2011, 05:50 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by Pimpsac View Post
Nice dude will be following this. Can't wait till you get some video up of it in action
Hopefully I should be ready to do a test-flight within a couple of days (Just about to put the hardware in a plane). Unfortunately I don't have a recorder - but I might be able to fix something sooner or later.

Quote:
Originally Posted by vipix View Post
What GPS module in use there?
You should be able to use more or less any GPS-module. At the moment I use a MTK GPS which seem to perform very well and support 10 hz update-rate. It also offers a very good sensitivity, I'm able to get GPS-lock from inside my house.
http://flytron.com/osd-headtrackers/...ps-module.html
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 21, 2011, 12:39 AM
mostly newbie
shimniok's Avatar
United States, CO, Centennial
Joined May 2011
263 Posts
Wow that is nice work!! Thanks for posting this and sharing the info/code/schematics!
shimniok is offline Find More Posts by shimniok
Reply With Quote
Old Jul 21, 2011, 05:49 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
I don't expect anyone have used the code yet, but;

Please be aware - in code version 0.01 "mahtemp" is defined as an integer (16 bit) and not a long (32 bit). When the total mAh consumed exceeds 3276.7 mAh it will give overflow. This will cause the 17. bit to be written "somewhere". In most cases nothing will happen - but it's not a good idea to write bits at random addresses.
Updated code will follow after further testing.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 21, 2011 at 05:54 AM.
Reply With Quote
Old Jul 21, 2011, 06:21 AM
Registered User
evvaldis's Avatar
Lithuania
Joined Jan 2007
179 Posts
Nice. Will try to build it soon.
evvaldis is offline Find More Posts by evvaldis
Reply With Quote
Old Jul 21, 2011, 09:07 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Anyone who have used the Allegro current sensors (ACS755)?

it seem to have about 600 mv offset - and until 5-10 amps load it stays at 600 mv. Any good ideas? Hopefully it's the last thing that needs to be fixed before I can make the final installation in my plane.

It's all connected and works fine so far - except for the current sensing.

EDIT; Tested and calibrated on breadboard - works fine. Will do another test in plane later
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 21, 2011 at 11:28 AM.
Reply With Quote
Old Jul 21, 2011, 11:27 AM
Registered User
CheckSum's Avatar
Joined Jan 2011
512 Posts
Congratulations on a successful and quick build!
Very cool, thank you.
CheckSum is offline Find More Posts by CheckSum
Reply With Quote
Old Jul 21, 2011, 01:39 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Found the problem with the current-sensor. This is what the output signal looks like. That will make the micro-controller will read more or less random values.
A descent lowpass-filter or some extra capacitors in front of the ESC should do the trick.

Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Sep 18, 2012 at 12:53 PM.
Reply With Quote
Old Jul 21, 2011, 02:27 PM
Registered User
Joined Mar 2009
1,154 Posts
Quote:
Originally Posted by Dennis Frie View Post
Anyone who have used the Allegro current sensors (ACS755)?

it seem to have about 600 mv offset - and until 5-10 amps load it stays at 600 mv. Any good ideas? Hopefully it's the last thing that needs to be fixed before I can make the final installation in my plane.

It's all connected and works fine so far - except for the current sensing.

EDIT; Tested and calibrated on breadboard - works fine. Will do another test in plane later
Notice that this part is no longer in production. From datasheet, it has good linearity (2.8% over full range), and 60mV/A sensitivity.

The datasheet gives an offset of 600mV as you've measured. You have to substract it. So for example 600mV is 0A, and 600mV+60mV = 1A, 600mV+120mV=2A etc.

There is also 68 mV noise, but it should be easily reduced with some filtering.
flipflap is offline Find More Posts by flipflap
Reply With Quote
Old Jul 21, 2011, 02:37 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by flipflap View Post
Notice that this part is no longer in production. From datasheet, it has good linearity (2.8% over full range), and 60mV/A sensitivity.

The datasheet gives an offset of 600mV as you've measured. You have to substract it. So for example 600mV is 0A, and 600mV+60mV = 1A, 600mV+120mV=2A etc.

There is also 68 mV noise, but it should be easily reduced with some filtering.
Year, the 600 mv offset is no problem at all - the problem was, that it couldn't measure 0-6 A. The capacitor removed the ripple from the ESC, but the current sensor wasn't too happy about the large capacitance. A normal lowpass-filter with a low capacitance works better .
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 21, 2011, 03:57 PM
FPV from Lithuania
vipix's Avatar
Lithuania
Joined Mar 2007
128 Posts
Maybe later arduino autopilot?
vipix is offline Find More Posts by vipix
Reply With Quote
Old Jul 21, 2011, 04:18 PM
Team White Llama
Enthlapy's Avatar
United States, IL, Addison
Joined Dec 2010
500 Posts
I <3 you, was going to do the same. Subscribed!
Enthlapy is offline Find More Posts by Enthlapy
Reply With Quote
Old Jul 21, 2011, 05:44 PM
Registered User
SW England
Joined Aug 2009
800 Posts
Dennis,
In your schematic, what values for R1 and C1 ? as I don't see it anywhere else in the thread.

See, I am paying attention

Nigel.
Devonboy is offline Find More Posts by Devonboy
Reply With Quote
Old Jul 21, 2011, 07:22 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by vipix View Post
Maybe later arduino autopilot?
I will maybe make an autopilot later, but I don't plan to do anything official, as projects like ardupilot etc. is probably a better choice if you just want to use a finish code.

Quote:
Originally Posted by Devonboy View Post
Dennis,
In your schematic, what values for R1 and C1 ? as I don't see it anywhere else in the thread.

See, I am paying attention

Nigel.
Please play a bit with the circuit yourself. You might want to take a look here aswell;
http://www.viennawireless.org/balloo...rlay/index.php
But i strongly recommend to use a pot as voltage-divider.

If I make another one I will consider a diode with a little higher voltage drop and much lower R2 value. Might also add the capacitor as well.

R2 is 220 ohm (Written in schematic, but not very clearly). The value is not very important, you can try a few different and pick the value/brightness you prefere.
C1 is 0.1 uF, but other values should work fine. I actually tried something like 25 uF capacitor which worked without problems (but not recommended )
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 22, 2011, 03:56 AM
Registered User
SW England
Joined Aug 2009
800 Posts
Ok, thanks.
I was asking about R1 (not R2 as it is defined in your schematic) but from your link I see 680k is suggested for R1 and I know I have a 1M pot in my parts bin...

Nigel.
Devonboy is offline Find More Posts by Devonboy
Reply With Quote
Old Jul 22, 2011, 04:13 AM
Registered User
Joined Sep 2010
2,424 Posts
This would be also a compatible board right: http://www.seeedstudio.com/depot/see...?cPath=132_133
msev is online now Find More Posts by msev
Reply With Quote
Old Jul 22, 2011, 06:15 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by Devonboy View Post
Ok, thanks.
I was asking about R1 (not R2 as it is defined in your schematic) but from your link I see 680k is suggested for R1 and I know I have a 1M pot in my parts bin...

Nigel.
arh sorry. I have used a 50K pot. 1M pot should work, but it will probably be more sensitive to RF-noise etc.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 22, 2011, 06:18 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by msev View Post
This would be also a compatible board right: http://www.seeedstudio.com/depot/see...?cPath=132_133
As long as AIN0, AIN1 and MOSI are breaked-out you should be fine. But the board is a little big to put in a plane. But it's great when testing.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 22, 2011, 11:20 PM
That tree again!!!!
thanhTran's Avatar
Germantown, MD, US
Joined Sep 2004
6,642 Posts
I never understood how to embed text to video frame. I found what you explain is clear and easy to understand. Thanks very much for sharing your knowledge, ideas, and projects. Hopefully I can try your code this weekend and maybe learn something along the way

-Thanh
thanhTran is offline Find More Posts by thanhTran
Reply With Quote
Old Jul 23, 2011, 06:00 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by thanhTran View Post
I never understood how to embed text to video frame. I found what you explain is clear and easy to understand. Thanks very much for sharing your knowledge, ideas, and projects. Hopefully I can try your code this weekend and maybe learn something along the way

-Thanh
Good to hear

Please don't use code version 001 "in-flight". No safety measure was taken to prevent the SPI-port from idling high. It works fine - but 1 wrong bit at line-end will cause SPI to idle high and in worst case cause black-screen. In the new version the SPI will always be set to 0 (when not in a line). A lot safer.

Code will be updated later with the following changes;
  • LOS calculated
  • Heading home
  • Set homeposition
  • Prevent SPI from idling high
  • Large numbers/text/graphic example
  • A few minor changes
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 23, 2011 at 11:34 AM.
Reply With Quote
Old Jul 23, 2011, 06:03 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
The plane is more or less ready for a test-run, unfortunately the weather-forecast doesn't really allow it. Rain the next 5 days


Last changes;
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 23, 2011, 06:10 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
The function of the hardware..

A while ago when testing the hardware for line-detection I took these pictures. Some of you might find them useful.

AC-coupling of video-signal (red is AC-coupled). In this case the different is pretty small.


Positive climped


Positive climped and biased


Positive climped and biased (blue) as before - and red as voltage reference.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 23, 2011, 06:32 AM
Electronics slayer
SouthPawPaul's Avatar
Reading, UK
Joined Jul 2008
494 Posts
I've only got rudimentary electronics skills so I've got really got a clue what I'm looking at, but it looks impressive.

Arduino Pro on the way to wire up this little beauty.

There are so many cool projects that can be done with the arduino. I've even seen an android based oscilloscope!
SouthPawPaul is offline Find More Posts by SouthPawPaul
Reply With Quote
Old Jul 23, 2011, 09:51 PM
Rather be flyin
tom83's Avatar
Tucson, Arizona
Joined Mar 2008
450 Posts
Subscribed!
tom83
tom83 is offline Find More Posts by tom83
Reply With Quote
Old Jul 24, 2011, 01:29 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Still raining here in DK

Found a cheap USB video-grabber and tried to record a bit. Unfortunately the quality isn't very good, but it's better than nothing
OSD test (0 min 19 sec)


The last finish needs to be done with;
  • Large numbers 6-9 (Not too pretty)
  • The arrow is just a quick test (A lot more will be added for smoother movement).

Just a matter of fooling around with bit-patterns like this
0b0000000110000000
0b0000001111000000
0b0000011001100000
0b0000111000110000
0b0001110000011000
0b0011000000001100
0b0111111001111110
0b0011111001111100
0b0000011001100000
0b0000011001100000
0b0000011001100000
0b0000011001100000
0b0000011001100000
0b0000011001100000
0b0000011001100000
0b0000001111000000
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 24, 2011 at 02:33 PM.
Reply With Quote
Old Jul 24, 2011, 02:31 PM
SX_
.........lost..........
Zambia, Lusaka, Lusaka
Joined Jun 2005
325 Posts
THAT IS GREAT!

I cant wait to try!
GREAT WORK !! thanks again for sharing!

cheers

Willie
SX_ is offline Find More Posts by SX_
Reply With Quote
Old Jul 24, 2011, 07:18 PM
throw new IOPilotException();
IceWind's Avatar
Ireland, County Dublin, Dublin
Joined Feb 2005
2,691 Posts
Hi Dennis,

Great project you got there, congrats!

Do you think there is still processing power/time free to be able to add a attitude indicator?

Graphically it needs to draw a cross and a line in the screen. Or a dotted line.



AS inputs it needs 2 analogic, that represent the reading for two axis from accelerometers.
I have similar working with the eagletree OSD and getting data out from my tricopter board. But the eagletree osd is too messy for the tricopter, to many wires and I need a cleaner and simple solution.
IceWind is offline Find More Posts by IceWind
Reply With Quote
Old Jul 24, 2011, 07:31 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by IceWind View Post
Hi Dennis,

Great project you got there, congrats!

Do you think there is still processing power/time free to be able to add a attitude indicator?

Graphically it needs to draw a cross and a line in the screen. Or a dotted line.



AS inputs it needs 2 analogic, that represent the reading for two axis from accelerometers.
I have similar working with the eagletree OSD and getting data out from my tricopter board. But the eagletree osd is too messy for the tricopter, to many wires and I need a cleaner and simple solution.
That shouldn't be very difficult to implement, and as long as you don't plan to do any fancy calculations etc. processor power shouldn't be a problem.

You can make the analog-read and the calculations in a line or two.
You can play a bit with ADC clock if you want. I can't remember how long time the ADC needs to take a reading, but you might have to start the conversion in one line and read it later.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 24, 2011 at 07:37 PM.
Reply With Quote
Old Jul 24, 2011, 08:15 PM
throw new IOPilotException();
IceWind's Avatar
Ireland, County Dublin, Dublin
Joined Feb 2005
2,691 Posts
On a 328p the specs say: 13 - 260 µs Conversion Time.

Tomorrow I'll get a look into the code and see what I can do.
IceWind is offline Find More Posts by IceWind
Reply With Quote
Old Jul 24, 2011, 09:10 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
The code has just been updated post 1.

Please use this version instead of v0_01 (Or at least make sure the SPI don't idle high - that's the most important update).

Updates;
  • Prevent SPI from idling high
  • Line of sight calculation
  • Heading home
  • Arrow home added
  • Buffer added to speed and altitude to prevent "flashing" (if the screen updates while the speed is updated from GPS-string)
  • Large numbers finished
  • Minor change to layout (- but off course you can just arrange the text/info the way you like)

Anything else that should be implemented (I will not add ekstra sensors etc. now)?
More fancy graphic can be added as you like, just play with the bit-patterns
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 25, 2011, 05:59 AM
FPV from Lithuania
vipix's Avatar
Lithuania
Joined Mar 2007
128 Posts
Can you make support for INA139 current sensor?
vipix is offline Find More Posts by vipix
Reply With Quote
Old Jul 25, 2011, 06:03 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by vipix View Post
Can you make support for INA139 current sensor?
If I remember correctly INA139 outputs voltage linear to the current without any offset. So that should almost be plug-n-play.

Remove the offset calibration and edit the calculation to match 25A/50A/100A sensor or whatever you are using. Then you should be good to go
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 25, 2011, 07:18 AM
Registered User
Joined Jun 2011
27 Posts
You said it's very hard to make these characters.
So I made a little program for doing this. I hope this could help you with the OSD development.

It's written in Java. So if you haven't installed it yet, go on www.java.com and download the Java Runtime (JRE). Then you can start it with a double click on the .jar file.
jflyer2 is offline Find More Posts by jflyer2
Last edited by jflyer2; Jul 25, 2011 at 08:30 AM.
Reply With Quote
Old Jul 25, 2011, 07:43 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by jflyer2 View Post
You said it's very hard to make these characters.
Narh it's not very difficult, it's just take quite some time to test.

Quote:
Originally Posted by jflyer2 View Post
So I made a little program for doing this. I hope this could help you with the OSD development.

It's written in Java. So if you haven't installed it yet, go on www.java.com and download the Java Runtime (JRE). Then you can start it with a double click on the .jar file.
Wow, that's very nice
May I ask how long it took you to make that?

I have just tried it, and it works very well. Awesome
It's really nice that you can write the bit's directly like this;
0b00011111,0b11000000,
0b00011111,0b11000000,
0b11111111,0b11111000,
0b11111111,0b11111000,
0b11000000,0b00011000,
0b11000000,0b00011000,
0b11000000,0b00111000,
0b11000000,0b01111000,
0b11000000,0b11011000,
0b11000001,0b10011000,
0b11000011,0b00011000,
0b11000110,0b00011000,
0b11001100,0b00011000,
0b11011000,0b00011000,
0b11111111,0b11111000,
0b11111111,0b11111000,

Would you mind if I attach your program in post 1? It's a great tool for creatig graphic etc.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 25, 2011 at 07:57 AM.
Reply With Quote
Old Jul 25, 2011, 08:17 AM
Registered User
Joined Sep 2010
2,424 Posts
Top notch work ... May i ask how is it with the compatibility of other gps's for example the dealextreme 21 dollar em-411..
msev is online now Find More Posts by msev
Reply With Quote
Old Jul 25, 2011, 08:33 AM
Registered User
Joined Jun 2011
27 Posts
I updated the program. It's now in this format.
You can put it in the first post.
jflyer2 is offline Find More Posts by jflyer2
Reply With Quote
Old Jul 25, 2011, 10:24 AM
FPV from Lithuania
vipix's Avatar
Lithuania
Joined Mar 2007
128 Posts
http://www.dealextreme.com/p/arduino-nano-v3-0-81877
http://www.dealextreme.com/p/em-411-...-chipset-80037

Can i use this stuff for yours OSD?
Also i want INA139 support
vipix is offline Find More Posts by vipix
Reply With Quote
Old Jul 25, 2011, 11:33 AM
Registered User
Joined Sep 2001
6,190 Posts
Quote:
Originally Posted by IceWind View Post
Hi Dennis,

Great project you got there, congrats!

Do you think there is still processing power/time free to be able to add a attitude indicator?

Graphically it needs to draw a cross and a line in the screen. Or a dotted line.



AS inputs it needs 2 analogic, that represent the reading for two axis from accelerometers.
I have similar working with the eagletree OSD and getting data out from my tricopter board. But the eagletree osd is too messy for the tricopter, to many wires and I need a cleaner and simple solution.
cactus is offline Find More Posts by cactus
Reply With Quote
Old Jul 25, 2011, 12:22 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by msev View Post
Top notch work ... May i ask how is it with the compatibility of other gps's for example the dealextreme 21 dollar em-411..
The GPS-reading should be compatible with more or less all standard GPS. Just be aware, that the analyzing of latitude an longitude needs to be updated. At the moment it assumes a flat earth with Denmark in center

It was just meant as a hobby project for myself and perhaps a friend or two. But as quite a few seems to be interested I might update the code to be more flexible.
But that want happen before I have tested it IRL a couple of times :P

These things should be updated for a more flexible solution. Feel free to help out.
  • NTSC support (I use PAL and as I don't have any NTSC cameras I want be able to make this)
  • Calculations done with latitude and longitude should be re-written to support a round earth
  • More flexible current calculation (Shouldn't take long)

Quote:
Originally Posted by vipix View Post
Wow, cheap Arduino.. Very nice. If AIN0, AIN1 and MOSI is breaked out you should be fine. I will have a look later and probably buy one
That would make a great and cheap solution (cheaper than Arduino Pro, and you don't need an external FTDI chip to program it)


Quote:
Originally Posted by jflyer2 View Post
I updated the program. It's now in this format.
You can put it in the first post.
Very nice, thanks a lot
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 25, 2011 at 01:02 PM.
Reply With Quote
Old Jul 25, 2011, 01:13 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by vipix View Post
AIN0, AIN1 and MOSI is available, so Arduino Nano should be a great choice as well.
With a 17 $ Arduino Nano and 23 $ GPS this could make a pretty cheap OSD

Now we just need a cheap current sensor. The one I use costs about 10 $
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 25, 2011, 10:41 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Just got an idea to simplify/change the circuit a little.
The diode used to generate the biasing voltage and reference voltage can be replaced with a filtered PWM output - which will give a DC-voltage. The DC-voltage can be directly controlled by changing the duty cycle of the PWM signal (to give a DC voltage from 0 - 5 volt).

I have made a few tests on breadboard, and I'm able to get a good synch with just 4 components. The RC-filter, a diode and the AC-coupling capacitor. A 10K (or something like that) pull-down resistor in the climping circuit might be a good idea.
To use as few components as possible I have used ground as reference voltage

This code can be used to generate fast PWM on pin 9 (OC1A/PB1)
TCCR1A =
(1<<COM1A0)|
(1<<COM1A1)|
(0<<WGM11)|
(1<<WGM10) ;

TCCR1B =
(1<<WGM12)|
(0<<CS12)|
(0<<CS11)|
(1<<CS10);

OCR1AL = 207; // Compare register - used to control voltage.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 26, 2011 at 06:36 AM.
Reply With Quote
Old Jul 26, 2011, 08:03 AM
Expert
Joined Mar 2007
83 Posts
nice if you can make 8k version for hk e-osd
you first version i success ported to mega88
but 2.0 is too large (12k)
redsonic is offline Find More Posts by redsonic
Reply With Quote
Old Jul 26, 2011, 12:34 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by redsonic View Post
nice if you can make 8k version for hk e-osd
you first version i success ported to mega88
but 2.0 is too large (12k)
Can I ask how much you had to change to make it work with the HK e-osd? I suppose only the analog comparator vector had to be changed? Or does the HK e-osd use the analog comparator as well? In that case I guess it's more or less plug-n-play

The HK e-osd would be an easy hardware-solution, if just the RX and TX pin was available (Without modding) it would have been perfect. Unfortunately this is not the case.
If the RX and TX pin was available I would be happy to make a version for e-osd. But with limited pin-access and memory I don't plan to do any work on that. Sorry.

If you wan't to use V0_02 with the e-osd it shouldn't be very difficult to do a little cleaning and save some memory. But quite a few lines of codes have been added since V0_01
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 26, 2011, 03:59 PM
Registered User
Joined Sep 2010
2,424 Posts
That arduino is really priced good, who's gonna be the guinea pig and try it out
msev is online now Find More Posts by msev
Reply With Quote
Old Jul 26, 2011, 04:05 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by msev View Post
That arduino is really priced good, who's gonna be the guinea pig and try it out
I ordered one yesterday - so guess that will be me
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 27, 2011, 01:09 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
The OSD was tested shortly on a quad today. Unfortunately the RC-control glitched with a broken prop as result. So unfortunately only a quick test.

Anyway, it seems to work fine, but the characters at the top can be quite difficult to read with a white background. I might have to dim the background a bit.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 27, 2011, 05:16 PM
SILURIA / UK
Shikra's Avatar
United Kingdom
Joined Jun 2009
2,446 Posts
Quote:
Originally Posted by Dennis Frie View Post
AIN0, AIN1 and MOSI is available, so Arduino Nano should be a great choice as well.
With a 17 $ Arduino Nano and 23 $ GPS this could make a pretty cheap OSD

Now we just need a cheap current sensor. The one I use costs about 10 $
Even cheaper - Use the throttle position as a current draw indicator!
i.e. Y off the throttle and use the pwm signal as indicator of current. Cheaper, simple and pretty accurate. Surprised no other OSD;'s offer this option.
Shikra is offline Find More Posts by Shikra
RCG Plus Member
Latest blog entry: MultiWii OSD - MWOSD NG
Reply With Quote
Old Jul 27, 2011, 05:25 PM
throw new IOPilotException();
IceWind's Avatar
Ireland, County Dublin, Dublin
Joined Feb 2005
2,691 Posts
For that you'd need to know the maximum current draw at max throtle and had to assume that the current draw change is linear to the throtle change, or I'm getting the wrong idea here.
IceWind is offline Find More Posts by IceWind
Reply With Quote
Old Jul 27, 2011, 05:31 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by IceWind View Post
For that you'd need to know the maximum current draw at max throtle and had to assume that the current draw change is linear to the throtle change, or I'm getting the wrong idea here.
You could make a calibration and get a good approksimation. But as the batteries gets discharged - full throttle would suddenly result in a much lower current draw etc.

All in all, a cheap solution is great - but at this point I would rather spend 10$ on a current sensor
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 28, 2011, 04:10 AM
Look Sideways at Polarisation
Funky Diver's Avatar
United Kingdom, England, Darlington
Joined Jun 2011
101 Posts
$10 is hardly breaking the bank now is it...

Excellent work Dennis
Funky Diver is offline Find More Posts by Funky Diver
Reply With Quote
Old Jul 28, 2011, 08:04 AM
Registered User
Joined Jun 2009
16 Posts
Hi, where can I purchase current sensor for $10?

Sorry if I missed that information....

Hey, Dennis - I wish to thank you and at the same to shout at you - you made me spend over 2000€ because of your idea.

If you can not understand me because of my English - this is a joke somehow - I spend around 1500€ on aurdino stuff because your post reruted me into robotics and just did not have enough energy to buy some more aurdino systems and also robot parts to build my first autonomus robot. You opened a whole new world for me at just a proper time. I am moving to Sydney and I am allready afraid because if I would be able to regulary flight my biger planes such as FunCub there - so robotics will somehow fullfill my kids desire in me...

I plan to use DIY Osd in mini Skywalker for FPV, it has allready FY20 build in...

Tnx,
Regards Ales
mpesi1702 is offline Find More Posts by mpesi1702
Reply With Quote
Old Jul 28, 2011, 02:03 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quick update...
  • Top numbers replaced with large numbers instead.
  • Dimming added (see picture below)

Test with dimming (need to adjust resistor). It looks much better on a screen than the cheap video-grabber

(At this picture the reference voltage is set to ground and the video-signal is biased with a fast pwm output from the micro-controller. Sync is not too bad )
I don't really like the idea about dimming the background - but it's an easy solution to make the text readable with white background.

I have ordered a recorder, so hopefully I'll be able to get some ground-recording later.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 28, 2011 at 02:20 PM.
Reply With Quote
Old Jul 28, 2011, 02:14 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by mpesi1702 View Post
Hi, where can I purchase current sensor for $10?

Sorry if I missed that information....

Hey, Dennis - I wish to thank you and at the same to shout at you - you made me spend over 2000€ because of your idea.

If you can not understand me because of my English - this is a joke somehow - I spend around 1500€ on aurdino stuff because your post reruted me into robotics and just did not have enough energy to buy some more aurdino systems and also robot parts to build my first autonomus robot. You opened a whole new world for me at just a proper time. I am moving to Sydney and I am allready afraid because if I would be able to regulary flight my biger planes such as FunCub there - so robotics will somehow fullfill my kids desire in me...

I plan to use DIY Osd in mini Skywalker for FPV, it has allready FY20 build in...

Tnx,
Regards Ales
Over 2000 €? wow :P
That's quite a few arduino's.

At the moment I use an Allegro ACS755 current sensor.
http://www.allegromicro.com/en/Produ...0755/index.asp
A friendly person here on RCG donated a few for this project - awesome

- but apparently they have been replaced with a newer version (ACS758);
http://www.allegromicro.com/en/Produ...0758/index.asp

I haven't checked the difference, but I guess it's more or less the same product.

Here in DK they cost around 10 $. On digikey they cost around 7 $
http://search.digikey.com/scripts/Dk...me=620-1320-ND

http://search.digikey.com/scripts/Dk...acs758&x=0&y=0
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 28, 2011, 03:52 PM
Registered User
Italia, Lombardia, Milano
Joined Jun 2010
146 Posts
Quote:
Originally Posted by Dennis Frie View Post
Quick update...

.......
I don't really like the idea about dimming the background - but it's an easy solution to make the text readable with white background.

I have ordered a recorder, so hopefully I'll be able to get some ground-recording later.
Hi Dennis, this job is great!
Please submit your modified schematic/arduino sketch with the new video-signal bias with a fast pwm because I want to start by myself some testings.

Ciao, Carlo
carlonb is offline Find More Posts by carlonb
Reply With Quote
Old Jul 28, 2011, 03:56 PM
Registered User
Italia, Lombardia, Milano
Joined Jun 2010
146 Posts
Quote:
Originally Posted by Dennis Frie View Post
Quick update...

.......
I don't really like the idea about dimming the background - but it's an easy solution to make the text readable with white background.

I have ordered a recorder, so hopefully I'll be able to get some ground-recording later.
Hi Dennis, this job is great!
Please submit your modified schematic/arduino sketch with the new video-signal bias with a fast pwm because I want to start by myself some testings.

About dimming the background, i think it's possible add a jumper to enable/disable the dimming as you need.

Ciao, Carlo
carlonb is offline Find More Posts by carlonb
Reply With Quote
Old Jul 28, 2011, 05:17 PM
FPV from Lithuania
vipix's Avatar
Lithuania
Joined Mar 2007
128 Posts
Is there easy way to move top line more up and bottom line more down, basicly on edges? My cam outputs wide screen, so i have black lines at top and bottom, so i want to use this lines as backgruond.
vipix is offline Find More Posts by vipix
Reply With Quote
Old Jul 28, 2011, 05:43 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by carlonb View Post
Hi Dennis, this job is great!
Please submit your modified schematic/arduino sketch with the new video-signal bias with a fast pwm because I want to start by myself some testings.

About dimming the background, i think it's possible add a jumper to enable/disable the dimming as you need.

Ciao, Carlo
Hi Carlon
Year the dimming can easily be turned on/off, but I would prefer a solution with black outlining.

Personally I prefer to have a pot to change reference voltage or bias voltage, but you can make it as you like. You might want to change the fast PWM to 9 bit for better accuracy.
At the moment the code is a mess. I will clean it a bit and upload.

Have anyone successfully used the code? I guess most of you guys are using NTSC?
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Diy osd karl k FPV Talk 2 May 03, 2011 01:31 AM
Idea New DIY OSD? atari7202 FPV Talk 1 Mar 25, 2011 01:08 AM
Discussion see my own diy OSD video Passion Aerial Photography 7 May 27, 2010 02:28 AM
Discussion REAL homebrew DIY OSD - Check it out! jafoca FPV Talk 8 Jun 29, 2009 07:52 PM
Discussion picoOSD DIY PIC12F683 based OSD in C kbosak FPV Talk 6 Jan 31, 2008 08:47 AM