Archive for August, 2008
27
Aug

Good morning,

You might want to quickly be able to enable or disable debugging output in your arduino program.

Here is one of many way, I found this on arduino.cc forum:

#define DEBUG

#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.println(x)
#else
#define DEBUG_PRINT(x)
#endif

void setup()
{
DEBUG_PRINT(“here we go!”);
}

Then if you comment out #define DEBUG all the lines with DEBUG_PRINT(“something”) won’t be compiled and sent to the processor. This could help increase production code speed and size.

Read the full post here.

, , , ,

24
Aug

The standard RDP listening port is 3389.

If you ever need to change that port (probably for security reason…) you would need to modify the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber

On the Edit menu, click Modify, click Decimal, type the new port number, and then click OK.
Quit Registry Editor.

Afterward if you want to connect to that computer with an RDP client you will need to specify the port number using the following syntax:

machinename or ip address ok domain + semi column + port number

Example:

mymachine:3389 or somedomain.com:3389 or 192.168.0.22:3389

Cheers,

Marc

, , ,

16
Aug

Good afternoon,

I coded 2 functions this morning to read and write 2 bytes integers to and from the arduino’s eeprom since the standard library (EEPROM.h) was only offering read / write functions for bytes.

See attached source code here: EEPROM-Int-ReadWrite.pde

You can find my thread on www.arduino.cc here.

Cheers,

Marc

, , , , , ,

15
Aug

I bought a cheap 6 channel receiver compatible with the E-Sky EK2-0406A remote control (and using the same crystal as the 4 in 1 standard controller for the honey bee cp2). I found the PPM signal pin and will have it connected to the arduino for the ARCHA project.

Here are some specs of that receiver that can be found under $10.00 usd on ebay:

  • Number Of Channels: 6CH
  • Frequency: FM-72 Mhz
  • Size: 35×22x10 mm
  • Weight: 7.5 gram
  • Antenna Length: 800 mm
  • Operating Voltage: 4~6 V
  • Current Drain: 9 mA
  • Range: 800 M
  • Narrow Band
  • Microprocessor decoder
  • High inter-modulation and interference suppression
  • High adjacent channel selectivity and interference rejection
  • No servo jitter when the transmitter is switched off (** however the ppm signal reading becomes erratic ** will have to build code to reject the erratic ppm signal **)
  • Small dimensions and weight
  • Compatible all FM / PPM transmitters
  • Uses mini or standard sized crystals

Picture of the receiver: (click to enlarge)

SunUP SU/R-6FM

Test rig: (click to enlarge)

SunUP SU/R-6FM - Hack Test Rig

Found the PPM signal! : (click to enlarge)

SunUP SU/R-6FM - Hack Searching for PPM Signal

Close up of the PPM Signal pin (pin 7 of a chip labelled: SU06A on the back of the board): (click to enlarge)

SunUP SU/R-6FM - PPM Pin

That pin will now need to be connected to one of the digital input on the arduino controller. I connected the ppm signal to the digital pin 2 of the arduino (with also a common ground).

The following source code will display the channel values to the serial monitor: PPM_Test.pde

Here is an annotated example of what will appear on your serial console:

**********START********
449 <-Ch2
777 <-Ch3
1184 <-Ch4
561 <-Ch5
1291 <-Ch6
9355 <–Sync Frame
1206 <-Ch1
1247 <-Ch2
778 <-Ch3
1191 <-Ch4
562 <-Ch5
1289 <-Ch6
9356 <–Sync Frame
1211 <-Ch1
1244 <-Ch2
771 <-Ch3
1187 <-Ch4
557 <-Ch5
1287 <-Ch6
9359 <–Sync Frame
1199 <-Ch1
1242 <-Ch2
776 <-Ch3
1174 <-Ch4
554 <-Ch5
1287 <-Ch6
9361 <–Sync Frame

From this sample we can determine that this specific receiver have a sync frame of around 9 milliseconds (9000 microseconds).

The calibration procedure of the Firmware of the ARCHA Project will auto sense that frame length by listening to the ppm signal for around two seconds and then round the maximum value found to the nearest thousand (so 9361 would be sensed as 9000). Then another pass will verify that this value is at least 2000 microseconds higher than all the sensed channel values.

You can read more about PPM here.

, , , , , ,

15
Aug

Here is a picture of a common tri-color (red, green, blue) led: (click to enlarge)

Tri-Color RGB Led Pinout

In the following example: (click to enlarge)

Tri-Color RGB Led Schematic

+5 volts is applied on pin 2 of the led (the longest one) and ground is applied on Red (pin 1), Green (pin 4), Blue (pin 3), this will make them light up.

Please note that the schematic provided earlier will only work if you want to light one color at a time, if you want to light more than one color you will need resistors before the ground on each channel.

The color pins can also be grounded via a micro controller, transistor, mosfet, etc. You can also mix the led colors and intensity (using PWM) to make virtually any color of the visual spectrum.

, , , ,

10
Aug

I bought a few weeks ago an old HP1740A oscilloscope from ebay for roughly 100$. The buttons, knob style and the size of it makes it really old fashion (I even found an inventory tag on it dating from 1984)… but hey! It still works, does a great job and this dual channel scope at 100mhz resolution is perfect for small electronic projects

The manual can be downloaded here: HP1740A Manual (I’m only putting a copy for download here for posterity, not trying to infringe any copyright or whatever.)

Some specifications from the manual:

  • Width 335 millimeters
  • Height 197 millimeters
  • Depth 535 millimeters
  • Weight 28.6 lb
  • Input voltage
    • AC and DC 250V (dc + peak ac) or 500V p-p ac at 1 kHz or less
    • 50 Ohm: 5 Vrms

Some pictures: (click to enlarge)

HP1740A
HP1740A Tag
HP1740A Inventory Tag

, , , , ,

08
Aug

Link to the main ARCHA Project post

I came up with a voltage divider circuit that will be used by the micro controller to monitor the battery level.

Connecting a 5volt analog input between 2 resistors of 4.3k and 1.5k will measure a voltage up to 19.3335volts (which should be more than enough to protect the micro controller from over voltage). I used an online voltage divider calculator found here to determine these values.

After reading on helicopter / models related forums like heliguy and rcgroups I found that somewhere around 10v-10.1v is a good voltage to recharge a li-po battery. This will then be our critical level, 10.5 will be considered as our warning level.

You will find the resistor values, schematic and result table here: (click to enlarge)

Voltage Divider Details and Field Test

Code uploaded to the arduino used to retrieve the analog input value for the field test:

/*********
* Filename: arduino-analogin.pde
* Description: Reads a voltage on Analog Pin 0 and sends the 10 bit result value to the serial port
* Author: Marc Vieira Cardinal
* Creation Date: August 10, 2008
* Revision Date: August 10, 2008
*/

#define ledPin 13 // LED connected to digital pin 13
#define analogPin 0 // Will sense the voltage on the analog 0 pin

int analogValue = 0; // Will store the value of the analog input

void setup()
{
Serial.begin(9600); //Initialize the serial output
pinMode(ledPin, OUTPUT); //Enable the led pin for output
}

void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on

//read the voltage
analogValue = analogRead(analogPin);

//print the value out
Serial.println(analogValue, DEC);

digitalWrite(ledPin, LOW); // sets the LED off

//slight pause
delay(10);
}

Picture of the test bench: (click to enlarge)

Voltage Divider - Test Bench

I noticed from the test that the theorical analog input of the arduino (mathematically calculated) does not match the field test’s value. There seem to be a difference of around 30-40 units. During the firmware programming I will then need to drain the battery until I reach the target voltage of 10.5v, then 10.1 and 10.0v and measure the analog value that will trigger the warning level and critical level alerts.

The voltage divider circuit seems to be working as excepted, even with an input of 12volts only 3.5volts reach the micro controller which keeps him safe from surge.

Cheers,

Marc

, , , , , ,

08
Aug

Link to the main ARCHA Project post

I have gathered some information related to the E-Sky EK2-0406A 6 Channel Remote Control that I will be using with the helicopter, on the back of the controller you can find a Trainer Port, most of the time used by an experienced pilot to teach a newcomer. That port however sends the same kind of PPM signal that we need to hack from the receiver. I connected an oscilloscope to that port to get a visual of the signal, you will find a picture further down.

Picture of the trainer port on the back of the remote control with annotated pinout: (click to enlarge)

E-Sky EK2-0406A Trainer Port

Picture of the remote control: (click to enlarge)
E-Sky EK2-0406A Remote Control

Diagram of the effects of the controller on the honey bee cp2 helicopter: (click to enlarge)

Honey Bee Cp2 RC Helicopter

Picture of the PPM signal seen on the oscilloscope: (click to enlarge)

EK2-0406A PPM Signal on Oscilloscope

The length of each high signal will vary depending on the position of the joysticks on the remote control. This is the same kind of signal I will be looking for during the receiver’s hacking.

Cheers,

Marc

, , , , , , , ,

07
Aug

Good evening,

I came across the following site earlier today when searching for power consumption of a servo motor: http://www.teaser.fr/~osegouin/aeromode/servos.phtml

At the bottom of the page you can download a homebrew software that lets you browse a repository of servos and detailed statistics on each of them like speed, torque, amp consumption, and all that at various voltages.

The software is however only available in French and can be downloaded at the following address: http://osegouin.free.fr/servo/servormances_v22_mai_2007.zip I am however working on an english translation of this that will be available on this site.

Screenshot:

Servo Database Screenshot

Cheers,

Marc

, , , ,

  • Search:
  • Recent Posts

  • Meta

  • Tags