Arduino Shield for Battery Operated Sprinkler

This is a very different project that aims at creating an Arduino based shield for battery-operated sprinkler. Although the work on creating an Arduino based controller for the sprinkler is in development stage, this one is ready to buy shield. The shield is designed to work with battery-operated sprinkler waves. The valves inside utilize a latching solenoid, which just draws power when you open or close the valve, and does not draw power in the event that it stays in the same state. Therefore, they are very efficient and are ideal for battery operated controllers.

Moreover, the shield can also be stacked with other shield such as WiFi to provide web control. There’s an on-boost converter which helps in generating high voltage require to open or close the valve. An H-Bridge has also been made by using 4 MOSFET switches to generate voltage in both polarities (Ex: -9V and 9V). Overall an exciting application of both analog as well as digital electronics. If you are interested in the shield you can buy it or even make it yourself with the help of manual available on the project website.

Read

Raspberry Pi GPIO benchmark update

Couple years ago Joonas from Code and Life have made pretty extensive Raspberry Pi GPIO speed benchmark. But things have changed over two years. Specifically speaking hardware of first generation Raspberry Pi remained same, but firmware and software libraries overcome series of upgrades. It became interesting how GPIO speed have changed since last check.

raspberry_pi_benchmarking

He tested several libraries and languages. To test GPIO performance a simple pin toggle endless loop were run. Results were quite different comparing to tests done couple years ago. Lets see few of them. First of all he tested Shell based scripts. This method gave 2.9kHz square wave. When using WiringPi library toggling speed dropped down to 40Hz. So it seems that shell scripting is suitable for slow signaling. Python with Rpi.GPIO showed pretty good improvement. From earlier 0.3.0 version 44kHz in version 0.5.10 it jumped to 70kHz. This is great speed for most interfacing tasks. Also python is versatile scripting language to use. Python with Wiring Pi didn’t perform as good – 28kHz, but still pretty useable. Best performance is visible when using C native library – 22MHz. BCM2835 based C library reaches 5.4MHz which didn’t change much. C with Wiring Pi generated 4.1MHz square wave. Other more exotic methods like Ruby and Perl results are very similar to Python. So there are few improvements and few speed loses. But in average it didn’t change much. This comparison of methods give pretty good clue what to expect when using one or another method. Use C when you need fast signaling, but for control and driving applications Python and even shell works fine. Another important thing to remember, that these benchmarks are performed on a blank Raspberry Pi which doesn’t perform other intense tasks. In this case you should expect different results. Always be sure to test you applications in real conditions before use.

Read

Minimalistic STM32F042 scope

In many cases oscilloscope is used to test low voltage and low frequency signals. This is what any low end oscilloscope is capable of. I think that proper oscilloscope should be on every hobbyists bench. But still there might be various reasons not to have. As quick fix to this problem might be a DIY solution. Tomeko have build really minimalistic scope project on STM32F042 ARM Cortex microcontroller. It accepts single channel, single voltage range signals and streams it to PC via USB FS with libusb as driver.

STM32_miniscope

Scope’s sampling frequency is 480kSps at 8-bit resolution. Signal is captured in real time Windows application which can record signal to file up to 512M samples. This is enough for simple measurements and monitoring. The great thing about this is that circuit is really minimalistic with only few passive components on it. Because of this simplicity, it will never replace any oscilloscope, but it could find its use simple signal debugging is required. In other hand it can serve as additional module in some project where you might want to have a clue about signals inside. If you build it with home technologies it becomes really cheap.

Read

Quick frequency counter with Arduino

Frequency is very important parameter of any signal. No matter if you are generating or synthesizing signals, you most likely need to measure its frequency. When signal frequency is bellow 40kHz and amplitude is near 5V then you can build frequency counter on Arduino with standard LCD screen. If measure signal is 5V (or 3.3V) level then you can feed it directly in to Arduino input. In other cases you need to use limiting circuit like amplifier or voltage divider. But this small project assumes that voltage is fed directly to microcontroller input.

frequency-meter-using-arduino

In this example signal comes to digital pin 12 where function pulseIn() counts number of pulses during specified time. Program itself is only few lines of code, and hardware is straight forward so putting it to work condition is only a matter of minutes.

Read