Tag Archives: 3D printing

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

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

Thanks for reading and if you’d like to go further, this repository might interest you.

Creative Commons License

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

Creative Commons License

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)

Creative Commons License