Filtering Noisy Data with an Arduino

One of the first frustrating situations a beginning microcontroller programmer will come across is the issue of debouncing switches. Microcontrollers are faster than switches, and the switch has yet to be built that can change state in zero time like they can on paper. This hurdle is easily overcome, but soon we are all faced with another issue: filtering noise from an analog signal. Luckily [Paul Martinsen] has put together a primer of three different ways to use an Arduino to filter signals.

The first (and fastest, simplest, etc.) way to filter an analog signal is to sample a bunch of times and then average all of the samples together. This will eliminate most outliers and chatter without losing much of the information. From there, the tutorial moves on to programming a running average to help increase the sample time (but consume much more memory). Finally, [Paul] takes a look at exponential filters, which are recursive, use less memory, and can be tweaked to respond to changes in different ways.

[Paul] discusses all of the perks and downsides of each method and provides examples for each as well. It’s worth checking out, whether you’re a seasoned veteran who might glean some nuance or you’re a beginner who hasn’t even encountered this problem yet. And if you’re still working on debouncing a digital input, we have you covered there, too.

Arduino Versus Logic: The Coil Gun War Continues

Looks like another shot has been fired in the simmering Coil Gun Control War. This time, [Great Scott] is taken to the discrete woodshed with a simplified and improved control circuit using a single CMOS chip and a few transistors. Where will it end? Won’t somebody think of the children?

The latest salvo is in response to [GreatScott]’s attempt to control a DIY coil gun with discrete logic, which in turn was a response to comments that he took the easy way out and used an Arduino in the original build. [Great Scott]’s second build was intended to justify the original design choice, and seemed to do a good job of explaining how much easier and better the build was with a microcontroller. Case closed, right?

Nope. Embedded designer [fede.tft] wasn’t sure the design was even close to optimized, so he got to work — on his vacation, no less!’ He trimmed the component count down to a single CMOS chip (a quad Schmitt trigger NAND), a couple of switching transistors, the MOSFETs that drive the coils, and a few passives. The NANDs are set up as flip-flops that are triggered and reset by the projectile sensors, which are implemented as hardwired AND gates. The total component count is actually less than the support components on the original Arduino build, and [fede.tft] goes so far as to offer ideas for an alternative that does away with the switching transistors.

Even though [fede.tft] admits that [GreatScott] has him beat since he actually built both his circuits, hats off to him for showing us what can likely be accomplished with just a few components. We’d like to see someone implement this design, and see just how simple it can get.

DIY Coil Gun Redux: Life Really is Easier with Arduino

A common complaint in the comments of many a Hackaday project is: Why did they use a microcontroller? It’s easy to Monday morning quarterback someone else’s design, but it’s rare to see the OP come back and actually prove that a microcontroller was the best choice. So when [GreatScott] rebuilt his recent DIY coil gun with discrete logic, we just had to get the word out.

You’ll recall from the original build that [GreatScott] was not attempting to build a brick-wall blasting electromagnetic rifle. His build was more about exploring the concepts and working up a viable control mechanism for a small coil gun, and as such he chose an Arduino to rapidly prototype his control circuit. But when taken to task for that design choice, he rose to the challenge and designed a controller using discrete NAND and NOR gates, some RS latches, and a couple of comparators. The basic control circuit was simple, but too simple for safety — a projectile stuck in the barrel could leave a coil energized indefinitely, leading to damage. What took a line of code in the Arduino sketch to fix required an additional comparator stage and an RC network to build a timer to deenergize the coil automatically. In the end the breadboarded circuit did the job, but implementing it would have required twice the space of the Arduino while offering none of the flexibility.

Not every project deserves an Arduino, and sometimes it’s pretty clear the builder either took the easy way out or was using the only trick in his or her book. Hats off to [GreatScott] for not only having the guts to justify his design, but also proving that he has the discrete logic chops to pull it off.

Continue reading “DIY Coil Gun Redux: Life Really is Easier with Arduino”

Arduino + Software Defined Radio = Millions of Vulnerable Volkswagens

As we’ve mentioned previously, the integrity of your vehicle in an era where even your car can have a data connection could be a dubious bet at best. Speaking to these concerns, a soon-to-be published paper (PDF) out of the University of Birmingham in the UK, states that virtually every Volkswagen sold since 1995 can be hacked and unlocked by cloning the vehicle’s keyfob via an Arduino and software defined radio (SDR).

The research team, led by [Flavio Garcia], have described two main vulnerabilities: the first requires combining a cyrptographic key from the vehicle with the signal from the owner’s fob to grant access, while the second takes advantage of the virtually ancient HiTag2 security system that was implemented in the 1990s. The former affects up to 100 million vehicles across the Volkswagen line, while the latter will work on models from Citroen, Peugeot, Opel, Nissan, Alfa Romero, Fiat, Mitsubishi and Ford.

Continue reading “Arduino + Software Defined Radio = Millions of Vulnerable Volkswagens”

Laser Sequencer uses Arduino to Enable Super-Microscope!

pcb
[Philip]’s Laser control Arduino shield.

[Philip Nicovich] has been building laser sequencers over at the University of New South Wales. His platform is used to sequence laser excitation on his fluorescence microscopy systems. In [Philip]’s case, these systems are used for super-resolution microscopy, that is breaking the diffraction limit allowing the imaging of structures of only a few nanometers (1 millionth of a millimeter) in size.

Using an Arduino shield he designed in Eagle, [Philip] was able to build the system for less than half the cost of a commercial platform.

The control system is build around the simple Arduino shield shown to the right, which uses simple 74 series logic to send TTL control signals to the laser diodes used in his rig. The Arduino runs code which allows laser firing sequences to be programmed and executed.

[Philip] also provides scripts which show how the Arduino can be interfaced with the open source micro manager control software.

NicoLase1500EnclosureRender

As well as the schematics [Philip] has provided STEP files and drawings for the enclosure and mounts used in the system and a detailed BOM.

More useful than all this perhaps is the comprehensive write-up he provides. This describes the motivation for decisions such as the use of aluminum over steel due to its ability to transfer heat more effectively, and not to use thermal paste due to out-gassing.

While I can almost hear the cries of “not a hack”, the growing use of open source platforms and tool in academia fills us with joy. Thanks for the write-up [Philip] we look forward to hearing more about your laser systems in the future!

Pimoroni Wash Their Hands Of Arduino

One of the big stories of last year was the fracture of the official Arduino supply into two competing organisations at daggers drawn, each headed by a different faction with its origins in the team that gave us the popular single board computers. Since then we’ve had Arduinos from Arduino LLC (the [Massimo] Arduino.cc, arguably the ‘original’, and Arduino trademark holder in the United States) and Arduino SRL (the [Musto] Arduino.org, and owner of the Arduino trademark everywhere except the US) , two websites, two forks of the IDE, and “real” Arduino boards available under a couple of names depending on where in the world you live due to a flurry of legal manoeuvres. Yes. it’s confusing.

Today came news of a supplier throwing its hands up in despair  at the demands imposed on them as part of this debacle. Pimoroni, famous as supplier of Raspberry Pi goodies, has put up a blog post explaining why they will henceforth no longer be selling Arduinos. They took the side of Arduino LLC, and the blog post details their extensive trials and delays in making contact with the company before eventually being told they would have to agree to purchase substantial stocks both Arduino and Genuino branded versions of identical products and agree to sell them through separate supply channels for both Europe and the rest of the world before they could proceed. This is not a practical proposition for a small company, and the Pimoroni people deliver a very pithy explanation of exactly why towards the bottom of their post.

We’ve covered the Arduino versus Arduino debacle extensively in the past, this is simply the latest in a long line of stories. Pimoroni have hit the nail on the head when they make the point that the customers and suppliers really don’t care about spats between the various inheritors of the Arduino legacy, they just want an Arduino. And with so many other Arduino-compatible boards available they don’t have to look very hard to find one if the right shade of blue solder-resist or the shape of the map of Italy on the back isn’t a special concern. Can we be the only ones wishing something like this might knock a bit of sense into the various parties?

Arduino Replaces Bad AC Thermostat, Hacker Stays Cool

Most of North America has been locked in a record-setting heat wave for the last two weeks, and cheap window AC units are flying out of the local big-box stores. Not all of these discount units undergo rigorous QC before sailing across the Pacific, though, and a few wonky thermostats are sure to get through. But with a little sweat-equity you can fix it with this Arduino thermostat and temperature display.

We’ll stipulate that an Arduino may be overkill for this application and that microcontrollers don’t belong in every project. But if it’s what you’ve got on hand, and you’re sick of waking up in a pool of sweat, then it’s a perfectly acceptable solution. It looks like [Engineering Nonsense] got lucky and had a unit with a low-current power switch, allowing him to use a small relay to control the AC. The control algorithm is simple enough – accept a setpoint from an encoder, read the temperature sensor, and turn the AC on or off accordingly. Setpoint and current temperature are displayed on an OLED screen. One improvement we’d suggest is adding a three-minute delay between power cycles like the faceplate of the AC states.

This project bears some resemblance to this Arduino-controlled AC, but it seems more hackish to us. And that’s a good thing – hackers have to keep cool somehow.

Continue reading “Arduino Replaces Bad AC Thermostat, Hacker Stays Cool”