Archive for the ‘Periphery’ Category.

Affordable pH meter

Our home vineyard delivers about 1000 liters of wine every year. It takes some effort to keep good quality and pleasure for all friends tasting the must, new wine and “senior” wine reserves. One of the most important tasks in wine quality management is controlling the biological and chemical state of the wine. The wine can be monitored in special laboratory or in home lab. Of course home lab become rational when quantity of the wine is high enough to justify expenses in special equipment.  There is some low cost equipment available for wine analysis, mostly with titration techniques, but chemical lab equipment is rather expensive and many hobby wineries avoid buying such equipment. I hope this post can contribute a bit to change that. I will describe the development of simple pH meter in detail.

IMG_6366.jpg    IMG_0855.jpg

Continue reading ‘Affordable pH meter’ »

Protected: RotoLED

This content is password protected. To view it please enter your password below:

USB/RS485 converter on a double sided PCB

USB/RS485 module on a single sided board worked successfully for several months. The code is now stable and I decided to order small batch of double sided PCBs for this project. Here is documentation:

RS485/USB interface on a double sided board

RS485/USB interface on a double sided board

Continue reading ‘USB/RS485 converter on a double sided PCB’ »

LED shades

Light Emitting Dance shades – general purpose party accessory.

LED Shades v0.3

LED Shades v0.3

About this project

I believe many young adults like to party and with the rapidly growing EDM community a lot of people attend parties with electronic music. I am one of them and you can probably tell where I got the idea to make the LED shades. Projects like this one don’t just keep me occupied in my free time but are also designed to broaden my knowledge in electronics and programming. Continue reading ‘LED shades’ »

UV index sensor with RS485 interface

This is another sensor in weather-sensor series. It is based on silabs Si1133.

Schematic:

uvindexsch

Si1133 Sensor schematic with RS485 interface

Continue reading ‘UV index sensor with RS485 interface’ »

Source code generator for Command Line Interpreter (CLI)

Microcontroller with serial bus or USB CDC (virtual COM port) is usually connected to some terminal. User then type commands and firmware in the microcontroller interprets entered commands.

Developing simple interpreter is not very scientific task, more like PITA with repeating chunks of the code. After couple of successful projects with such interpreter I can say my code is somehow tested and proven in the practice. Now I prepared one application which can shorten development process and make my life easier when I start application in new device.

The source code generator generates only command line interpreter. It provides all identifiers for selected commands, provides function prototypes for each command and text template for help. Finally only the functions for executing specific commands should be then implemented.

The final application can be either multi-threaded with RTOS, or flat single thread. In both cases, there should be some function or ISR checking for new char and feeding this char to the command line editor. When new line “arrives”, the function cmd_proc() is called and then the magic happens.

cli1

General structure of the caller thread or application

Continue reading ‘Source code generator for Command Line Interpreter (CLI)’ »

Pressure, temperature and humidity sensor based on MS5637 HDC1080

This is anothe small module to measure air pressure, temperature and humidity. Two sensors are on-board: MS5637 and HDC1080. Microcontroller is small cortex M0 in TSSOP-20 housing from STM: STM32F070CxP. The SN65HVD72DGKR provides RS485 interface functionality with half duplex mode. Voltage regulator, reverse polarity protection and some LED indicators are provided on-board. Complete module is 10x55mm, produced on single-sided PCB, easily producible in every home lab with proto-PCB capability.

RH, T and air pressure sensor with RS485

RH, T and air pressure sensor with RS485

Continue reading ‘Pressure, temperature and humidity sensor based on MS5637 HDC1080’ »

Keyboard for a CNC – recycling a programmable keyboard

Final look

Final look

This keyboard is more than 10 years old. I got it for free but it had its problems. First one was a PS/2 interface. Not ideal for a keyboard used in 2016. Second problem was software for programming this keyboard. It came on not one, but two diskettes with DOS and Windows versions of the software.

That’s where I decided to take it apart and replace electronics inside. New controller is based on KeyWarrior IC which is capable of scanning 16×8 matrix.

This keyboard merges a standard keyboard with a jog controller for a CNC machine. Upper half are “normal” keys and bottom half is for controlling my CNC machine. The shortcut keys will save me a lot of time and trouble when working with the machine.

Continue reading ‘Keyboard for a CNC – recycling a programmable keyboard’ »

HDLC-Like data link via RS485

Communication between microcontrollers is always interesting topic. I was looking for simple, efficient and reliable protocol between several microcontrollers. First I have to choose the physical layer. One of the most commonly used multipoint buses is RS485. Due to simplicity I choose half-duplex RS485. Only two wires is all it needs to establish link between two devices:

rs485

Continue reading ‘HDLC-Like data link via RS485’ »

USB to RS485

Testing of sensors with RS485 using PC without proper interface is not possible. Since RS232 interfaces are very rare, the interface should be hooked to USB. The interface between USB and RS485 can be soldered with one of the many FTDI interfaces with added RS485 driver, or bought as assembled module. There is always the third option. I made it from scratch.

I took smallest STM32F0 with USB and UART interface. The best thing with UART in the STM32F0 is that signal for driver enable is provided within hardware. The complete pinout of the microcontroller is:

pinout

Continue reading ‘USB to RS485’ »