Repost: Martin's PPM tester

Arduino projects on the go
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Repost: Martin's PPM tester

Post by Martin »

Phil: This was another one of the many projects lost when 'reunited' was unexpectedly closed - I dont have a backup and I cant find anything on Wayback, so this is an attempt to recreate it.
In operation its similar to my own PPM tester in that it displays all the pulse widths generated by an encoder, but each has its own advantages - pick the one that suits you (or build both!)
Mine has a large backlit LCD display and optionally can drive servos directly from the PPM, and can also display individual PWM channels (ie a servo signal) from a receiver. Martins is a handy pocket-size using a small but very clear OLED display which includes an oscilloscope type waveform display of the channel pulses, which is really neat. Either one is a handy workbench tool, well worth having - I use both!
Martin's code was also incorporated into Ron's transmitter battery meter, its small enough to fit all but the tiniest of transmitter front panels.

So this is Martins PPM tester project. It uses a 5v Pro-Mini, Nano or anything similar, and just a few connections. Note that the Pro-Mini needs A4 and A5 - some early ones didnt have either. If you use one of the early Deek-Robot or DIY-More printed-circuit boards, remember that they have A4 and A5 annotations reversed. The display is a 1.3" OLED from ebay, for example https://www.ebay.co.uk/itm/1-3-inch-Blu ... 3393681269

PPMtesterATmega328Oled.jpg

With this arrangement the tester is powered from the encoder, ie via the pos of the incoming PPM connector. Of course it could be self-powered by (say) a single lipo cell (4.2v) in which case connect switched positive to Vcc on the Arduino. Leave Vin (sometimes called 'raw') disconnected, and also disconnect the red input wire from the PPM connector, leaving just the neg and signal pins.
I havent shown any protection on the PPM input - Martin used a series 10k in the incoming PPM line and also a 100n capacitor. I didnt bother as I use mine only for testing encoders which are 5v so in my own case, no protection is necessary.

Here's Martin's tester connected to the PPM output of one of my Single-Channel encoders - this particular example is generating 4 channels of negative-going PPM in JR channel order:

ppmtester_jr.jpg

Mine is mounted in a small, clear plastic case, the sort you get with posh motors or servos.
Here it is on the left, alongside my 4-line and 2-line testers, sorry its dark but I have great difficulty photographing displays...

ppm_testers.jpg

Cheers
Phil
Attachments
PPMtesterATtiny85OLED.zip
(17.61 KiB) Downloaded 147 times
PPMtesterATmega328Oled.zip
(8.19 KiB) Downloaded 278 times
Last edited by Martin on 08 Jun 2021, 20:24, edited 1 time in total.
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Repost: Martin's PPM tester

Post by Martin »

Thanks Phil.

I mounted mine in a little 3D printed case with a small LiPo battery for power and one of those teeny Ebay USB LiPo charger/ LiPo protector / step up to 5V output boards. I keep it in my transmitter case, charge it a couple of times per year, and it's proved handy at the field for transferring model settings from one transmitter to another: connect it to the 'source' transmitter, jot down the centre positions and throws - then connect it to the 'destination' transmitter and fiddle with the settings till the same numbers are displayed. The 3.5mm jack plug lead takes up more space than the tester!



Here's the vid I made when it was still on the breadboard, explaining the operation (my original was for a 'naked' ATtiny85). I can probably dig out and upload the ATtiny sketch if anyone wants it.

Mosfets
Posts: 60
Joined: 18 Feb 2018, 20:14

Re: Repost: Martin's PPM tester

Post by Mosfets »

This is a good project (I use both Phil's and Martins' designs) though mine is still on a breadboard, I must get round to finishing it and getting a box made for mine.

Ade
Jlinkous
Posts: 5
Joined: 16 Feb 2019, 06:48

Re: Repost: Martin's PPM tester

Post by Jlinkous »

I'm trying to build your ppm tester, but when I try to verify the sketch, I get an error. It says to redefine the first line of ssdfont. The line reads

const unit8_tfont{}' PROGMEM = [

I have looked on line and can't find anything on this problem. Could you help me out with this?
Jlinkous
Posts: 5
Joined: 16 Feb 2019, 06:48

Re: Repost: Martin's PPM tester

Post by Jlinkous »

Hi Phil I have reloaded and the error 1 still appears, The line reads:
redefination of 'const uint8_tfont {}
exit error status 1
redefination of 'const uint8_t font {}'

if I change the line to :
const uinit8_tfont {} PROGMEM = {

I get :
'uint_tfont does not name a type
exit status 1
'uint_tfont" does not name a type

Therefore, I'm still confused
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Repost: Martin's PPM tester

Post by Martin »

Here's what the first ten lines of the file ssdfont.h should look like:

Code: Select all

// standard ASCII 5x8 font (6 pixel spacing including the one-pixel space best added on left side)

#include <avr/pgmspace.h>

const uint8_t font[] PROGMEM = {
	0x00, 0x00, 0x00, 0x00, 0x00, // space
	0x00, 0x00, 0x5F, 0x00, 0x00, // !
	0x00, 0x07, 0x00, 0x07, 0x00, // "
	0x14, 0x7F, 0x14, 0x7F, 0x14, // #
	0x24, 0x2A, 0x7F, 0x2A, 0x12, // $
(don't worry about the amount of indenting of the lines beginning 0x - that depends on your Arduino IDE settings - and how wide it displays 'TAB' characters - it's probably a lot less than shown above, but that doesn't matter and wouldn't result in the errors you describe).

The sketch compiles without any errors or warnings in my Arduino IDE.

Are you seeing any other errors or warnings besides the one you mention? You may need to 'scroll back' through the window where the error appears to see earlier warnings or error messages - it's possible that your Arduino installation is missing one or more of the standard headers such as avr/pgmspace.h

What version of Arduino IDE are you running? (Choose 'About Arduino' from the Help menu to display).
What operating system (Windows? OSX (Apple)? Linux?)

The .ino file (main sketch file) should be in a folder with the same name as the sketch file (but without the .ino extension), inside your 'Arduino' folder. There should be three other files present in the same folder:

ssdfont.h
SX1X06.h
SX1X06.cpp
Jlinkous
Posts: 5
Joined: 16 Feb 2019, 06:48

Re: Repost: Martin's PPM tester

Post by Jlinkous »

Thanks for the fast reply. Still having the problem though.
I am using IDE 1.8.9 Windows 1.8.21.0 on windows 10.
The 'error 1' I listed is the only error shown. However,looking through the rest of the sketch, I see that I have errors (red text) in SX1X06.h in all lines beginning with 'wire.', and in the sketch in all lines beginning with 'sprintf'. I do have the library 'wire '(from adafruit). in my library, but I can't find the library Arduino.h in either the adafruit or github listings.
I'm still a newbe with Arduino and have, so far been building projects from existing sketches.
I have the first Simon Monk book and the Arduino cookbook, but haven't been able to find much helpful on this problem, so please bear with me.
Thank you for your help.
Is 'avr/pgmspace' a library? If so, I haven't been able to find it either.
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Repost: Martin's PPM tester

Post by Martin »

It's probably the Adafruit wire library that you've installed that's causing the problem.

The default Arduino IDE install has lots of 'standard libraries' - these work in a similar way to libraries you install yourself, but are at a different location. The Wire library is one of them. Adafruit ought to know better than to release libraries of their own with the same names as the standard libraries - but they probably thought it was a good idea at the time!

You don't need to know where they are, but If you did the default install on Windows 10 you'll probably find the standard Wire library in:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\

Don't mess with it, move it or copy it - just leave well alone!

Similarly, pgmspace.h might be found on Windows 10 in (deep breath):

C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\avr\

(probably! - but don't worry about it - I use Arduino on all platforms and I often have no idea where the header files and standard libraries reside).

You can uninstall the Adafruit wire library from your Documents\Arduino\libraries\ folder. If you don't want to do that you can just temporarily rename the folder from Wire to AdafruitWire or similar. Close down the Arduino IDE if it's running, then restart it and have another go at compiling - I hope you'll find that without the Adafruit wire library present the PPM tester sketch will compile and upload without errors.

Let me know if that's not the answer and I'll keep looking! :ugeek:
Jlinkous
Posts: 5
Joined: 16 Feb 2019, 06:48

Re: Repost: Martin's PPM tester

Post by Jlinkous »

Well, I finally got things figured out and working. Just as I figured it was something I did to screw it up. I deleted everything and reloaded the sketch. Surprise, surprise, it compiled, verified and loaded properly.
I still don't know what I did wrong, but it's fixed, and was a learning experience.
'''''Thanks for all your and Rons help and I'm looking forward to building more devices in the future.
Now, back to finishing my Debolt Champ for Phil's Reduino and then a Little Champ for Toby's actuator.

Thanks again, Jeff
Jlinkous
Posts: 5
Joined: 16 Feb 2019, 06:48

Re: Repost: Martin's PPM tester

Post by Jlinkous »

P.S. Another mistake. My apologies to Adafruit. The wire library was from the arduino library.
Post Reply