HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jan 27, 2011, 10:45 PM
.H.
Registered User
Atherton, QLD Australia
Joined Jan 2011
20 Posts
Discussion
Homemade microcontroller servo tester

PIC 16F877A + HDD44780 16*2 LCD

Pics

Video
.H. is offline Find More Posts by .H.
Reply With Quote
Sign up now
to remove ads between posts
Old Jan 28, 2011, 07:53 AM
a.d.m.i.n
reptor's Avatar
Joined Jan 2011
415 Posts
Can you also set "speet" ?
reptor is offline Find More Posts by reptor
Reply With Quote
Old Jan 28, 2011, 08:06 AM
"MAYONNAISE"
Acetronics's Avatar
Le Treport, France
Joined Jun 2004
1,397 Posts
Hi,

I didn't know DUTCH was the official language in Australia ...

BTW ... POT is a really awful command and you should use ADC instead ...

Alain
Acetronics is offline Find More Posts by Acetronics
Reply With Quote
Old Jan 28, 2011, 08:39 AM
Ugly planes do not fly
_Sergey_'s Avatar
USA, GA, Alpharetta
Joined Mar 2007
1,689 Posts
Hi .H.! Great project! Where did you buy this display?
_Sergey_ is offline Find More Posts by _Sergey_
Reply With Quote
Old Jan 28, 2011, 10:23 AM
"MAYONNAISE"
Acetronics's Avatar
Le Treport, France
Joined Jun 2004
1,397 Posts
Quote:
Originally Posted by reptor View Post
Can you also set "speet" ?
Yes ...

"Speet" is the speed you turn the pot knob ....

Seriously : an interesting feature to add ... especially VERY low speed to check Servo pot wear ...

Alain
Acetronics is offline Find More Posts by Acetronics
Last edited by Acetronics; Jan 28, 2011 at 10:42 AM.
Reply With Quote
Old Jan 29, 2011, 04:08 PM
.H.
Registered User
Atherton, QLD Australia
Joined Jan 2011
20 Posts
Most parts can be bought from ebay:

LCD
16F877A
Programmer

The problem with these microcontroller projects is that source code often can't be used across different types of microcontrollers as each has their own preferred language. Even if you and I use the exact same microcontroller, we can still use different programming languages. It is quite expensive / time consuming to make a transition to a different microcontroller, unless you are really familiar with the concepts. The Arduino platform is quite accessible and seems to be the most popular. It uses a C style programming language. (Proton PICbasic I used is NOT free software...there is a light version, but it is quite limited). I used http://www.picbasic.nl to learn about PIC microcontrollers. I used http://www.voti.nl dwarf boards (DB001.pdf) to connect the microcontroller to my application boards. Microchip online webshop allows ordering of 4 free sample PIC microcontrollers per month ($10 USD shipping worldwide). Ordering samples that way is a bit of a hassle.

Currently I measure the charge time of a capacitor to get a value between 0 and 255 to manually drive the servo. If people want to use a different PIC microcontroller (without onboard ADC) all will work still. I found this is accurate enough, but I agree using the ADC of the PIC16F877A would be better.

Potmeter is already connected to PortA.1, which is an Analog-to-Digital Converter input (ADC). I could easily use the ADC to measure an analog voltage between 0 and 5 volt and convert that to a digital value.

(I am a Dutch Ozzie who moved to Australia...I can translate the comments to English if anyone is actually thinking of using my code)
.H. is offline Find More Posts by .H.
Last edited by .H.; Jan 30, 2011 at 03:51 AM.
Reply With Quote
Old Jan 29, 2011, 04:20 PM
a.d.m.i.n
reptor's Avatar
Joined Jan 2011
415 Posts
Yes translate to english and make code compatible with adc pic 16f877A;

many thanks!
reptor is offline Find More Posts by reptor
Reply With Quote
Old Jan 29, 2011, 04:59 PM
a.d.m.i.n
reptor's Avatar
Joined Jan 2011
415 Posts
Can you please upload proteus file of this project on your page?
reptor is offline Find More Posts by reptor
Reply With Quote
Old Jan 29, 2011, 05:10 PM
.H.
Registered User
Atherton, QLD Australia
Joined Jan 2011
20 Posts
I have updated all comments to English for servotester.bas.txt

Reptor,
You can buy a servo tester without LCD on eBay for about $10 USD and with LCD for $40 USD. Some come in a proper metal container. I chose to build one from scratch so that I am in full control over what it does / how it works. I would recommend buying an existing one instead of building one like I did, unless you are familiar with Proton PICBasic.

Cost to build mine will be around $100 USD to purchase 16F877, LCD, programmer, ProtonBasic software and dwarf board...(parts are reusable, at least). You wouldn't need a dwarf board if you solder directly onto the microcontroller. It is recommended to use a 40 pin IC socket though, in case you fry the microcontroller and you have to desolder 40 pins :-)

(The schematic fails to show an 7805 voltage regulator over the power input and ground to allow the circuit to be driven by a voltage between 5V and 12V. An 7805 will always output 5V and up to 1A of current.)
.H. is offline Find More Posts by .H.
Last edited by .H.; Jan 30, 2011 at 03:48 AM.
Reply With Quote
Old Jan 29, 2011, 05:29 PM
a.d.m.i.n
reptor's Avatar
Joined Jan 2011
415 Posts
Quote:
Originally Posted by .H. View Post
I have updated all comments to English for servotester.bas.txt
ADC code will have to wait at least a week.

Reptor,
You can buy a servo tester without LCD on eBay for about $10 USD and with LCD for $40 USD. Some come in a proper metal container. I chose to build one from scratch so that I am in full control over what it does / how it works. I would recommend buying an existing one instead of building one like I did, unless you are familiar with Proton PICBasic.

Cost to build mine will be around $100 USD to purchase 16F877, LCD, programmer, ProtonBasic software and dwarf board...(parts are reusable, at least). You wouldn't need a dwarf board if you solder directly onto the microcontroller. It is recommended to use a 40 pin IC socket though, in case you fry the microcontroller and you have to desolder 40 pins :-)

(The schematic fails to show an 7805 voltage regulator on input to allow the circuit to be driven by a voltage between 4.5 and 12V or so)
I have at home PIC and screen, also other material; you add hex file, so I can upload to PIC with picKit2; just I don't know if to use capacitor(and hid charge measure time->adc), or other method which is more precisely, any suggestion?
reptor is offline Find More Posts by reptor
Reply With Quote
Old Jan 29, 2011, 09:31 PM
.H.
Registered User
Atherton, QLD Australia
Joined Jan 2011
20 Posts
Reptor,

1) I have added the Proteus file "pic16f877_servotester.DSN.txt" as an attachment to the article on my website.
2) I have added an Analog-to-Digital Converter (ADC) variant as attachments to the article on my website as well. I haven't tested/built the circuit in real life yet. It works fine in Proteus simulations.

Also, have a look here:
Servo
Pot
LCD
This explains in more detail how to control a servo, a character LCD and use the POT instruction.
Please note that all this is translated from Dutch and only works in Proton PICbasic.

I would use the potmeter and capacitor schematic instead of the ADC schematic for now.

Even better, before you go overboard - just try this: use the microcontroller, a pushbutton and a servo. If you have a 10Mhz crystal and a few resistors/capacitors you should be able to test the basics.
You don't need to hook up an LCD display and potentiometer/capacitor for a simple test build. This drastically reduces complexity.
.H. is offline Find More Posts by .H.
Last edited by .H.; Jan 30, 2011 at 03:55 AM.
Reply With Quote
Old Jan 30, 2011, 04:31 AM
a.d.m.i.n
reptor's Avatar
Joined Jan 2011
415 Posts
I get some error's at second "option" with use ADC of PIC; Proteous said " Port A1 is not configured as an analog input" maybe you must change configuration of PIN in code
reptor is offline Find More Posts by reptor
Reply With Quote
Old Feb 01, 2011, 05:43 AM
.H.
Registered User
Atherton, QLD Australia
Joined Jan 2011
20 Posts
Double click on the PIC 16F877A symbol in Proteus to see what program you have assigned to it. Proteus 'pic16f877_servotester adc.DSN' simulation circuit works in combination with 'servotester adc.bas' or 'servotester adc.hex'.

I do not have enough information to assist in diagnosing your problem unfortunately. I can not reproduce what you describe.

(There is a category 4 cyclone coming this way - google 'Yasi' if you're curious, so I might be off the air for a while...)

Greetings from Atherton, Australia
.H. is offline Find More Posts by .H.
Reply With Quote
Old Feb 01, 2011, 02:16 PM
"MAYONNAISE"
Acetronics's Avatar
Le Treport, France
Joined Jun 2004
1,397 Posts
Hi

I Think Raptor is not too bad on this one ...

a look at the ADCON1 coding table ( datasheet ) shows you shouldn't have RA.0 as an output and RA.1 as an ADC Input ...

but RA.0 as ADC input and RA.1 as signal Output ...

ISIS doesn't "protest" anymore, once that corrected ...

Alain

PS: never trust in simulators ...
Acetronics is offline Find More Posts by Acetronics
Reply With Quote
Old Feb 02, 2011, 02:53 PM
Stuart
srnet's Avatar
UK, Cardiff
Joined Dec 2008
3,154 Posts
As someone has mentioned proton Basic for the PIC, is it avaialble in demo mode, I would like to compare it with Mikrobasic, re code size for the smaller PICs.

Mikrobasic is free to use for the 2K PICs.
srnet is offline Find More Posts by srnet
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Servo tester circuit for single cell servo? flyboy1001e DIY Electronics 24 Jun 14, 2011 02:04 AM
Sold RC Accents Servo Tester Bill Hawthorne Aircraft - General - Radio Equipment (FS/W) 1 Oct 25, 2010 01:18 PM
Discussion servo tester jayanthyk192 DIY Electronics 26 Oct 09, 2010 09:13 AM
Discussion Servo tester Golf Alpha Zulu Giant Electric Planes 0 Sep 07, 2010 04:10 PM