Replacement electronics for the Quacker

The current electronics are not robust enough. In moving the components over to the new housing, things are coming apart, soldered connections are failing, etc. There’s not really enough space in the box so everything’s crammed in and nothing has any strain relief so the cramming-in is causing failures.

There are two options:

  • Replace the current nest of wires with a custom-made shield.
  • Replace the entire thing with a standalone Arduino – one board that includes all the supporting circuitry

Either way, I think I should also move away from the two relays currently used to control the bang and the siren and just use transistors instead – I’m not sure why I didn’t do that the first time.

The schematic I have is not actually right as the indicator light has a voltage doubler to bring it closer to the required 24V. I should make a new one.

No data sheet for the central locking actuator and nothing much came up on googling. Attempted to measure peak curtent with multimeter that has no peak function… the highest value I saw was about 2.5A, so let’s assume 3A@11.1V. This probably requires a MOSFET to switch.

Siren is 350mA@12V according to the datasheet.

 

Infra-red detection research

  • Acrylic infra-red filters (data sheet)
  • There are infra-red sensors but they are what is used in PIR detectors, they are expensive (£2.50 a go) and seem to require fairly complex supporting circuitry
  • There are also infra-red receivers for remote controls. They are cheap and combine a sensor (perhaps a phototransistor?) with a pre-amp, and include daylight filtering. Possibly a good bet. Example (data sheet).
  • Finally, bare phototransistors. Very cheap. From the datasheet it looks like they might allow more current to pass when exposed to more IR, which might be useful. Example (data sheet).

I tested a small solar panel by exposing it to IR, there was no difference at all in the voltage it produced. Though possibly other panels may work.

Notes on making a tricopter

Making a Quad- or Tri-copter is a project I’ve been tempted by for a long time. Ever since I got an RC heli, which I’ve since abandoned. The Heli was too hard to fly, and there wasn’t much motivation to persevere — having learned, all you can really do is aerobatics, which I’m not very interested in. A quad, on the other hand, is easier to fly and much more flexible: I could add cameras, sensors, telemetry, code it to do interesting things, etc. And lots of people have done this so it’s an easy thing to Google about.

The tricopter seems the most appealing so far – interesting build, nice balance of stability and maneuverability.

Interesting things so far:

I’ll update this post with more stuff.

Design notes

Frame

I thought there would be maths (shuddder) about frame size vs prop size vs motor power and all that sort of thing, but this FAQ says the main considerations are maneuverability and stability. A smaller frame is more nimble but less stable, and vice versa.

Since I’m a beginner, a larger, more stable frame seems like a good idea. It also seems plausible that it’s a better platform to develop from: I could perhaps add bigger motors/props to increase lift, for example, without having to change the frame. (Guess).

The RCExplorer v2.6 arms are 480mm, which seems a good place to start. I think I’ll also use the frame design from RCExplorer as it’s well proven and designs are available.

Some tips from this thread:

  • Prop wash over the arms causes vibration. Try to mount the props at least as far above the arms as the prop radius.
  • ESCs (unsurprisingly) work better if kept cool. Perhaps worth mounting them in the prop wash?

Props

Not much headway on this yet. RCExplorer (again!) recommends the smallest props you can as smaller props are lighter and have less air resistance, making them more stable.

Trial and error seems a sensible approach here, as long as the prop doesn’t overwork the motor.

Control board

From this table, Arducopter seems both very functional and reasonably priced. Lots of resources for it too.

Beyond (advanced) features (that I won’t need for ages, if ever), I still don’t have a clear idea what the pros and cons of the various boards are, though. For example, noob-friendliness, ease of repairs. The KK board does have a screen to guide you through the process, which might make it preferable to start with. And it’s cheap, so easy enough to replace with something more feature-rich later.

ESCs

There are so many important bits of information in the big tips thread that it’s not really worth reproducing them here. Just go read it.

Use NiMH mode even for a LiPo battery, because the low-voltage mode engaging (to protect the LiPo) causes flips (eek).

Motors

RCExplorer uses these for the v2.5. Mentioned elsewhere too. Is 750kV enough? What are the considerations?

Batteries

TBC

Video

Not planning to do this immediately, but from reading so far, there is stuff worth noting.

Apparently, the only legal frequencies for airborne video tx in the UK are 2.4 and 5.8GHz. These are very short wavelengths with poor penetration and are limited to 10mw and 25mw respectively. This sounds totally dreadful, but people do claim that they can get decent range (up to a mile) with a high-gain antenna. A significant number of other people are (unsurprisingly) completely flouting the law. It does seem a bit OTT.

Obtaining an amateur radio licence makes no difference as they do not include airborne transmissions (out of date but probably still accurate: Amateur Radio (Foundation) Licence Terms, Provisions and Limitations Booklet BR68/F, para 2(6)). Possible exception: higher power 5.8GHz transmitters at 250mw rather than 25mw.

It seems that to stay legal you can only use 2.4GHz or 5.8GHz. My transmitter is 2.4GHz and I don’t want to replace that with an (obsolete) 35MHz transmitter. So it seems it’s 5.8GHz or bust.

Telemetry, sensors

I’ll think about these later.

Transmission of telemetry data is permitted on 433.05 to 434.79MHz up to 10mw.

 

High- and low-pass RC filters

Having generated a just-about-square wave, I’m fiddling with high-pass and low-pass RC filters (still inspired by Afrotechmods).

I’m still using the 50% duty cycle circuit from the NE555N datasheet, except that R1 is 53K and C1 is 100nF.

I’ve taken that output into a low pass filter: the signal comes through a 10K resistor into the scope, and there’s a 10nF capacitor going to ground.

As expected, with a 139.7Hz input signal, the attack and decay are slowed down a little bit:

139Hz, R1=10K, C1=10nF
138Hz, R1=10K, C1=10nF

Increasing the input signal increases the effect:

138KHz, R1=10K, C1=10nF
138KHz, R1=10K, C1=10nF

Increasing the input signal further to 26.1Khz gives a nice saw triangle wave:

26.1KHz, R1=10K, C1=10nF
26.1KHz, R1=10K, C1=10nF

And increasing it ridiculously produces a DC signal:

261Khz, R1=10K, C1=10nF

I’d like to have made a better saw triangle wave but I don’t have the right value of capacitor for the 555 circuit. However, increasing C1 to 231nF (7x33nF) and setting the input signal back to 139Hz produces a lovely one:

139Hz, R1=10K, C1=231nF
139Hz, R1=10K, C1=231nF

And a very similar wave is produced by setting C1 back to 10nF and increasing R1 to 220K:

139Hz, R1=220K, C1=10nF
139Hz, R1=220K, C1=10nF

This is explained by something called “maths“, but I’m happy enough to see that changing either one works. Afrotechmods suggested selecting the value of R1 to suit the load on the output signal, and changing C1 to get the appropriate wave. Which seems sensible.

Switching the positions of R1 and C1 gives a high pass filter, and as expected, produces the following wave:

140Hz, C1=10nF, R1=220K
140Hz, C1=10nF, R1=220K

In the process of making a silly mistake, I also found that leaving R1 out made the wave much tidier, completely getting rid of the ramping down and up that I couldn’t get eliminate in the 555 circuit! Neat:

No ramping up and down
No ramping up and down

Though, as you would expect from a high pass filter, the peaks and troughs are no longer quite flat. I’m not sure how to expect a high pass filter to behave without R1, so I don’t really know if this is meaningful or useful.

Anyway, decreasing the input signal to 78Hz produces a more pronounced change:

78Hz, C1=10nF, R1=220K
78Hz, C1=10nF, R1=220K

As does decreasing C1 to 1.4nF (3x470pF):

140Hz, C1=1.4nF, R1=220K
140Hz, C1=1.4nF, R1=220K

Decreasing C1 to 1pF gets us back to DC:

140Hz, C1=1pF, R1=220K
140Hz, C1=1pF, R1=220K

As does decreasing R1 to 10R:

140Hz, C1=10nF, R1=10R
140Hz, C1=10nF, R1=10R

However, I couldn’t quite get it back to DC by passing in a lower frequency wave. I made the filter a bit more aggressive by changing R1 to 100K, and passed in 12.5Hz. But no matter how low the frequency, there are always upwards and downwards spikes when the input signal changes from high to low, or vice versa:

12.5Hz, C1=10nF, R1=100K
12.5Hz, C1=10nF, R1=100K

I think I’ll leave that mystery for another day.

Generating a square wave from a 555 timer

Inspired by Afrotechmods, I thought I might try experimenting with RC filters and wave generators. I bought a second probe for my scope so I can see the input and output signals at the same time (neat).

Since I don’t have a signal generator, I thought a good start might be to try making a 555-based circuit that generates a square wave to pass into some filters to see what happens. I did wonder about doing this with an Arduino, but that seems like cheating. And it would be good to get into the habit of doing things in hardware when I can, instead of going straight to a microprocessor.

I’ve also wondered before about producing a 50% duty cycle from a 555, which isn’t something I’ve done — an astable always seems to be more one way than the other, and I’m not sure why. From Wikipedia, I learned that the duty cycle is described as a percentage, where the percentage is the time the signal is high. It can therefore be calculated as:

D = a / P

Where D is the duty cycle, a is the time the signal is active, and P is the period of the wave.

To start with I built the 50% duty cycle circuit from the NE555N datasheet. I don’t have any 51K resistors (which sounds like an odd value) so I used a 47K. Perhaps predictably, the resulting wave was not 50%:

1.228KHz
R1 = 47K, C1 = 10nF, f = 1.228KHz, a = 0.3ms, p = 0.82ms, d = 0.366

Experimenting with the value of C1 produced the results I would expect. With 4.7nF:

1.698KHz
R1 = 47K, C1 = 4.7nF, f = 1.698KHz, a = 0.22ms, p = 0.59ms, d = 0.373

With 4.7 and 10nF in parallel:

0.708KHz
R1 = 47K, C1 = 14.7nF, f = 0.708KHz, a = 0.51, p = 1.39ms, d = 0.367

With 100nF:

109.3Hz
R1 = 47K, C1 = 100nF, f = 119.3Hz, a = 3.2ms, p = 8.5ms, d = 0.376

As expected, the frequency decreases as the value of C1 increases, and the duty cycle stays constant (ish). Less expectedly, the wave is not particularly square. Here is the 50KHz calibration signal from the scope for comparison:

Scope 50KHz
Scope 50KHz

In any case, one thing at a time. The 50% duty cycle might be caused by not following the instructions from the datasheet, so I strung together a 47K and 4 1K resistors to get to the magic number. With C1 at 10nF:

R1=51K
R1 = 51K, C1 = 10nF, f = 1.439KHz, a = 0.32ms, p = 0.7ms, 0.457

This is much closer to 50%, but also rather less square. Guess: the higher resistance is causing the cap to charge more slowly, leading to that slower ramp-up. Let’s try a 100K and see how that looks:

R1=100K
R1 = 100K, C1 = 10nF, f = 1.202KHz, a = 0.64ms, p = 0.66ms, d = 0.969

Guess not. The edges are now more similar to the ones with lower values for R1. *confused*. Looking back over the earlier pictures, I think that ramp-up/down actually gets a bit worse as C1 increases. Which does make sense if C1 is taking longer to charge. Changing C1 to 100nF does back this up a bit:

C1=100nF
R1 = 100K, C1 = 100nF, f = 117.4Hz, a = 6.8ms, p = 7ms, d = 0.971

So I guess it’s some mixture of R1 and C1 that I don’t understand. Gratifyingly, though, those last two pictures show clearly that altering C1 alters the frequency without changing the duty cycle (much), and it looks like that that relationship is linear: multiplying C1 by 10 gave a value of p 10 times greater.

Anyway. I set kept C1 at 100nF, put R1 back to 51K and added two more 1K resistors, bringing the total up to 53K, and that gave me exactly a 50% cycle:

R1=53K
R1 = 53K, C1 = 100nF, f = 1145.5Hz, a = 3.6ms, p = 7.2ms, d = 0.5

Good enough, I think, despite the not-quite-squareness.

I wondered then if the values in the datasheet are correct (which seems likely) and if it’s just the low tolerance on these resistors that’s accounting for the difference. So I measured the actual values of R1 and R2 which were 52.3K and 22.24K respectively. I guess it’s not those then. I swapped out the 555 for a different one in case that was damaged or the tolerances there could make a difference. Nope. The value of C1 doesn’t affect the duty cycle very much, so it’s probably not that. And I can’t measure that. So it’ll have to be a mystery.

Next: adding low- and high-pass RC filters.

Making PCBs at home

I’d like to start making PCBs instead of using stripboard. Stripboard is horrid.

I think the easiest approach for me will be to expose the board to UV through a transparency printed on an inkjet. Because there’s an inkjet in the house, and I think that’s how we used to do it at school.

It seems fun to make my own UV box for this, from LEDs. Useful things about that:

On the subject PCBs in general:

I will need:

I already have a printer, Sodium Hydroxide and acetone.

Controlling an LED matrix with a MAX7221

While building a project with a 4×7-segment display, I was irritated by how many pins needed to be used just for the display. I barely had enough to be able to complete the project.

So I looked into methods for controlling an LED matrix with fewer pins. I learned about Charlieplexing, which seems interesting but non-trivial. Then I found the MAX7221 IC, and an Arduino library to interface with it. Perfect. I bought some to try out and they’re very easy to use. Though the display I was using would not run on USB power — I had to connect it to 7.5V from my bench supply.

Useful things:

New project: suitcase Airsoft prop

I’ve still a few bits to do on Captain Quack, but in the meantime, I wanted to jot down some notes about the next project. I’m going to make a defusable suitcase prop to use in Airsoft games. I’d like it to be quite flexible: it should suit lots of scenarios, from being the main event in a filmsim to being an objective in a quick skirmish game.

It should look the part. This will be used in skirmish and filmsim, not milsim, so I think there’s some licence to make it look a bit “Hollywood” rather than being realistic (which would be dull). Google image search found some useful inspiration.

Of course, it also needs to play well, so I’ll make a prototype to test the basic idea. This will consist of a small box with connector for pyro, a removable lid which will expose some cabling of various colours, and a countdown display. In the game, the timer will be set to a countdown value appropriate for the scenario. Players will have to defuse the box before the timer reaches zero. When the timer reaches zero, it will detonate the pyro.

Players will defuse the box by cutting the right cable: there will be many to choose from, and their number and purpose can be selected to suit the game. Some may be dummies. Some will defuse the box. Others will immediately detonate the pyro. (Possible future enhancement: wires which add or remove time on the countdown). Wire cutters may be next to the box, or may be issued to (some or all) players.

In the game, players will need to find out which cable they need to cut. Or, if they’re nearly out of time, take a chance! Again, this can vary to suit the scenario. In some games players might just be told which is the right cable. In others, there may be a puzzle they need to figure out. Or they might need to find intelligence, which could be a separate scenario.

As before, this will be an Arduino project and I’ll build something pretty after testing the game on the prototype. Feedback and ideas welcome!

MCOM – version 1 – Captain Quack goes bang

So, the MCOM worked great. Much fun was had by all, and the box (due to its rather odd siren) was christened: Captain Quack.

It’s a 600x400x400 box built from softwood and 6mm ply, with aluminium edging and stainless steel corner covers. I was pleased with the look. Inside, I had a steel-lined chamber at the bottom of the box with vents between it and the outside. This is where the pyro was loaded, and also where the siren was mounted so that the sound could escape better.

The upper chamber contained the rest of the electronics, and enough space to put other game objectives if desired. There was a removable panel at the bottom so that the steel-lined chamber could be accessed to set the pyro. This was secured using cupboard magnets that I enhanced with some neodymium disc magnets for a more secure hold.

Unfortunately, I forgot to take a picture of it when I finished, and during its second outing, a slightly-more-powerful-than-I-expected pyro did a bit of damage.

Captain Quack took some damage

Anyway, hopefully, you can tell from that picture how it looked before its misadventure!

It performed really well. The first game day there was an annoying bug where the timer would stop itself running. I’m pretty sure that the cause was a short, or some kind of capacitance effect. The box housing the electronics is a metal one, and although I lined it with tape, I think the pins at the bottom of the boards were poking through. Adding better insulation to the boards solved the problem.

The housing for the electronics, with controls mounted

After that, the electronics have worked flawlessly: before and after the pyro that blew it to bits 🙂

For the next version, I’m going to make the steel lined chamber more robust by getting rid of the removable panel and securing the top of the chamber more robustly. The top was completely forced off its mounting: the force of the explosion managed to push out eight 3/4″ screws, as well as blowing the ends and bottom off the box. To secure those, I’m going to screw them to the frame rather than pinning them. I’m also going to replace the vents at each end with a mesh screen.

Panels removed to fix damage. Main siren visible at the left, and the new mesh vent at the right.

Hopefully, a more robust steel lining combined with more ventilation at each end will allow the pyrotechnic’s gasses to escape at each end without doing any damage.

The pyrotechnics are quite serious

Since seeing it in action, I’m also going to add some new safety features: there’ll be a new piezo siren to sound when the explosion is 10 seconds away, the button will be disabled at that point, and we’ll brief players to stand clear when they hear the change in tone. I’m also going to add warning notices at the ends of the box.