Flipping Dots Fast.

Some time ago, I repurposed a bus flipdot display. From then I kept an interest on this fascinating mechanical way of displaying information. Some companies such as AlfaZeta or Breakfast continue to produce them. They managed to drive them very fast, making animation possible. Usually, and it was the case for my bus display, all the dots of a matrix are driven sequentially. It is very common that each columns of a dots matrix are flipped one after the other, and for good reasons. Information on these matrices are meant to be rather static, and doing so requires electronics only for each rows and columns, and not every pixel.

If you saw my previous post about the Neon pixels, you probably see some similarly.

Gigantic modern fast flipdot matrices are truly impressive (and very expensive), notably here : https://youtu.be/SJU2-1X8kHQ and here https://youtu.be/VFG1D7lVMiY. There is a nice article on Hackaday. However one can see the driving process.

Some 8×8 squares or larger structures are notably driven separately, giving some artifacts when the animation is fast.

How these matrices are driven ?

There are tiny magnets hidden inside each flat dots. Basically, to flip a dot, you have to flow an electrical current into the coil, generating a magnetic field around it. The direction this current flows will flip the dot from one position to the other. Only a short pulse of current is needed. The electromagnet core stays polarized, keeping the dot on position, even when the power is gone.

Image courtesy eldisrl.com

The common solution to the problem of flowing a current pulse in both directions is using a kind of H-bridge topology. Add two diodes and you can multiplex the dots in a row/column way.

Frederic L made a very extensive explanation of how this works on his hackaday.io project.

And Yann Guidon started as well a Hackday.io project call Dot Flippers, aiming discussions and exchange about using flip dots.

How can we imagine a different way. My aim from here is to drive all the dots of a matrix at once, possibly up to 30 times per second.

Obviously, a driving mechanism should be implemented for each dot. There is some integrated H-bridge chip, but they are quite expensive if you consider one per dot.

After playing a bit with raw flipdots, I observed that a charged capacitor of around 10uF at 16V, discharged directly into the dot’s coil, is enough energy to make the dot flipping correctly. There is something to dig here, so I made a circuit with the coil in series with a capacitor, as shown below. One side is grounded. If you apply a voltage on the other side, the capacitor will charge, with a current flowing through the coil in one direction. If you discharge the capacitor by grounding this same side, the current will flow the other way.

Now how to charge and discharge this circuit? With a CMOS, or complementary Mosfet for example. (Or half H-Bridge…) Lets try to simulate this concept in LTspice:

It seems to work, the green line is the current across the coil. Pulses in both directions are generated, depending on which input is enabled.

A nice feature of this circuit is only the charge will consume energy, the flip back is for free.

We can buy flipdots here on Hannio.org. They come in rows of 7 dots, probably because of 7×5 fonts.

Lets start KiCad and prototype this idea. We need 7 drivers, a microcontroller and a voltage regulator. I Choose a PIC with a handy SPI peripheral, plus two 8bit port. The PIC16F15345.

Using a 4 layer PCB, I manage to fit everything within the flipdot footprint.

I ordered the boards from JLCPCB. As usual, I’m very satisfied. The price for 4 layers boards are very attractive, the quality is very nice, and they are in the mailbox in one week.

Now lets try assemble and make a test program.

The only problem I had is some transient negative pulse appearing when I unplug the main power rail. This kills the cheap 5v regulator I first used. With a free-wheel diode connected on the main 24V power supply (it should be max 20V as pointed in the comment! thanks Ken536) and a more robust voltage regulator (MIC5233-5.0YM5-TR), it seems we can proceed with the assembly!

Meanwhile, few purple boards arrived from OSHpark as well. Quality is top notch as usual, the silkscreen is amazingly precise. However the board sides have to be sanded to remove the supports. Too bad the ‘after dark’ option is not available for 4 layers.

The second Covid-19 lock down, and curfew here in France, gave me some time to solder the 2500 components. I have to admit, having a task where you can focus and with an objective, helped me not going crazy during winter.

Communication is SPI, all modules are daisy chained exactly as the Neon Pixel modules. To test this 14×24 matrix, an ESP32 act as a socket server over WiFi and sends the frames on the matrix SPI input. A Java program captures and generate a video flux on a distant computer.

All the sources and schematics are on the following github repository : https://github.com/pierre-muth/fast-flipdot .

Creative Commons License

Neon Pixels

IMG_7393

INS-1 / ИНC-1

Fortunately, these single dot tubes are still easy to find in large quantity and rather cheap. Made by Gazotron, it seems they buildup a large stock at that time. The INS-1 has the advantage to be small and produce a nice dot due to the lens-style front. Plus its striking voltage is maximum 100V, lower than regular Nixies.

Proto_SCHAt first I imagined 5×7 dot character modules, such as the TIL305, but bigger. While playing and trying to make a tiny and simple 5V to 100V step-up power supply, I realized how simple it can be. Here we just need to reach the striking voltage and only 0.5mA. As there is yet non uniformity in brightness between tubes, no strong voltage accuracy is needed. Without the signal generator, it is a diode and a coil, shorted to ground with a transistor at high frequency.

Then comes the idea to mimic the popular serial cascading LEDs, such as the WS2812 or SK6812, the so called Adafruit ‘NeoPixel’.

Neon Pixel

What I observed when I was empirically select the components is one key parameter to reach 100V is low resistance coil and mosfet. The voltage can be adjusted by choosing the pulse frequency and width.

IMG_20200706_103154

I was happy to see that only few pulses are needed to reach 100V. This enables pwm for bulb brightness control directly by driving the transistor. It is achieved with a pulse frequency of 100KHz and a PWM of 500Hz.

This leads me to the microcontroller choice. The peripherals needed are SPI, PWM, Timer, NCO and logic cell. The cheapest with all these options seems to be the PIC16F15313.

pic16f15313

I first have issues with the SPI daily chain propagation delays. The data takes some time to be clocked out from input to output. If we use the same clock line for all the devices, the data will quickly be out of phase in respect to the clock.

A workaround is to delay the clock as well on each devices, and have in one side a data and clock in signal, and on the other side a data and clock out signal. Fortunately, this PIC has 4 logic cells, so I can use one to delay the clock, like a line buffer. I was lucky that the logic cell delay is almost the same as the SPI logic.

The only problem remaining is the rise and fall edge detection, they are apparently slightly different. It results a kind of clock pulse stretching, a change on the duty-cycle. However I can deal with it. With a clock speed of 480KHz, the 384th device is still receiving a usable clock signal. 

Now that the prototype works, it is time for a PCB. The aim here is of course to have the smallest footprint, while keep connections at the opposite of the bulb.

I ordered the boards from OSHpark and JLCPCB. Both make very nice boards. OSHPark has the gold finish, and JLCPCB has the V-cut option, which is very convenient in my case.

Lets start the long journey of soldering, The 2020 lock down gave me plenty of time to solder the 384 boards, on which there is 11 components.

A matrix

Meanwhile, it is time to think about a usable display. I then made matrix blocks of 8×8 pixels.

And controlled by an ESP32. I got the first encouraging result.

IMG_7304

I start to make a support as well. A simple aluminium plate with two 3D printed legs. I add several slots in order to choose the inclination. 

 

Coding

I’m using an ESP32, with the arduino framework, and the Platform.io IDE. The nice thing is I could extends the AdafruitGFX lib. So all the work of drawing, fonts etc, is yet done.

I added the notions of display size and buffer size. With a bigger buffer size, I can make easy scrolling by changing the coordinate of the view frame.

This Github repository contains the code and the schematics/PCB. 

Coupled with Andy Geppert Core Memory kit:

Conclusion

With around 20mA per pixel, at full brightness, the total of the 384 pixels is almost 8A. Everything is at 5V, so around 40 Watts is needed when all pixels fully on. Everything then is powered by a 10A 5V power supply. 

This is the reason I’m keeping the display open, that way an airflow exists between the pixels and everything is kept below 40°C.

It is not the first matrix made of  neon bulbs, here is a nice modular one made by Robin Sterling. (@RC_sterling) :

And an other one by @cronos_sv spotted by dangerous prototype at Tokyo Maker Faire 2013.

othermatrix02

Recently Manawyrm Made 8×8 chainable matrices, featured in an atricle on hackaday:

 

Creative Commons License

Digital Picture to Analog Darkroom print

IMG_7283

regard_nocturneSince 2008, I am using almost exclusively a digital camera. But I am always missing the black and white darkroom prints.

From time to time, I order paper prints of my pictures using online services. They are very good now, especially for color prints. However, and probably due to my picky nature, I’m not impressed by the prints in black and white. Each time I put side to side a professional print with an old print I did in the dark room, I see a difference in tone. Perhaps it is because of the use of color paper event for black and white prints.

But I’m using my film camera very rarely now, almost all my pictures from the last decade are digital. I know it can sounds heretic for true black and white film lovers, but I always had this in mind – how could we transfert a digital image onto a true analog sensitive black and white paper.

 

Recent developments 

Some resin 3D printers uses a monochrome LCD screen. Monochrome because the UV light is not absorbed by the color filter of the usual color LCD. As there is now a small market for these kind of displays, we can now find rather large panels with high resolution.

IMG_20200402_125708-2

This is a 13″ LCD, monochrome, and 4K resolution. It means 3840 x 2160 pixels – more than 8 Megapixels – and a density of 330 pixel/inch (1 pixel is 76 micron). There is no back-light, and it connects easily to a computer HDMI port through an adaptation board. I bought it from Duobond Displays Shenzhen here.

Usually 300 dpi (dot per inch) is used for prints. It could be more dense of course, but it is what I observe on the photographic prints I get from professionals. (See later for close up pictures).

Make a protective frame

The LCD panel is fragile, better to make a frame to handle it safely.

 

Put back the the darkroom in place

IMG_7281

I removed the dust from the projector, get the 3 chemicals and black and white paper. I spent a bit of time to make the cave lightproof, but after all it is not very complicated.

After the first test, I was happy to see that the LCD is perfectly able to block the light with black pixels and let enough light to pass through with white pixels. Making on the paper respectively white and black pixels.

The LCD is put in contact with the paper, the same way we make contact sheets with films. On the images above are the setup with the projector and the LCD panel, a test mosaic, and the result on the paper. The scale on the left is millimeters.

Find a transfer function  

I tried first to tune the LCD panel grayscale using, among others, the gamma value of the picture. Actually the paper and the film have the same light sensibility, only the film has a negative image. And this is not linear compare to my digital LCD panel.

In order to get a reasonably good gray gradient, I had to change too much the picture values. So much that I get artifacts on the paper, the result of a loss in the tones resolution. Even with the source raw 14bits image, I got banding (aliasing) between light gray values. Because the screen itself has a tone resolution of 8 bits: 256 different shades of gray.

IMG_7293b

 

Using time to generate grays 

As a friend advised me, the solution is to use the exposure time to generate smooth gray values: like resin 3D printers do with each layers, here exposing an area longer will give darker tones.

I made a small program to expose square tiles of the paper with different times. The idea is to get a calibration curve.

IMG_7287

cal2

After several attempts I got a curve: time in function of darkness.

It appears that another phenomenon should be taken in account: the paper takes 1 or 2 seconds to react. Then it is very sensible for the first 15 seconds, then it gradually looses reactivity, so it takes longer to have a slightly darker black.

 

The next step is to make a program that translate the tone value into time, and generate the animation. See below the famous Big Buck Bunny as an example (the time between each values is constant on the GIF, but not when generated with the program) :

bbb_anim

bbb-splash

 

Comparisons and outlook

It is indeed quite hard to show with pictures the different feelings of prints. Below, on the left is a professional print with their tunings and on the right is the black and white Ilford paper with my own settings (less contrast and less digital sharpening).

IMG_7292

There is still room for improvements, especially on the light tones, but I prefer the true blacks of the b&w paper. It is difficult to see, and I’m very picky, but the professional print is a bit greenish. On the other hand, the black and white paper is by definition unable to produce colors.

To come back on the resolution, here is some close up of these prints :

IMG_7288

Pixels are visible on both prints and are about the same size. However, the LCD leaves tiny vertical lignes.

I let you make your own conclusions. But I can give you my feelings. I think it is a good solution to get digital pictures printed on a true black and white paper. It will not be better than a print from a film or high quality prints from a professional. However it gives good result in roughly 6 min. One minute for exposure, 2 minutes revelation bath, 1 minute stop bath, and 2 for the fixing bath. Rinse with water, et voilà 😉

IMG_7286-2

 

Creative Commons License

Mitigate the LED bright spots

IMG_6876PSicon

As a Playstation lover, I liked the concept of the decoration I saw on playstation-gear.com.

However, I was wondering if there is a way to make the light more equally diffused on the surface of the icons. It is as well a nice DIY exercice for the weekend.

First lets 3D draw the models with Fusion360. The shapes are hollowed and closed with a cap holding the LEDs:

fusion03

I populated the caps with SK6812 RGBW leds, and control them with an ESP32:

IMG_6864

I printed the body in one part, changing the filament color after the first millimeter to have the front transparent, but not the sides. I painted the inside with white acrylic to enhance diffusion:

IMG_6880

Then the idea was to diffuse the bright spots cast by the tiny LED. So I took a picture of them right away:

IMG_6862-2

Clean and filter this picture to have a black and white image representing the light intensity on the icon surface. I used the Fusion360 plugin image2surface to generate a mesh. Converting this mesh to t-spline surface, then cut a body with it to have the diffusion volume proportional to the light intensity.

Print this diffusion volume in transparent and assemble the 3 parts:

It’s not perfect and the process can be iterated, but with the right colors and a bit of animation, I think it is as good as the sold one.

IMG_6885

The 3D files can be found on thingiverse here. And the ESP32 code here : https://github.com/pierre-muth/ESP32PlaystationIcons

IMG_6876

Creative Commons License

Rear car Speedometer

Context

It’s subject to debate and delicate, but maybe you experienced this situation yourself while driving a car. The driver of another car, just behind you, would kindly like to travel at a higher speed. On your side however, you apparently yet travel at the maximum legal speed.dJE4v0b

An hypothesis is the speedometers of both cars don’t agree. So why not showing in real time your actual traveling speed on the back of the car ?

Let’s make it looks like a Sonic the hedgehog power-up monitor !

Reading the car speed

speedo_1I could use a GPS module to have the car speed, but I think there are two disadvantages. First, we loose it on tunnels, and second I’d like to show what I’m reading on my dashboard.

My first idea was to use a bluetooth OBD plug, and then connect to it with an ESP32. But I did not succeed because the OBD dongle I have uses classic bluetooth and not BLE. In addition I did not found a 12v power line on the trunk that is switching off once the ignition key removed. I don’t want to drain flat the car battery.
IMG_20191008_150300
So I re-purposed the cheap OBDII reader. Luckily it uses an ELM327 clone and the bluetooth module can be de-soldered. That saves me the code of the raw CAN-bus handling, the ELM327 uses simple serial AT style commands. And it saves me the design of the CAN-bus circuitry.

Passive display

To display the car speed I’d rather choose the most passive, simple technology while having a large digit size. It is out of question to use something that emits light.

E-paper could do the job, but large displays are pretty expensive, and I’m not sure if they can handle the rough condition of a car parked in sunlight or a freezing winter.

Electro-mechanic Flip display would be a good choice if only the big 7 segments units were not so expensive. Besides, I’m not sure the continuous flipping would be good for the display and the driver ears.

Fortunately we can still find good old fashion 7 segments LCD in large size. I yet use some of these panel on the BIG_CLOCK project. The biggest apparently are made by Lumex, the LCDS101D40TR. The character size is 10×7 cm.

speedo_2

Only two digit is relevant in my opinion. At a speed faster than 100Km/h, digits should be unreadable due to the safety distance. So we have to drive only 14 segments. The PIC16F19156 can drive them directly, without multiplexing.

The code simply take the received byte on the serial port and display its decimal value from 0 to 99.

Processing

Originally I planed to use a wireless bluetooth link, it explains why I started and kept an ESP32. It’s a bit overkill for the task, but there is nice libraries for plenty of devices. I used Platform.io on Visual Studio Code, with Arduino, for the development.

One interesting point here is the use of the 3 serial ports. One for the programming / debug, one to the ELM327, and one to the LCD screen.

I also add a little Oled display for debug and showing what speed is acquired.

3D printed enclosures

To put the two electronic boards plus some wiring, I made a case that fits inside the rear cup holder. Conveniently there is a 12v plug just aside. I need 3 cables: the 12v, the connexion to the OBD plug in the front, and the connexion to the rear LCD. I re-purposed old Lemo 3 way plugs, a perfect fit.

On nighttime everything glows red, without being annoying.

To hold the LCD panels it appends I have a Sonic the hedgehog plush on the back of the car, why not try to mimic the power-up monitors of the video game ? I printed this enclosure in PETG because I had bad experience with PLA on direct sunlight. I tried to have an ajustable, stable and discreet design.

And here is how it looks like on the car :

IMG_20191009_114723

The 3D files, the PIC code and the ESP32 code can be found here.

Creative Commons License

A bed Lamp – Sunday project

bedLamp

An issue of falling asleep while reading in bed is the lamp will be on forever. A lamp that fade gently off after a certain time is strategically good for a peaceful couple relationship and for a rainy Sunday project.

Few constraints

  • Fading off after 1 hour
  • Pseudo color (temperature) control
  • 5V powered

Electronics

LEDThe LED used is a SK6812 with 4 channel, R, G, B and warm white.

The microcontroller is a PIC12F1840. A potentiometer gives an analog value for the color.

To control the SK6812, I used the work of Steve Phillips. He discover that the serial protocol is easier to implement than described in the SK6812 ‘datasheet’. Basically “A 0 bit is given when the high voltage time is less than roughly 0.35µs.” and for a 1 bit “As long as you don’t pull low for 50µs between high voltage points, you are fine.

schema

The analog value is read in a loop and is used to determine the color and intensity of the led. If this value does not change during 1 hour, the color is faded gently.

The PIC code is in this repository : https://github.com/pierre-muth/Bed_Lamp

3D printed body

I used Fusion 360 for the 3D drawing. A set of gears make the potentiometer rotation linked to the base rotation. In order to get a reasonably directional cone of light, I made a “nozzle” like shape, that can be orientated thanks to a ball joint connection.

Printed in PLA during a night on a Prusa i3 MK3, and the inside is painted in white. Files are on thingiverse here.

IMG_6790

Result

IMG_6782

IMG_6783

bedLamp

Thanks for reading!

Creative Commons License

The quest of a beacon for cats (part 2)

IMG_6452

It’s been few month now Mio is wearing the beacon, so what can we conclude ? First part: The quest of a beacon for cats (part 1)

Battery lifetime

The CR2032 battery lasted 100 days, with 60 seconds between RF emissions. It corresponds to roughly 144’000 pulses. As the beacon transmits the battery voltage, I could log and trace the trend. However the voltage of these battery don’t drop gently at the end of their life. There is a slight slope a month before dying, but I suppose it’s better to anticipate and exchange the battery after 12 weeks of use.

batteryLifetime

Field research

Mio’s collar has a lock that opens itself if too much pull strength is applied. It appended once the collar stayed outside because Mio hang it up at a fence (or maybe it’s possible I didn’t close it correctly).

It was interesting to search it by looking at the RSSI value on the receiver. It was fun as well for my neighbors, how saw me roaming around with an antenna. In the end the necklace was lying on a fence something like 50 meters away from the house. By making circles around I could estimate the range to maximum 100 meters.

As it was rightfully pointed out to me, the beacon allows to find the collar, not the cat. But the chances Mio keeps the collar is greater than nothing at all.

Conclusion

I’m rather satisfied by the battery lifetime and the range, so I will probably keep this solution for a long time. We really enjoy seeing the beacon signal chart, it reassures us to know Mio is around.
Creative Commons License

3D printed Synchrotron Magnet replica

 

The Cern Proton-Synchrotron (PS) is a fascinating machine. While there are many synchrotrons around the world, this one started its operation in 1959. The PS, which is nowadays part of the acceleration chain of the Large Hadron Collider (LHC), measures 628 meters of circumference. It was the first strong-focusing synchrotron (or alternating-gradient focusing), at a time when synchrotrons look like the BLN Cosmotron.

The PS main magnet units combine dipole and quadrupole magnetic functions, weight more than 30 tons and are around 4.2 meters long.

There are a 100 of these magnets along the PS ring. Some coils have been replaced, but they are still the same and the yokes are untouched.

For more details about the PS and its history, there is a complete and nicely written report available on the Cern website: http://cds.cern.ch/record/1359959

In 1959 John Adams (leader of the construction team at that time) announced the successful acceleration of protons up to 24GeV.

If you pay attention, on the picture you can spot a small scale model on the desk.

That is the target of this blog post.

2-0290.jpgThere is plenty of documentations and archives at Cern, and it was impressive to find the original mechanical drawings of the magnets. So I started Fusion360 and played with the drawings. Of course, there are yet 3D models files, but they are extremely detailed and it would shortcut the fun.

Let start with the yokes:

The magnet blocks stand:

Coils, supports and feet:

And let’s print it :

The scale is 1:20 and pictures bellow show the difference with the real thing:

IMG_6546

IMG_6549

The STL files are in this repository : https://github.com/pierre-muth/PSMagnet

Thanks for reading !

Creative Commons License

Images from Cern are free of charge for educational and informational use. The Cern term of use for audiovisual media can be find here : https://copyright.web.cern.ch/ . This project was realized as a hobby, outside Cern.

Quick & basic equatorial mount motorisation

IMG-20190225-WA0000

Several years ago I had a challenging combo in mind. Giving a try to astro-photography while not ruining myself.

orion mini EqI didn’t start with nothing as I would like to use my camera, a full-frame DSLR with a variety of lens. I don’t have any experience in astro-photography, then I bought the Orion Mini-Eq, a beginner tabletop equatorial mount for camera, plus a small DC motor. But I didn’t manage to get decent shots, and the mount start to be dusty.

I recently focus a bit more on this subject and I tried to improve myself on two key ingredients. The orientation and the motorisation.

The main axis of the mount should be precisely set parallel to the Earth rotating axis, in order to compensate this rotation with the motor. This will enable taking long exposure picture without start trails.

Orientation

In the north hemisphere a good approximation is to target the polar star (Polaris) to align the main axis. But it implies, in my case, to set the second axis precisely to 0 and have the star in view. The markings on this mount are not really helpful and Polaris is visible only on one side of the house. So I printed a plate with a cylinder that fits in the bottom tube of the main axis. It is precisely at 46.28 degrees, the latitude of my place.

orion mini Eq print plate

On this plate I can put a bull’s eye bubble level and a compass (or a phone). It is not perfect I imagine, but it helps me learn.

Motorisation

The main axis rotation speed should be one turn per day, the same as the Earth.

motor gearboxI found on eBay some stepper motors with a gearbox. The gear around the Eq-mount divides the rotation by 100 already, so adding a 1:100 gearbox on the stepper side divides it, in total, by 10’000. There is 86’400 seconds in a day, so the stepper motor speed should be 8.64 seconds per turn. This gearbox has a compact planetary gears arrangement.

Controller

silentstepstick-tmc2130-stepper-motor-driverI choose the famous TMC2130 stepper motor controller, mainly because the silent StealthChop mode promises a smooth rotation. In particular the Silent-Step-Stick board of Watterott/pololu, that simplifies the wiring.

An article in hackaday describes in detail how these controllers work. This time I would like to have something  useful rapidly, I then took an ESP32 with the arduino framework. I could just plug libraries for the TMC2130 and for a small LCD character screen.

IMG_20190315_103535

The ESP32 has to send pulses to the stepper motor controller, corresponding to the steps we want to generate. The motor has 200 steps per revolution, and the controller supports 256 micro-steps. It means we have to generate 51’200 pulses per motor revolution. We saw that the motor has to spin at 8.64 seconds per turn, so it gives 5925.9 pulses per seconds.

Coming from tiny 8bit micro-controllers, I first used a timer of the ESP32 to generate the pulses at a precise time interval. The ESP32 has timers that can be set down to the 80Mhz clock and the counter it on 64bits, which is quite remarkable. I set the prescaler at 80 to count micro-seconds, and the counter to 1687 in order to generate interrupts 5925 times per seconds. On the interrupt routine, we just flip high and low the step pin.

However I didn’t expect that the generated pulses don’t have a stable period. I naively forgot the ESP32 arduino framework probably relies on RTOS, thus some interrupts has greater priority than my timer. The period time in average is correct of course, but the period varies pulse to pulse.

After some googling, it was obvious to use the PWM instead. Everything is there with the ledc() function, and can be set with a 0.4 Hz resolution. I measured the pulse period difference between timer and PWM method :

timerVSpwm

Enough confident after this success, I just add three buttons to change the digit values of the output frequency, and the rotation direction. Also an option to stop the motor, it should not spin when the power is cut.

Next step is to make a basic case to put everything inside, my awful wiring don’t deserve public views.

And finally, I attached the motor on the Eq mount.

With everything attached, the system looks like that:

IMG_20190317_115945

The two following pictures are single frames, quickly processed from the raw camera files. Bellow is the Orion nebula, the tracking speed is not perfect as the stars still make trails. The theoretical value of 5925Hz micro-step frequency is certainly off due to the ESP32 oscillator real value. The exposure time is 60 seconds.

IMG-20190225-WA0001

Bellow the Andromeda galaxy, 60 seconds as well but with corrected frequency, hence a better tracking.

IMG-20190225-WA0000

Conclusion

I have now no excuse for waiting a clear night and start learning picture stacking with advanced astro-photo softwares !

You can find the arduino code and the 3D files here on github: https://github.com/pierre-muth/QuickEqMountController

Creative Commons License

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 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.

Creative Commons License