Author Archives: pierremuth

The quest of a beacon for cats (part 1)

IMG_6409Mio is a tiny female cat, with a rather independent and proud way of life. She spends quite a lot of time outside doing… well… important cat stuff, among proving her duchess status to the other neighbor cats. However, she never misses us, each evening after work, when we come back home. She can enter the warm house in order to get the well deserved food and attention.

Until one day. And the day after.

It affected me far more than I could expect, but fortunately the worst things I started to imagine were false. Mio came back home. We conclude she might be being locked by mistake in a barn from the neighborhood. That’s where started the idea of a small RF beacon for Mio. It should to be very small, at least a month of battery life, and can enable a kind of search with a receiver.

What exists

I usually enjoy to think about and make solutions by myself, but what exists yet on the market ?

cat_PawTracker

thepawtracker.com

There are some expensive modules that combine GPS and GSM. Usually they come with a subscription (monthly fees) and you get the beacon location from a website. The few days of battery life is problematic, and they cannot be realistically attached to a small cat due to their size.

Some bluetooth tag seems to have some success. They are small and have a long battery life. These tags have however only a 10th of meter range, and some relies on the proximity of a smartphone, with the special app’ installed and running…

balise500pxFinally, over internet I found a very interesting article of someone having the same concern. (https://www.f1nqp.fr/articles.php?lng=fr&pg=144&tconfig=0 in french). I’m less confident with analog RF electronics. In addition, the size of the antenna wire is not very confortable. However this solution should be kept.

Exploring RF modules

I discarded the modules working at wifi frequencies (2.4GHz) for two reason. Maybe I should come back here later, but with a coin-cell battery budget, these frequencies are absorbed easily by walls.

IMG_6406

I made some tests with three different RF modules. From left to right:

1 – A basic 315Mhz transmitter

These modules seems to meet the low power requirements. I can even use a TV usb dongle as SDR to receive and find the beacon. The difficulty comes from the antenna. A 1/4 wave antenna for 315MHz is 23cm long. If I spool the wire inside a small case, it makes a coil and degrades dramatically the antenna impedance/efficiency. So the range goes down to something like 10 meters.

2 – Lora module based on SX1278 at 433MHz

These LoRa modules are amazing. They have a really huge range, more than 500 meters. But the problem is still the antenna at 433Mhz. If I use a simple wire, wrapped in the case, I must increase the output power to the maximum (~+17dBm). Then the battery dies after a day. Mainly because the peak current is up to 100mA, thus not suitable with coin-cells.

3 – ST electronics module base on SPIRIT1 at 868Mhz

The ST SPSGRF module integrates the antenna, in a very small board. The power consumption is very interesting as well, so let’s go a bit further with them.

For each module, made a draft case. I choose a small PIC12F1822 in SOIC package to drive them.

IMG_6407

ST SPIRIT1 tests

The PIC code basically setup the module and send a message every minute. Fortunately, in addition of the numerous application notes, ST provides a little application (STSW-CONNECT9) to generate dthe setup C code of the Spirit1. It is very convenient as the registers are quite numerous. The message sent is just composed of the battery voltage and the battery voltage drop during the RF broadcast.

The 3D drawing is done with Fusion360. To make the case waterproof, I used neoprene glue on the outside join between the cap and the body. With the screwdriver tool that fits the pattern on the cap, there is enough torque to tear the glue appart to unscrew it. I had to pay attention to not cover the antenna with the coin-cell battery. Event shifted like that, I’m sure it reduces the transmission efficiency.

 

 

Receiver and integration

On the receiver side, one interesting feature of the Spirit1 is the RSSI value – in received signal strength. It not gives an absolute distance between the two modules, as it is greatly dependent of the obstacles, but it rather gives an idea.

IMG_6413I used the ESP32 on this side for two reasons. First because there are nice libraries for the RF module and different screens, and because I would like the wifi connectivity. With wifi, I can connect it to my logging station and observe the evolution of the signals. I had a PCD8544 LCD, pretty much enough to display few values and a small history chart. The screen on the receiver let me take it outside and try to locate the signal. It displays RSSI, voltages, and a countdown in order to knows roughly when the beacon will emit.

The PIC code, the ESP32 codes and 3D models are on this github repository: https://github.com/pierre-muth/RF-cat-beacon

 

From the tests I made, the range is around 100 meters. I had the receiver outside in the village, while the cat is (sleeping) in the house (which has half a meter thick walls).

I have now additional logged data channels, I can observe the trends of RSSI and battery voltage on logging station.

 

Conclusion for now

I need to wait more to conclude on the battery lifetime. Over the last 10 days, the voltage seems constant at 3V. I could increase the transmission rate if possible.

I’m not sure about the reception range, is it enough to locate the beacon by walking around in the village? That’s why I should continue to study the other solutions. For example, I just saw it exists 433MHz ceramic antenna as well. Maybe it enables the use of the LoRa module at low power. They are still interesting as their modulation scheme makes the reception very sensitive.

Thanks for reading and take care of your cat.

Advertisements

Destination moon

Recently inspired by some 3D printed rockets lamp, I thought maybe it’s a good occasion to start the exercice myself from scratch.

As a child, reading the Tintin ‘Destination moon‘ adventures really expand my dreams and I still enjoy reading this comic. The iconic red and white rocket has not too complicated shapes, but still interesting. Of course the rocket it is yet modeled, and plenty of 3D files can be found over internet. However the most accurate in my opinion is the work of Gregory V.

So I started Fusion360 with some contraints in mind.

  • As accurate as possible shape from the comic
  • A size up to 50 cm tall
  • Assembling without extra parts

I used the same solution as Gregory for the alternating red and white parts, but the structure rods are printed with the two central pars.

And the assembly looks like the following :

assembly

Lets start the lovely Prusa i3 and be patient. The rocket is printed in three times. For a total of approximately 45 hours and 480 grams of PLA.

To generate a dynamic plume of smoke effect, this time I used 3D Studio Max and its ‘meta-particle’ system :

tintin3DS

Few white LEDs connected to the USB port of the computer gives a result which I’m quite satisfied!

IMG_6053

 

Glow Discharge Numeric Indicator Adventures

IMG_6028

Even if it has been done to death, well, I’m not different from people who succumb to the nixie charms. I have liked the effect of this glowing neon once I saw it for the first time on an old HP instrument. There is nothing unusual in the story I will tell, many had already and many will have this adventure. Here is my personal experience leading to this tiny nixie clock. Yes. Yet another clock.

Quick background links

us2142106_boswau

This technology used to display numbers can be fascinating. Especially if we replace the story at a time when it was not trivial for an electronic device to display digits. At least not as easy as it is now on displays such as the one you are reading this.

And this (hi)story is very well detailed here. Of course, Wikipedia has a nice article as well.

Part 1: Playing and prototyping with high voltage

What appeared challenging to me was first to tie from 170V to ground the cathode of the digit to glow. But of course, this problem was solved when nixies were used. To practice, I got nice little tubes, the IN-17. They are sufficiently common to still be affordable. Switching the high voltage of the 10 different cathodes can be done with old chips such as the K155ID1. It’s an easy to use chip in my opinion. Just a BCD decoder with high voltage capability. Still it consumes a lot, but they are a bit more practical than transistor and multiplexing. However, I still need one chip per tube, each of them has 4 logic input. I then used addressable latch chip that were lying there, three 74LS259, to control everything with 5 micro-controller output.

For the rest of the design, I switched to more modern electronic components. I used a PIC16F micro-controller to drive the latches and decode the time from a dedicated DS1307 RTC chip. Two buttons to increment the hours and minutes and we’re almost done. Not without some wire-mess of course.

What remains is the high voltage power supply. I used a 12V to 170V module in the IGG1-64×64 display, but this time I would prefer to have it from the 5V of an USB charger. There is plenty of 5V ‘nixie power-supply’ over eBay, but Mark Smith from https://surfncircuits.com/ did really a nice job to optimize his design and make it open. So, I reuse his work and ordered directly his board from Oshpark.

IMG_5965

Even if it’s an exercise, the result deserves a case. I played a bit with Fusion360 and try to make something a bit retro. As the numbers within the tubes are quite deep compare to their size, the vision angles are a bit limited. That’s the reason why the front panel can be adjusted. The small neon bulbs used as separators don’t glow exactly with the same color of the nixies, fortunately an orange filter equalizes the tones. The case is printed with PLA.

Part 2: A purpose for tiny tubes

IMG_5910

What you see in the picture on the left is a board found in a trash container. No case where there, but I noticed some tubes. Unfortunately one of the 8 was broken, but it means 7 were spared. Looking closer, I found the keyboard aside, and on the board, the brand “Walther” was engraved. It was a calculator (Walther-ETR2), and the display is made of small nixie tubes. I tried several time to bring it back to life, without success. And same story to find a replacement tube.

These tubes are NEC LD-8007, and seems to be part of the smallest ones. Maybe it explains their rarity and the fact I didn’t success to find a replacement one. So I thought I cannot let them lying and taking the dust (as so many stuff in what I cannot call an office anymore, let’s call this room the lab’). I had several ideas to use them, but I stick to simple and start a new clock.

In order to make something decent and correctly scaled with the tube size, I would like to make something small. I should look for more modern solutions.

Modern chips

Besides being small, there are few features I’d like to achieve. First is reusing the Mark’s efficient USB to 170V power-supply design. Then it would be nice to have wifi connectivity, allowing setup without button through a web page and automatically get the time with NTP.

esp32wroom

I discovered the ESP32 module and finally decide to have a look on the Arduino platform. I tried different editor/IDE, to finally start to make something useful with VScode plus the platformIO plug-in.

The Microchip high-voltage chips, even if it’s oversize for this application, simplifies and reduce the component number. Actually, these chips would allow multiple digit to be lighten at the same time. Not very useful for a clock and it would require a resistor for each of the different digit of the tubes (the 60 cathodes in total), instead of one resistor per anodes (6). As many people already did, I used two HV5522, they are 32 bit shift register with high voltage open drain output. The counterpart of these chips is they need 12V for the power and logic signals.

Schematics, PCB, soldering

To summarize, the main components needed are:

  • The ESP32 module and its 3.3V regulator
  • The high voltage shift registers and their 12V step-up power supply
  • The nixie tubes and their 170V power supply
  • 4 logic level adaptations, USB connector, etc…

I’m more and more efficient now with Kicad, too bad I had just finished when Kicad5 was released. You can find the schematics bellow.

boards

For the PCBs I made a stack of two boards. I could then limit the final size of the clock. The width is mainly determined by the ESP32 module, and the length is set to have roughly the same spacing around the tubes. To limit the height, I’ve placed the tallest component, which is the 33uH coil from the 170V power-supply, in a hole through the board.

For aesthetic reason I made a third board that will come on the top of the two others, to cover the soldering and high voltage conductors. As usual I used OSHPark for the PCBs, they have high quality standards. Here is the instant rendering right after uploading the kicak pcb files:

And the actual boards:

IMG_5971

We can discuss this choice, but I solder the tube pins on the surface, and not through-hole or with sockets. The main reason is space gain. To do so, I had to bend the 12 wires of each tubes in an homogeneous way. I made a simple tool to hold all the tube roughly in the same way:

IMG_5909

I’m still after all these years enjoying soldering components 😉

IMG_5972

IMG_5997

On the first try with all the tubes, the 170 voltage dropped quite low, enough to make the numbers barely glowing. After some debug, it seems that putting the components on both sides adds some parasites/cross-talk on the current limit line of the UCC3803 chip. Fortunately decoupling capacitor seems to solve the problem. I’m still not 100% sure of the issue, but now the voltage stays around 160V.

IMG_5999

IMG_6000

A small touch of 3D printing

Everything could be left naked, or hidden in a case. Again I played with Fusion360 and I tried to find an elegant way to enclose these 3 boards. I ended up with three parts that are fixed in a sandwich way with the PCB, everything fixed by the 4 tiny M2 screws. It should only add 2mm around the clock, with the same height.

IMG_5970

IMG_6012

IMG_6028

Scales in perspective

I have the privilege to have a Zen clock made by Dalibor Farny, and from the beginning, I cannot deny the inspiration:

IMG_6011

For the scale, the coins are respectively one swiss-franc, one euro, 10 penny, and quarter dollar.

IMG_6006

ИГГ1-64/64M Adventure

IMG_5436

It appends I spend a bit of time on eBay looking for uncommon or old displays such as the famous Nixie tubes. Large matrix displays emerge some time ago maybe due to the discover of an old stock. However, I never found someone using them, for a good reason. Around 360 Volts is needed to light up a pixel.

Gazotron

gazotronGazotron, or Газотрон is (or was) an Ukrainian electronic tube manufacturer (do not confuse with Gas-o-tron). It’s not easy to find information about this company, even gazotron.com is closed. But actually there is still plenty of their products available if you would like to buy electronic tubes, such as IN4-nixie tubes. The logo is dot inside a circle.

81491517582909158

They made in the 90’s different sort of dot matrix panels. They are quite large, 19x19cm, and for the moment I saw 3 kind of pixel composition. A 32×32 matrix, all pixels are green. A 64×64 matrix, pixels alternating green and red, and finally a 64×64 matrix with red-green-blue alternating pixels.

I bought one green-red some time ago, and recently saw a page on hackaday.io that revive my interest.

Seek for information

The short datasheet provided with the screens (shown in the mentioned page) explains the voltage values needed to light up the pixels as well as the timings, but it does not help to find a way to generate these high voltage signals.

My research on internet first leads me to this Youtube video demonstrating a 8×8 pixel drive, and a quick view of the breadboard circuit. Then I start to find forums written in Russian where someone manage to drive the all 32×32 matrix.

And finally, a piece of a datasheet showing a circuit example able to generate the ~400 Volts anode signal from a 200 Volts source.

35281517586682013

Test Drive

I reproduced the circuit on a breadboard as well, using a 180V ‘nixie’ power supply.

IMG_5318

Motivated by this success, I started Kicad and designed a PCB. I Selected SMT components in order to reduce the size of the 64 anode drivers and the 64 cathode drivers. The board arrived as perfect as usual with OSHPark.

IMG_5366

And they are working!

IMG_5365

 

Cabling and soldering

There is 92 components and 34 wires on each of the 8 boards to solder. As I don’t own a air soldering station, I did everything with a good iron and solid patience.

But it was worth the effort, they all work great.

Interface

I used the same micro-controller as the BIG_CLOCK to talk with the high voltage boards. Especially because it has at least the 32 outputs needed. To interface this controller with the outside world and being able to display some useful pictures, I used the serial port.

I could then make a tiny Java program that copy part of the computer screen and send it to the serial port.

IMG_5436

Fun with Pixel Dust

I was quite amazed by the code demonstrated on a 64×64 led matrix by Adafruit (https://www.adafruit.com/product/3649). So why not trying this on the IGG1 display?

I have a MPU-9250 IMU and a raspberry-pi zero. However I need to adapt the code for this accelerometer, and send the data to the screen with the serial port. I’m more comfortable with Java than C or python, then I translate the code from Adafruit in Java.

To conclude

The full story and details are on the hackaday.io page here:

https://hackaday.io/project/46302-1-64x64m-adventure

Sources and schematics are on the following github repository:

https://github.com/pierre-muth/IGG_-64x64M

It was really a good time see this screen getting back to life, now it needs a purpose such as a weather forecast display or a nice clock. A lot is possible with the raspberry pi, including the use of the PIR sensor to only turn on the screen when someone is around…

Anti-Proton Decelerator quick tour

6457231520434234407

IMG_5399I recently wrote a project page about re-purposing a flip-dot bus display for the Anti-proton Decelerator control-room. It maybe interesting to show you with pictures how this synchrotron looks like.

The Anti-proton Decelerator (AD) is a 182 meter long synchrotron. Its aim is to lower the energy of anti-protons. In contrary of the majority of the existing synchrotrons, the AD is used as a decelerator, producing low energy anti-proton and send them to different experiments. For the details, have a look on the official web page.

The AD stands inside a concrete tunnel build inside a large hall:

IMG_5426

Before accessing the synchrotron ring, we can make a quick stop by the AD control-room (ACR):

IMG_5427

The hall with the concrete shielding is conveniently visible from the ACR:

IMG_5407

Down in the hall, we can find the access system for the machine tunnel:

IMG_5408

This special door will control your personal dosimeter and your identity with an iris scanner:

IMG_5409

Once in the ring tunnel, you’ll meet the AD itself. Here we are facing two of the main dipole magnets (in blue):

IMG_5410

And right after we can see the vacuum pipe going through quadrupole magnets (focusing elements, in red):

IMG_5412

On the next picture you will see on the right where the anti-protons come from. Behind the wall is the target and horn area. On the left starts the injection region where we can see the vacuum pipe literally going through the blue dipole yoke:

IMG_5413

In the next strait section we will meet the electron cooler, one of the rare device able to reduce the size of a charged particles beam:

IMG_5415

Right after, these two big silver colored blocks are radio-frequency (RF) cavities. In general RF cavities are used in synchrotron to change (increase or decrease) the particle beam energy. These two ones are used in the AD to change the shape of the beam:

IMG_5416

Continuing along the ring you’ll meet a lot of magnets to steer and focus the beam:

IMG_5417

The stochastic cooling system is another remarquable element of the AD, it is a beam size reduction system:

IMG_5419

Without entering into the details it consists of beam sensors and fast kicker elements (electro-static). The sensors signal is amplified and transmitted to the kicker elements that are installed at the opposite side of the ring. The transmission is faster than the particles take to make half a turn of the synchrotron.

If we exit the ring tunnel, we can pass by the stochastic cooling amplifiers:

IMG_5422

And the powering system for the injection element, able to deliver a controlled pulse of hundreds of kilo-volts. Most noticeably are the cable coils (Pulse Forming Network):

IMG_5425

I hope you enjoy this little tour, and thank you for reading.

IMG_5421

 

Another Candle

candleV1 v22

Christmas lightnings around houses are not my favorite, however I like the atmosphere of warm little candles put on the bottom borders of the windows . That’s the starting point of a long and lazy digression.

Instead of burning continuously paraffin wax, could we make a reusable electronic one ? Of course, there is tons of cheap products available. But they are somehow not really convincing me. And I’m not the first one to look on that subject.

I’ll try here to summarize what I’ve found and what I’ve enjoyed to do. Sources and drawings can be found in this github repository.

Over internet:

You can spend a lot of time completely lost on internet as I did, by just googling ‘led candle’ or ‘flickering led’ or ‘micro controller candle’ etc…

I’ve found a nice Tim’s blog post about the reverse engineering of a flickering led. It is really worth a read, he details everything from measurements to analysis, and reproduce the algorithm. This is followed by another post which really interested me. How a real candle flame behave.

The real flame:

To summarize, and as probably everyone knows, the candle flame brightness has two types of behavior. Usually it is rather constant, and it happens some time that the brightness starts to oscillate for one or two seconds. One thing I can add to that is the flame is gently moving, from one side to another one.

Another property of the flame is its light spectrum. And here as well, a lot of people studied this. It is a very warm light with plenty of red / infra-red. We can find some measurements from 1000 to 2000K of color temperature.

Start the Project:

We roughly know what to mimic, so let’s choose some components according these constraints.

For the LED, I looked for the warmest white on the range of 10-20 mA. My ‘local’ provider is Farnell, so after some sorting and filtering I end up with a Wurth warm white led, €0.18.

medium-pic10f320-sot-23-6To add a bit of challenge I choose a very small micro-controller, but still accessible with my tools and knowledge. The PIC10F320 has only 6 pins, 64 bytes of RAM and 256 bytes of program memory. But it has 2 PWM output and an ADC, all for €0.42

To power everything from an AA battery I choose to use a step up converter. The €0.38 MCP1624 is able to output 50mA at 3.3V from a single AA battery, and is working down to 0.35V.

From this point we can control and power two led and read an analogue value such as the ambiant luminosity (using a photo-resistor for example). It is possible to mimic the flame swing by balancing the brightness of the two LED, plus the random oscillations with the total brightness. We can switch off the LEDs when the day is too bright as well.

Code contraints and Prototyping:

After some soldering I manage to put the components on a small development boards and start coding.

 

I used the Microchip IDE and their XC8 C compiler. The challenge here is that the compiler is in ‘free’ mode, so the compiled code is rather large. I didn’t want to use assembly mainly because I’m not quite confident to prototype with it. But I admit it is the preferable way to do something with only 256 bytes of program available. It’s perfectly legit to argue that an ATtiny10 would at least do the job better. I should invest time to the AVR side one day !candle_XC8

After many iteration to reduce the program size, I end up with only 4 free bytes. Wow. Some C operations give more compact program for the same function (for example initialisation to 0 or an arbitrary value).

The code uses the famous Linear feedback shift register as random generator. The flame position, the speed to go from one to the other position, the oscillations occurrence and their period number are random. The two LEDs are dimmed with the build in PWM, and the speed of change with the Timer0.

It is still open to more complex code as I can use the PIC10F322 with 512 bytes of program space (or even ATtiny10 which seems to be almost pin compatible).

I acquired the two LEDs PWM signal with my recently acquired DSLogic :

candlePWM

And plot them with a quick and dirty Java program:

candlePWMchart2

You can notice the oscillation mode on the chart after 4th second, and the flame swing mode surrounding it. For the oscillations, the total brightness is changing while otherwise it stays constant at 50% (the sum of the two led brightness).

Getting serious with a PCB:

Let’s startup Kicad, do the schematics and play a bit with the PCB drawing. I have in mind a design for a 3D printed case, we’ll see that later.

 

Several times now I ordered PCB from OSHPark, and never been disappointed. I could use their manufacturing precision to down size the board area up to 17x17mm, giving $2.45 for 3. I let an option for a push button, we never know…

pcb_oshpark

Less serious with the 3D shape:

It is time to think how to hold everything together. I applied for the free student Fusion360 licence. I have to say the program is very nice to handle and to learn.

candleV1 v20

The idea is to hold the battery on the PCB with the three part threads. Just screw them together and it should light-up. The only compromise is the ground wire that goes from the PCB to the bottom part along the battery body.

I also made a join part to be able to have some versions with two AA battery stacked, making it taller and with a longer battery life.

candle_mechanical_draw

Then I removed the dust of my M3D micro printer, far from the best printer nowadays, but the cheapest when it went out.

IMG_5275IMG_5271IMG_5270

Soldering and programming:

And the boards crossed the Atlantic ocean and arrived in the mailbox! It’s always a pleasure to solder components on these high quality boards (even 0805 with a soldering iron).

 

To program the PIC, I forgot to order some 1.27mm spacing pin headers. However, there is a solution with two 2.54mm ones:

IMG_5302

Life-time: 

I don’t own yet a nice multimeter, so the current measurement I did with my actual (too) cheap one is rather approximate. I got around 12mA with the LEDs on, and around 4mA in sleep mode, drawn from the battery. Maybe the current of the sleep mode is still high due to the step-up circuit, which runs all the time…

However it stays on at least 3 consecutive days on a single AA Ni-MH rechargeable battery. I logged the battery voltage of one candle with my raspberry-pi logging station. It start with a fully charge single AA Ni-MH battery and I remove the sleeping mode:

battery2

 

Final result:

IMG_5299

IMG_5306

It is rather hard to catch the effect on a video, as the aim was to create a LED candle as quiet as a real candle could be.

candle

Thanks for reading !

(and my apologies for the approximate language)

PolaPi-Zero

8659491486300188651 The PolaPi camera flew to new adventures quite a long ago. I hope it still works and the new owner is using it time to time. I missed it a bit so it is time to rebuild one. In the meantime other parts got out on the market. Such as a smaller thermal printer and the smaller Raspberry pi Zero.

Here we have a good opportunity to try to slightly simplify the project and add features missing on the previous one.

By simplifying I mean avoid the thermal printer hack of the previous PolaPi, and use Python instead of Java. And by features I mean the possibility of review and re-print pictures. More details can be or will be on this Hackaday.io page.

Is all about monochrome.

The Adafruit nano printer is only capable of printing black dots. So it is for the Sharp Memory LCD. Except the printer’s resolution is slightly higher than the screen, I like the coherence between_mg_5911 what you see and what you get.

Vít Hašek made it’s own PolaPi and push the concept for his thesis. He called it the white box, in opposition of today’s black box devices.

It is mainly the reason why I made the new one white as well.

Under the hood.

The electronic hardware is similar of the previous one, except the screen.shematics01

However I used 3D printed part for the case.

A button is for taking picture and change to ‘live view’ mode. Another to print the picture file or change to ‘review’ mode. Two others to navigate through the image files. And finally a last one to initiate the raspberry pi shutdown

polapizero013

The Python code and the way to get the LCD library compiled is still a bit messy at the time of writing, but I’ve put everything on github. Moreover, you can get the SDcard image on this dropbox.