Why Ada Is The Language You Want To Be Programming Your Systems With

The Ada programming language was born in the mid-1970s, when the US Department of Defense (DoD) and the UK’s Ministry Of Defence sought to replace the hundreds of specialized programming languages used for the embedded computer systems that increasingly made up essential parts of military projects.  Instead, Ada was designed to be be a single language, capable of running on all of those embedded systems, that offered the same or better level of performance and reliability.

With the 1995 revision, the language also targeted general purpose systems  and added support for object-oriented programming (OOP) while not losing sight of the core values of reliability, maintainability and efficiency. Today, software written in Ada forms the backbone of not only military hardware, but also commercial projects like avionics and air-traffic control systems. Ada code controls rockets like the Ariane 4 and 5, many satellites, and countless other systems where small glitches can have major consequences.

Ada might also be the right choice for your next embedded project. Continue reading “Why Ada Is The Language You Want To Be Programming Your Systems With”

Sensor Filters For Coders

Anybody interested in building their own robot, sending spacecraft to the moon, or launching inter-continental ballistic missiles should have at least some basic filter options in their toolkit, otherwise the robot will likely wobble about erratically and the missile will miss it’s target.

What is a filter anyway? In practical terms, the filter should smooth out erratic sensor data with as little time lag, or ‘error lag’ as possible. In the case of the missile, it could travel nice and smoothly through the air, but miss it’s target because the positional data is getting processed ‘too late’. The simplest filter, that many of us will have already used, is to pause our code, take about 10 quick readings from our sensor and then calculate the mean by dividing by 10. Incredibly simple and effective as long as our machine or process is not time sensitive – perfect for a weather station temperature sensor, although wind direction is slightly more complicated. A wind vane is actually an example of a good sensor giving ‘noisy’ readings: not that the sensor itself is noisy, but that wind is inherently gusty and is constantly changing direction.

It’s a really good idea to try and model our data on some kind of computer running software that will print out graphs – I chose the Raspberry Pi and installed Jupyter Notebook running Python 3.

The photo on the left shows my test rig. There’s a PT100 probe with it’s MAX31865 break-out board, a Dallas DS18B20 and a DHT22. The shield on the Pi is a GPS shield which is currently not used. If you don’t want the hassle of setting up these probes there’s a Jupyter Notebook file that can also use the internal temp sensor in the Raspberry Pi. It’s incredibly quick and easy to get up and running.

It’s quite interesting to see the performance of the different sensors, but I quickly ended up completely mangling the data from the DS18B20 by artificially adding randomly generated noise and some very nasty data spikes to really punish the filters as much as possible. Getting the temperature data to change rapidly was effected by putting a small piece of frozen Bockwurst on top of the DS18B20 and then removing it again.

Continue reading “Sensor Filters For Coders”

Linux Fu: It’s A Trap!

It is easy to think that a Linux shell like Bash is just a way to enter commands at a terminal. But, in fact, it is also a powerful programming language as we’ve seen from projects ranging from web servers to simple utilities to make dangerous commands safer. Like most programming languages, though, there are multiple layers of complexity. You can spend a little time and get by or you can invest more time and learn about the language and, hopefully, write more robust programs.

Continue reading “Linux Fu: It’s A Trap!”

Airport Runways And Hashtags — How To Become A Social Engineer

Of the $11.7 million companies lose to cyber attacks each year, an estimated 90% begin with a phone call or a chat with support, showing that the human factor is clearly an important facet of security and that security training is seriously lacking in most companies. Between open-source intelligence (OSINT) — the data the leaks out to public sources just waiting to be collected — and social engineering — manipulating people into telling you what you want to know — there’s much about information security that nothing to do with a strong login credentials or VPNs.

There’s great training available if you know where to look. The first time I heard about WISP (Women in Security and Privacy) was last June on Twitter when they announced their first-ever DEFCON Scholarship. As one of 57 lucky participants, I had the chance to attend my first DEFCON and Black Hat, and learn about their organization.

Apart from awarding scholarships to security conferences, WISP also runs regional workshops in lockpicking, security research, cryptography, and other security-related topics. They recently hosted an OSINT and Social Engineering talk in San Francisco, where Rachel Tobac (three-time DEFCON Social Engineering CTF winner and WISP Board Member) spoke about Robert Cialdini’s principles of persuasion and their relevance in social engineering.

Cialdini is a psychologist known for his writings on how persuasion works — one of the core skills of social engineering. It is important to note that while Cialdini’s principles are being applied in the context of social engineering, they are also useful for other means of persuasion, such as bartering for a better price at an open market or convincing a child to finish their vegetables. It is recommended that they are used for legal purposes and that they result in positive consequences for targets. Let’s work through the major points from Tobac’s talk and see if we can learn a little bit about this craft.

Continue reading “Airport Runways And Hashtags — How To Become A Social Engineer”

Circuit VR: Advanced Falstad Logic With Geniac

I find that if I’m trying to make a point with a student or a colleague about a circuit, sometimes the Falstad online simulator is worth a few thousand words. You can draw the circuit, play with the values, and even see the current flow in an intuitive way as well as make traditional measurements. The simulator not only handles analog but also digital circuits. At first glance, though, the digital functions appear limited, but if you dig deeper, there is a custom logic block that can really help. I dug into this — and into how switches work in the simulator — the other day in response to a Hackaday post. If you use Falstad, read on!

Continue reading “Circuit VR: Advanced Falstad Logic With Geniac”

Cheap Electric Scooter Gets A Big Brake Upgrade; Unlocks Proper Drift Mode

The last few years have seen a huge rise in the prominence of electric scooters. Brushless motors, lithium batteries, and scooter sharing companies have brought them to the mainstream. However, electric scooters of a variety of designs have been around for a long time, spawning a dedicated subculture of hackers intent on getting the best out of them.

One such hacker is yours truly, having started by modifying basic kick scooters with a variety of propulsion systems way back in 2009. After growing frustrated with the limitations of creating high-speed rotating assemblies without machine tools, I turned my eye to what was commercially available. With my first engineering paycheck under my belt, I bought myself a Razor E300, and was promptly disappointed by the performance. Naturally, hacking ensued as the lead-acid batteries were jettisoned for lithium replacements.

Over the years, batteries, controllers and even the big old heavy brushed motor were replaced. The basic mechanical layout was sound, making it easy to make changes with simple hand tools. As acceleration became violent and top speeds inched closer to 40 km/h, I began to grow increasingly frustrated with the scooter’s one glaring major flaw. It was time to fix the brakes.

Continue reading “Cheap Electric Scooter Gets A Big Brake Upgrade; Unlocks Proper Drift Mode”

Blacksmithing For The Uninitiated: Curves And Rings

You know the funny looking side of the anvil? That’s where the best curves come from. It’s called the anvil horn and is the blacksmith’s friend when bending steel and shaping it into curves.

The principle of bending a piece of steel stock is very easy to understand. Heat it up to temperature, and hammer it over a curved profile to the intended shape. A gentler touch is required than when you are shaping metal. That’s because the intent is to bend the metal rather than deform. Let’s take a look!

Continue reading “Blacksmithing For The Uninitiated: Curves And Rings”