After battering the case I had in stock already, I managed to fit in the display and the pots.
After the initial tests I decided to put the board in an enclosure. On the hardware side, this is mainly a wiring project with a low pass filter and decoupling caps plus the microcontroller. I put the chip on a universal board. Drilled 1.5 mm holes for the wires for mechanical protection and added the ISP header in the middle of the board since that would be the best fit inside the enclosure.
For the first prototype I bought a ready made motor driver circuit which will also provide the power supply for the AVR. It has an on board voltage regulator chip. The case needed a bit of an update to accommodate this. It looks ugly, but at least the heat sink is outside the box.
This is a quick "lego" project. I put together some ready made components with a microcontroller. We needed a driver to drive motors at relatively accurate revs with a display and user controls. I used an Atmel ATmega328P as the main microcontroller since I had one lying around, anyway. However, this is not an Arduino project, it's AVR C. It's essentially the same thing, but using the avr-gcc directly gives you (I'd say a lot) more freedom at a price of higher complexity. However, your code will be more portable. This will work on an ATmega8 or ATmega88 and above and with not too many modifications. You can reuse bits across many Atmel microcontrollers, too. The frequency is not very critical for this, it will probably work in the 4-20 MHz range. This prototype currently runs on 8 MHz. The initial specs were the following: it should operate from a cheap 6-12V lab supply and would be able to drive a range of motors with 1Hz accuracy up to 1kHz (if only one oscillation / revolution is made this is 60 000 rpm) with a user display and convenient controls.
I soldered the main controller, the ISP header, the low pass filer, the extra pull-up for the reset pin plus the decoupling caps. I flashed the program onto the AVR and tested the circuit. I didn't have any 4 mm connectors in stock, so just decided to put the wires in. I left some space on the board for maybe a crystal or extra bits for stabilizing of the motor speed if needed.
I remember having my first Nokia 5110 - I loved that phone and I'm glad to see that the displays are still in the market, so that had to be my next component. A Nokia 5110 display - I was looking forward to firing up that one. I added 2 pots for the control (my idea was to implement a coarse - fine type control), since I prefer pots over push buttons.
I could've included proper connectors for the headers, but since the LCD driver is working all right, I just soldered the wires onto the board.
Finally, I put the stuff together and connected an old DC motor. Listen to that cool tram starting noise from the PWM. :)
What's left to implement is a frequency measurement circuit - hence the 3 unconnected wires... Stay tuned.
CODE examples are on GitHub
About this blog
Welcome and thanks for visiting my site.