Archiv štítku: golang

Building P.K.E. Meter

 

I am at the beginning of my next home project. This time I am going to build a P.K.E. Meter. Why? Honzík, my son, would like to have one. When we were on our vacation, Honzík met some other boys staying in our hotel and they started playing many games in the hotel’s gym.

One of them was kind of “finding ghosts in the hotel”. They used mobile phones with a fake ghost detector application. But a real ghost detector would be much better than just an app and enable them to have much more fun.

I immediately came up with a ground breaking idea and started designing a possible solution. My inspiration was mainly the P.K.E. Meter from the Ghost Busters movie. At that time I had no idea that it is called by this name. But just for sure, it is this device from the movie:

 

PKE Meter Detail

 

It is a dream device for DIY project: moving parts, marching LEDs, simple display. All of this can be simply built by a 3D printer and made alive using a small processor board like micro:bit. But this time I decided to use something a little bit more powerful. Raspberry Pi Pico. Mainly because I wanted to use Golang for all the development. And micro:bit could be a bit tighter in terms of available resources.

Tinygo is almost standard Go. All the main features are there – go routines, channels, most of the standard libraries work. And there is a new package “machine”. It gives you access to most of the HW features of Raspberry Pi Pico. And there is also a new library of drivers which support most of the hardware elements you would like to connect to the Pico.

There is special golang compiler for small and embedded devices called tinygo. It is incredible in the compiled code size optimalization. If you compile Hello World sample using full-grown golang compiler, it will have probably 1MB. If you completely the same using tinygo the size will be 28 KB!

I have decided for this platform – golang and the microcontroller. Now I need to connect all the peripheries. And there will be many of them. I need a display. I need marching LEDs on the arms. I need to detect motion in front of the P.K.E. Meter and it could be covered by an ultrasound range meter. I would like to detect motion of the device by an accelerometer. And a buzzer to scare users by doing very creepy beep-beep-beeeeeep!

 

PKE Meter components

 

I set a target for myself – every day I will test one periphery and learn how to communicate with it. Today I am able to control the display, LEDs, servo and beeper. The accelerometer and range meter are in my pipeline.

I will also need a box – cover – for my PKE Meter. I started drawing the hardware part of the device. How else than in the most typical way – by drawing it on the “Back side of the napkin” (I like the book with this name).

 

PKEmeterHW

 

Later I will re-draw that using Autodesk Fusion CAD and I will print a cover. My feeling is that the cover could be a bit complex. Probably I will print it per-partes and glue it together and after having a working prototype I will unite all the parts together and print the final version.

That’s the plan…