RFC Hardware Choices

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
seaside_motors
Posts: 17
Joined: Thu Mar 25, 2021 4:19 am

RFC Hardware Choices

Post by seaside_motors » Thu Mar 25, 2021 4:28 am

Hello All, my name is Robert and I am new to the forums. I have come here to request help in product selection and to get general ideas in getting direction. I want to learn to program microcontrollers in the automotive realm, this would be for custom projects and I am at the moment not interested in CAN bus or OBDII connectivity.

I want to work with raw sensor signalling, 9-16v i/o signalling, relay controls, data output to digital displays, etc...

For my first ambitious project I want to build a glow plug controller for a 4 cylinder diesel. So glow pugs are basically resistance heaters for the combustion chamber to bring the chamber temps up for initial cold starting. I have a original basic controller from 1986 that uses a simple microcontroller to control a single relay. It has 1) 12V Bat Pwr. (input) 2) 12V Key On Pwr (input) 3) 12V Start Sig. (input) 4) 12V Grnd (Input) 5) 12V Light Signal to Dashboard 6) 12V Output to GlowPlugs. The electronics on this are all on a single board with the 70amp relay hard soldered to the board, all included in a sealed plastic housing. Its operation is very basic in the following order: 1) Key On signal, energize relay, output light signal to dash, start 8 second count down...if start signal, stop countdown, de-energize relay...sequence complete. If key is turned off and then turned back on, restart sequence. Always kill sequence on starter signal or key off signal, restart sequence at key on.

What I would like to do is to make things more advanced and possibly adding in user interrupts/controls. I would like to add in additional inputs such as engine coolant temperature, ambient outside temperature, variable glow timing based on temperature inputs, afterglow functionality after engine start with reduced glow (pwm volt/amperage control?), individual relays per cylinder for glow plug health monitoring (current monitoring, as glow pugs wear or possibly short circuit as they age they will draw more amperage which is a sign there is a problem in the circuit. If a glow plug starts disintegrating the ceramic will quickly destroy a cylinder). And a RPM signal input would be nice as well, would also output to lcd as mentioned next...

Now if that where not enough I want to be able to tie this into a LCD display (128x64??) that will show coolant and ambient temperature, glow countdown to engine start and count down after glow. LED monitors, blue flashing during glow operations, blue during normal engine operation and flashing red for over-current situations. Possible user interrupts maybe to manually operate glowplug relays in the event of software failure or other yet determined features. Oh yes, and I will need a traditional buzzer to sound during initial glowplug operation.

Once this is installed in the vehicle it will be a hands off self contained operation. There is no need for further programming or user intervention. There is no need for bluetooth/wifi/eth connectivity. I could literally burn the program to a ROM chip and ship to end user as a complete package.

My question is what development board (I am not a brand specific guy so anything from py board, feather board, Texas Instruments boards, whatever works) should I consider given the above parameters? Ultimately to get started I could use low voltage 3.3v relays and simulate glow plugs with leds, I could bread board the various components and build the code. I could get the sensors programmed etc..

Speaking of building code, I am assuming I would use micro-python for this, but perhaps I might have to learn ada or C+? I have almost zero programming experience, ;p so hey I am an empty cup ready to learn. I am on Linux and am good enough to get have configured vim for python so not completely inept at the game.

Any guidance on where to get started would be kindly appreciated. I am suffering a little from paralysis by over-analysis.
Thank You,
Robert

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RFC Hardware Choices

Post by pythoncoder » Thu Mar 25, 2021 7:49 am

It sounds like an ideal MicroPython project. Given that you don't need WiFi I would recommend against ESP32 and ESP8266 as they have challenges in realtime applications. A Pyboard 1.1 or D series would work fine, but the cheapest option is the Raspberry Pi Pico. This offers a level of performance per $ which I find awesome.

If you intend to go into production, the Pico has the advantage that the PCB is designed to be soldered to a mother board. Pyboards can be used with mother boards, but it's not quite as simple or zero cost.
Peter Hinch
Index to my micropython libraries.

nekomatic
Posts: 37
Joined: Thu May 08, 2014 9:31 pm

Re: RFC Hardware Choices

Post by nekomatic » Tue Mar 30, 2021 12:20 pm

Yes, sounds like a good project and the Pico sounds like a good board. Developing everything on breadboard with logic level voltages first is a good idea. If you aren't already familiar with this, you'll want to learn sooner rather than later how to protect the inputs, outputs and power supply of your controller from the sort of voltage spikes that you get in automotive systems and/or when using relays or motors. Optoisolators are probably a good choice for any digital I/O.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RFC Hardware Choices

Post by pythoncoder » Wed Mar 31, 2021 12:09 pm

Good point - I didn't touch on the evils of automotive design. These include an extreme temperature range especially if the product is for a global market.
Peter Hinch
Index to my micropython libraries.

seaside_motors
Posts: 17
Joined: Thu Mar 25, 2021 4:19 am

Re: RFC Hardware Choices

Post by seaside_motors » Thu Apr 01, 2021 6:01 am

Hey Guys,

Thanks for the replies, I really do appreciate the time to comment.

I am still trying to get my direction on this one but slowly but surely I am headed in the right direction. Been working on some python tutorials, trying to upgrade my typing skills, doing research etc. Interesting that nekomatic had mentioned the pico as being a good choice as I stopped by my local bookseller and there was the Feb issue of Hackspace with a Pico board included. So I now have a pico board to start working with, I already got micropython install on it and wrote a basic led blink program.

I had wrote it in vim, named it blinkpico.py and then tried to send it to the pico with <prompt$>echo blinkpico.py >> /dev/ttyusb0 Now this did not error out in the command shell but the program did not execute on the pico. If I open Thonny and open the same file and click run it executes and blinks the led. I checked the interface in Thonny and the /dev/ttyusb0 and they are indeed the same. (ttyusb0 is the not the actual device, Im just using that as an example for this explanation)

Anyways, if anyone can point me in the right direction of how to run a program straight out of the text editor and execute it on the pico that would be pretty slick. Thanks in advance.

I think one of my first little subprojects is to interface with a coolant temp sensor. So at cold temperature it will have a high resistance and as the coolant warms up the resistance will drop lower. I will have to code a conversion table and also put in fail safe stops so it doesn't error out of the sensor fails. I want to output the readings to a lcd and perhaps program a simple button that will cycle between C* and F*. I think that will be a great coding project and hardware interface project and will be a key component to the larger glow plug controller project.

Cheers,
Robert

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: RFC Hardware Choices

Post by Roberthh » Thu Apr 01, 2021 6:47 am

The reaon why simply pasting code into the REPL prompt fails is the autoindent feature of REPL. For pasting you have to switch to Paste mode with Ctrl-E, which will by finished by Ctrl-D. Or you use raw mode with Ctrl-A and Ctrl-B. That's what Thonny and pyboard.py are using. You can use pyboard.py for your purpose. See: https://github.com/micropython/micropyt ... pyboard.py

Post Reply